Skip to content

Commit

Permalink
更新0.16.1版本
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukino0812 committed Dec 10, 2020
1 parent 109272c commit 9a909fd
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ polyv-android-cloudClass-sdk-demo
===

[![build passing](https://img.shields.io/badge/build-passing-brightgreen.svg)](#)
[![GitHub release](https://img.shields.io/badge/release-v0.16.0-blue.svg)](https://github.com/polyv/polyv-android-cloudClass-sdk-demo/releases/tag/v0.16.0)
[![GitHub release](https://img.shields.io/badge/release-v0.16.1-blue.svg)](https://github.com/polyv/polyv-android-cloudClass-sdk-demo/releases/tag/v0.16.1)

### !!!集成请务必参考[wiki](https://github.com/polyv/polyv-android-cloudClass-sdk-demo/wiki)文档

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.easefun.polyv.cloudclassdemo.watch.linkMic.widget.PolyvLinkMicListView;
import com.easefun.polyv.foundationsdk.log.PolyvCommonLog;
import com.easefun.polyv.foundationsdk.rx.PolyvRxTimer;
import com.easefun.polyv.foundationsdk.utils.PolyvFormatUtils;
import com.easefun.polyv.linkmic.PolyvLinkMicWrapper;
import com.plv.rtc.PLVARTCConstants;

Expand Down Expand Up @@ -145,7 +146,7 @@ public void onClick(View v) {
PolyvCommonLog.d(TAG, "cameraOpen:" + cameraOpen);
surfaceView.setVisibility(cameraOpen ? View.VISIBLE : View.INVISIBLE);
}
long longUid = Long.valueOf(uid);
long longUid = PolyvFormatUtils.parseLong(uid);
if (uid == myUid) {
PolyvLinkMicWrapper.getInstance().setupLocalVideo(surfaceView,
PLVARTCConstants.RENDER_MODE_HIDDEN, (int) longUid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.easefun.polyv.cloudclassdemo.R;
import com.easefun.polyv.foundationsdk.log.PolyvCommonLog;
import com.easefun.polyv.foundationsdk.utils.PolyvAppUtils;
import com.easefun.polyv.foundationsdk.utils.PolyvFormatUtils;
import com.easefun.polyv.foundationsdk.utils.PolyvScreenUtils;
import com.easefun.polyv.linkmic.PolyvLinkMicWrapper;
import com.easefun.polyv.thirdpart.blankj.utilcode.util.ScreenUtils;
Expand Down Expand Up @@ -256,7 +257,7 @@ public void onBindViewHolder(PolyvLinkMicDataBinder.PolyvMicHodler holder, int p
}
}

long longUid = Long.valueOf(uid);
long longUid = PolyvFormatUtils.parseLong(uid);
if (uid.equals(myUid)) {
PolyvLinkMicWrapper.getInstance().setupLocalVideo(surfaceView,
PLVARTCConstants.RENDER_MODE_FIT, (int) longUid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.easefun.polyv.foundationsdk.log.PolyvCommonLog;
import com.easefun.polyv.foundationsdk.rx.PolyvRxTimer;
import com.easefun.polyv.foundationsdk.utils.PolyvAppUtils;
import com.easefun.polyv.foundationsdk.utils.PolyvFormatUtils;
import com.easefun.polyv.foundationsdk.utils.PolyvScreenUtils;
import com.easefun.polyv.linkmic.PolyvLinkMicWrapper;
import com.plv.rtc.PLVARTCAudioVolumeInfo;
Expand Down Expand Up @@ -207,7 +208,7 @@ public boolean onTouch(View v, MotionEvent event) {
holder.soundRoundView.setVisibility(View.VISIBLE);
PolyvCommonLog.d(TAG, "cameraOpen:" + cameraOpen);
}
long longUid = Long.valueOf(uid);
long longUid = PolyvFormatUtils.parseLong(uid);
if (uid.equals(myUid)) {
PolyvLinkMicWrapper.getInstance().setupLocalVideo(surfaceView,
PLVARTCConstants.RENDER_MODE_FIT, (int) longUid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,15 @@ public void showCameraView() {
}


@Override
public void changePPTVideoLocation() {
if (!showPPT) {//如果不显示ppt 不触发此功能
return;
}
changePPTVideoLocationUncheckPPT();
}

public void changePPTVideoLocationUncheckPPT() {
if (polyvCloudClassPlayerHelper != null) {
if (!polyvCloudClassPlayerHelper.changePPTViewToVideoView(showPPTSubView)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import com.easefun.polyv.foundationsdk.rx.PolyvRxBus;
import com.easefun.polyv.foundationsdk.rx.PolyvRxTimer;
import com.easefun.polyv.foundationsdk.utils.PolyvAppUtils;
import com.easefun.polyv.foundationsdk.utils.PolyvFormatUtils;
import com.easefun.polyv.foundationsdk.utils.PolyvGsonUtil;
import com.easefun.polyv.foundationsdk.utils.PolyvScreenUtils;
import com.easefun.polyv.linkmic.PolyvLinkMicAGEventHandler;
Expand All @@ -67,6 +68,8 @@
import com.easefun.polyv.thirdpart.blankj.utilcode.util.ScreenUtils;
import com.easefun.polyv.thirdpart.blankj.utilcode.util.ToastUtils;
import com.easefun.polyv.thirdpart.blankj.utilcode.util.Utils;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.plv.rtc.PLVARTCAudioVolumeInfo;
import com.plv.rtc.PLVARTCConstants;

Expand All @@ -89,7 +92,6 @@
import static com.easefun.polyv.businesssdk.api.common.ppt.PolyvCloudClassPPTProcessor.CHAT_LOGIN;
import static com.easefun.polyv.businesssdk.api.common.ppt.PolyvCloudClassPPTProcessor.ERASE_STATUS;
import static com.easefun.polyv.businesssdk.api.common.ppt.PolyvCloudClassPPTProcessor.PPT_PAINT_STATUS;
import static com.easefun.polyv.businesssdk.api.common.ppt.PolyvCloudClassPPTProcessor.SETSEIDATA;
import static com.easefun.polyv.businesssdk.model.ppt.PolyvPPTAuthentic.PermissionType.VOICE;
import static com.easefun.polyv.businesssdk.sp.PolyvPreConstant.LINK_MIC_TOKEN;
import static com.easefun.polyv.cloudclass.PolyvSocketEvent.ONSLICECONTROL;
Expand Down Expand Up @@ -897,6 +899,30 @@ public void onNewMessage(String message, String event) {
public void onDestroy() {
}
});

// 进入直播间时 主副屏跟随讲师端显示
PolyvChatManager.getInstance().addNewMessageListener(new PolyvNewMessageListener() {
@Override
public void onNewMessage(String message, String event) {
if (ONSLICEID.equals(event)) {
PolyvChatManager.getInstance().removeNewMessageListener(this);

JsonObject jsonObject = new JsonParser().parse(message).getAsJsonObject();
// pptAndVideoPosition 0表示讲师端目前ppt在主屏 1表示讲师端目前播放器在主屏
int pptAndVideoPosition = jsonObject.get("pptAndVedioPosition").getAsInt();
// 跟随讲师端主副屏位置
boolean needToChangePptVideoPosition = pptAndVideoPosition == 0 ^ pptShowMainScreen();
if (needToChangePptVideoPosition) {
controller.changePPTVideoLocationUncheckPPT();
}
}
}

@Override
public void onDestroy() {

}
});
}

private void processLeaveMessage(String userId) {
Expand Down Expand Up @@ -1317,7 +1343,7 @@ private void showRtcView(boolean show, String teacherId) {
try {
if (show) {
PolyvLinkMicWrapper.getInstance().setupRemoteVideo(surfaceView,
PLVARTCConstants.RENDER_MODE_FIT, Integer.valueOf(teacherId));
PLVARTCConstants.RENDER_MODE_FIT, PolyvFormatUtils.parseInt(teacherId));
}
} catch (Exception e) {
PolyvCommonLog.exception(e);
Expand Down Expand Up @@ -1521,7 +1547,7 @@ public void accept(Object o) throws Exception {
private void joinLinkByParticipant() {
initSupportRTC();
if(!TextUtils.isEmpty(PolyvVClassGlobalConfig.viewerId)){
PolyvLinkMicWrapper.getInstance().getEngineConfig().mUid = Integer.valueOf(PolyvVClassGlobalConfig.viewerId);
PolyvLinkMicWrapper.getInstance().getEngineConfig().mUid = PolyvFormatUtils.parseInt(PolyvVClassGlobalConfig.viewerId);
}
createLinkMicLayout(linkMicLayout, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import com.easefun.polyv.foundationsdk.log.PolyvCommonLog;
import com.easefun.polyv.foundationsdk.rx.PolyvRxBus;
import com.easefun.polyv.foundationsdk.utils.PolyvControlUtils;
import com.easefun.polyv.foundationsdk.utils.PolyvFormatUtils;
import com.easefun.polyv.foundationsdk.utils.PolyvGsonUtil;
import com.easefun.polyv.foundationsdk.utils.PolyvScreenUtils;
import com.easefun.polyv.linkmic.PolyvLinkMicWrapper;
Expand Down Expand Up @@ -511,7 +512,7 @@ public void OnLinesChanged(int pos) {
polyvCloudClassVideoView.setOnSEIRefreshListener(new IPolyvVideoViewListenerEvent.OnSEIRefreshListener() {
@Override
public void onSEIRefresh(int seiType, byte[] seiData) {
long ts = Long.valueOf(new String(seiData));
long ts = PolyvFormatUtils.parseLong(new String(seiData));
PolyvCommonLog.d(TAG, "sei ts :" + ts);
if (polyvPPTItem != null) {
polyvPPTItem.getPPTView().sendWebMessage(SETSEIDATA, "{\"time\":" + ts + "}");
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ ext {
compileSdkVersion = 29
minSdkVersion = 21
targetSdkVersion = 29
versionCode = 160
versionName = "0.16.0"
versionCode = 161
versionName = "0.16.1"
}

task clean(type: Delete) {
Expand Down
2 changes: 1 addition & 1 deletion commonui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
api 'com.android.support:design:27.1.1'
api 'com.easefun.polyv:polyvSDKCloudClass:0.16.0'
api 'com.easefun.polyv:polyvSDKCloudClass:0.16.1'
//glide
api ('jp.wasabeef:glide-transformations:3.3.0'){
// exclude group:'com.github.bumptech.glide',module:'glide'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.util.Log;

import com.easefun.polyv.foundationsdk.log.PolyvCommonLog;
import com.easefun.polyv.foundationsdk.utils.PolyvFormatUtils;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand Down Expand Up @@ -148,7 +149,7 @@ public static String getPath(final Context context, final Uri uri) {
else if (isDownloadsDocument(uri)) {
final String id = DocumentsContract.getDocumentId(uri);
final Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"),
Long.valueOf(id));
PolyvFormatUtils.parseLong(id));
return getDataColumn(context, contentUri, null, null);
}
// MediaProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import android.graphics.PointF;
import android.util.Log;

import com.easefun.polyv.foundationsdk.utils.PolyvFormatUtils;

import java.lang.ref.WeakReference;
import java.util.Random;

Expand Down Expand Up @@ -56,7 +58,7 @@ public void draw(Canvas canvas) {
for (int i = 0; i < mFragments.length; i++) {
for (int j = 0; j < mFragments[i].length; j++) {
BitmapFragment bf = mFragments[i][j];
float value = Float.parseFloat(getAnimatedValue().toString());
float value = PolyvFormatUtils.parseFloat(getAnimatedValue().toString());
bf.updata(value, canvas);
}
}
Expand Down

0 comments on commit 9a909fd

Please sign in to comment.