Skip to content

Commit 60d9226

Browse files
committed
升级版本到1.4.2
1 parent babb4a2 commit 60d9226

39 files changed

Lines changed: 646 additions & 124 deletions

File tree

build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@ allprojects {
3030
maven{
3131
url 'https://maven.aliyun.com/repository/public'
3232
}
33-
3433
}
3534
}
3635

3736
ext {
3837
compileSdkVersion = 27
3938
minSdkVersion = 21
4039
targetSdkVersion = 27
41-
versionCode = 141
42-
versionName = "1.4.1"
40+
versionCode = 142
41+
versionName = "1.4.2"
4342
}
4443

4544
task clean(type: Delete) {

demo/src/main/java/com/easefun/polyv/livedemo/PLVApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public void onCreate() {
1616
PLVLiveSDKConfig.init(
1717
new PLVLiveSDKConfig.Parameter(this)
1818
.isOpenDebugLog(true)
19-
.isEnableHttpDns(true)
19+
.isEnableHttpDns(false)
2020
);
2121
}
2222
}

polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/modules/chatroom/PLVLCChatFragment.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,11 +599,14 @@ private void openCamera() {
599599
values.put(MediaStore.Images.Media.DISPLAY_NAME, picName);
600600
takePictureUri = getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
601601
} else {
602+
if (getContext() == null || getContext().getApplicationContext() == null) {
603+
return;
604+
}
602605
String savePath = PLVSDCardUtils.createPath(getContext(), "PLVChatImg");
603606
takePictureFilePath = new File(savePath, picName);
604607
takePictureUri = FileProvider.getUriForFile(
605608
getContext(),
606-
"plvfileprovider",
609+
getContext().getApplicationContext().getPackageName() + ".plvfileprovider",
607610
takePictureFilePath);
608611
}
609612

polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/modules/linkmic/PLVLCLinkMicLayout.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public class PLVLCLinkMicLayout extends FrameLayout implements IPLVLinkMicContra
5757
// <editor-fold defaultstate="collapsed" desc="变量">
5858
private static final String TAG = PLVLCLinkMicLayout.class.getSimpleName();
5959

60+
// 连麦权限请求失败错误码
61+
private static final int ERROR_PERMISSION_DENIED = 1060501;
62+
6063
//尺寸
6164
private static final int DP_LAND_LINK_MIC_LIST_MARGIN_LEFT = 8;
6265
private static final int DP_LAND_LINK_MIC_LIST_MARGIN_RIGHT = 34;
@@ -390,7 +393,7 @@ public void updateFirstScreenChanged(String firstScreenLinkMicId, int oldPos, in
390393
@Override
391394
public void onLinkMicError(int errorCode, Throwable throwable) {
392395
PLVCommonLog.exception(throwable);
393-
if (errorCode == 1060501) {
396+
if (errorCode == ERROR_PERMISSION_DENIED) {
394397
new AlertDialog.Builder(getContext()).setTitle(R.string.plv_common_dialog_tip)
395398
.setMessage(R.string.plv_linkmic_error_tip_permission_denied)
396399
.setPositiveButton(R.string.plv_common_dialog_confirm, new DialogInterface.OnClickListener() {

polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/modules/linkmic/adapter/PLVLinkMicListAdapter.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.jetbrains.annotations.NotNull;
2727

2828
import java.util.List;
29+
import java.util.Locale;
2930

3031
/**
3132
* date: 2020/7/27
@@ -256,8 +257,12 @@ public LinkMicItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int v
256257
SurfaceView renderView = adapterCallback.createLinkMicRenderView();
257258

258259
LinkMicItemViewHolder viewHolder = new LinkMicItemViewHolder(itemView);
259-
viewHolder.renderView = renderView;
260-
viewHolder.flRenderViewContainer.addView(renderView, getRenderViewLayoutParam());
260+
if (renderView != null) {
261+
viewHolder.renderView = renderView;
262+
viewHolder.flRenderViewContainer.addView(renderView, getRenderViewLayoutParam());
263+
} else {
264+
PLVCommonLog.e(TAG, "create render view return null");
265+
}
261266
return viewHolder;
262267
}
263268

@@ -271,8 +276,12 @@ public void onBindViewHolder(@NonNull final LinkMicItemViewHolder holder, final
271276
if (holder.isViewRecycled) {
272277
holder.isViewRecycled = false;
273278
holder.renderView = adapterCallback.createLinkMicRenderView();
274-
holder.flRenderViewContainer.addView(holder.renderView, getRenderViewLayoutParam());
275-
holder.isRenderViewSetup = false;
279+
if (holder.renderView != null) {
280+
holder.flRenderViewContainer.addView(holder.renderView, getRenderViewLayoutParam());
281+
holder.isRenderViewSetup = false;
282+
} else {
283+
PLVCommonLog.e(TAG, String.format(Locale.US, "create render view return null at position:%d", position));
284+
}
276285
}
277286
PLVLinkMicItemDataBean itemDataBean = dataList.get(position);
278287
String linkMicId = itemDataBean.getLinkMicId();

polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/modules/media/PLVLCLiveMediaLayout.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ private void initView() {
193193
mediaController = findViewById(R.id.controller_view);
194194
chatLandscapeLayout = findViewById(R.id.chat_landscape_ly);
195195

196+
// 底部占位图
197+
PLVLCPlaceHolderView placeHolderView = new PLVLCPlaceHolderView(getContext());
198+
placeHolderView.setVisibility(VISIBLE);
199+
placeHolderView.setPlaceHolderText("");
200+
addView(placeHolderView, 0);
201+
196202
initVideoView();
197203
initDanmuView();
198204
initMediaController();
@@ -292,6 +298,7 @@ public void onShow(boolean show) {
292298
onViewActionListener.onShowMediaController(show);
293299
}
294300
}
301+
295302
});
296303
}
297304

polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/modules/media/controller/PLVLCLiveMediaController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ public void clean() {
423423
dispose(bitPopupWindowTimer);
424424
dispose(reopenFloatingDelay);
425425
}
426+
426427
// </editor-fold>
427428

428429
// <editor-fold defaultstate="collapsed" desc="对外API - 重写View定义的方法">
@@ -585,9 +586,11 @@ public void onChanged(@Nullable PLVPlayInfoVO playInfoVO) {
585586
if (playInfoVO.isPlaying()) {
586587
videoPausePortIv.setSelected(true);
587588
videoPauseLandIv.setSelected(true);
589+
588590
} else {
589591
videoPausePortIv.setSelected(false);
590592
videoPauseLandIv.setSelected(false);
593+
591594
}
592595
}
593596
});
@@ -651,4 +654,5 @@ public void run() {
651654
}
652655
}
653656
// </editor-fold>
657+
654658
}

polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/modules/media/danmu/PLVLCLandscapeMessageSendPanel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import android.view.KeyEvent;
1010
import android.view.LayoutInflater;
1111
import android.view.View;
12+
import android.view.ViewGroup;
1213
import android.view.ViewTreeObserver;
1314
import android.view.inputmethod.EditorInfo;
1415
import android.widget.EditText;
@@ -65,7 +66,7 @@ public PLVLCLandscapeMessageSendPanel(AppCompatActivity appCompatActivity, View
6566
public void onGlobalLayout() {//all call
6667
int usableHeightNow = computeUsableHeight(childOfContent);
6768
if (usableHeightPrevious != usableHeightNow) {
68-
FrameLayout.LayoutParams flp = (FrameLayout.LayoutParams) llSendMessage.getLayoutParams();
69+
ViewGroup.LayoutParams flp = (ViewGroup.LayoutParams) llSendMessage.getLayoutParams();
6970
if (flp == null) {
7071
return;
7172
}

polyvLiveCloudClassScene/src/main/java/com/easefun/polyv/livecloudclass/scenes/PLVLCCloudClassActivity.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.util.Pair;
1212
import android.view.View;
1313
import android.view.ViewStub;
14+
import android.view.WindowManager;
1415

1516
import com.easefun.polyv.livecloudclass.R;
1617
import com.easefun.polyv.livecloudclass.modules.chatroom.chatlandscape.PLVLCChatLandscapeLayout;
@@ -252,6 +253,7 @@ public void onClick(DialogInterface dialog, int which) {
252253
}
253254
).show();
254255
}
256+
255257
// </editor-fold>
256258

257259
// <editor-fold defaultstate="collapsed" desc="初始化 - 页面参数">
@@ -709,6 +711,15 @@ public void onShowLandscapeRTCLayout(boolean show) {
709711
public void onChangeTeacherLocation(PLVViewSwitcher viewSwitcher, PLVSwitchViewAnchorLayout switchView) {
710712
viewSwitcher.registerSwitchVew(switchView, mediaLayout.getPlayerSwitchView());
711713
viewSwitcher.switchView();
714+
mediaLayout.getPlayerSwitchView().post(new Runnable() {
715+
@Override
716+
public void run() {
717+
if(mediaLayout != null && mediaLayout.getPlayerSwitchView() != null) {
718+
//兼容 constraint-layout 升级到 2.0.0+ 出现的无延迟黑屏问题
719+
mediaLayout.getPlayerSwitchView().requestLayout();
720+
}
721+
}
722+
});
712723
}
713724

714725
@Override
@@ -747,8 +758,11 @@ public void onConfigurationChanged(Configuration newConfig) {
747758
super.onConfigurationChanged(newConfig);
748759
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
749760
PLVScreenUtils.enterLandscape(this);
761+
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
750762
} else {
751763
PLVScreenUtils.enterPortrait(this);
764+
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN
765+
| WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
752766
}
753767
}
754768
// </editor-fold>

polyvLiveCommonModul/build.gradle

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,22 @@ android {
2121
// but continue the build even when errors are found:
2222
abortOnError false
2323
}
24+
repositories {
25+
flatDir {
26+
dirs 'libs'
27+
}
28+
}
2429
}
2530

2631
dependencies {
2732
implementation 'com.android.support:design:27.1.1'
28-
// 注意1.4.1起依赖的groupId已经变更,请整个依赖复制粘贴修改,勿只修改版本号
29-
api ('net.polyv.android:polyvSDKLiveScenes:1.4.1')
33+
api 'net.polyv.android:polyvSDKLiveScenes:1.4.2'
34+
3035
//glide
3136
api ("com.github.bumptech.glide:okhttp3-integration:4.7.1"){
3237
// exclude group:'com.github.bumptech.glide',module:'glide'
3338
}
3439
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
40+
41+
3542
}

0 commit comments

Comments
 (0)