Commit c2231a10 authored by jiangjiantao's avatar jiangjiantao

设置循环播放需要在开始播放之前

增加一些日志
parent b6da758b
......@@ -15,18 +15,18 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize|keyboard|navigation"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- <activity-->
<!-- android:name=".MainActivity"-->
<!-- android:configChanges="orientation|keyboardHidden|screenSize|keyboard|navigation"-->
<!-- android:exported="true"-->
<!-- android:launchMode="singleTask"-->
<!-- android:screenOrientation="portrait">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
</activity>
<!-- </activity>-->
<activity
android:name=".DetailActivity"
......
......@@ -49,10 +49,10 @@ public class SampleCoverVideo extends StandardGSYVideoPlayer {
protected void init(Context context) {
super.init(context);
mCoverImage = (ImageView) findViewById(R.id.thumbImage);
if (mThumbImageViewLayout != null &&
(mCurrentState == -1 || mCurrentState == CURRENT_STATE_NORMAL || mCurrentState == CURRENT_STATE_ERROR)) {
mThumbImageViewLayout.setVisibility(VISIBLE);
BLogUtil.log("显示封面");
}
Debuger.enable();
}
......@@ -165,6 +165,7 @@ public class SampleCoverVideo extends StandardGSYVideoPlayer {
super.onSurfaceUpdated(surface);
if (mThumbImageViewLayout != null && mThumbImageViewLayout.getVisibility() == VISIBLE) {
mThumbImageViewLayout.setVisibility(INVISIBLE);
BLogUtil.log("隐藏封面");
}
}
......@@ -181,6 +182,7 @@ public class SampleCoverVideo extends StandardGSYVideoPlayer {
super.onSurfaceAvailable(surface);
if (GSYVideoType.getRenderType() != GSYVideoType.TEXTURE) {
if (mThumbImageViewLayout != null && mThumbImageViewLayout.getVisibility() == VISIBLE) {
BLogUtil.log("隐藏封面");
mThumbImageViewLayout.setVisibility(INVISIBLE);
}
}
......
......@@ -20,6 +20,7 @@ public class VideoSubView extends FrameLayout implements IPlayTarget {
private OnActionFinishListener mOnPageChangedListener;
private SampleCoverVideo player;
private MediaBean mediaBean;
private final GSYSampleCallBack sampleCallBack = new GSYSampleCallBack(){
@Override
......@@ -38,6 +39,7 @@ public class VideoSubView extends FrameLayout implements IPlayTarget {
public VideoSubView(@NonNull Context context, MediaBean mediaBean, final OnActionFinishListener onPageChangedListener) {
super(context);
this.mediaBean = mediaBean;
mOnPageChangedListener = onPageChangedListener;
View parent = LayoutInflater.from(context).inflate(R.layout.layout_player_view, this, true);
player = parent.findViewById(R.id.player);
......@@ -47,12 +49,17 @@ public class VideoSubView extends FrameLayout implements IPlayTarget {
player.loadCoverImage(mediaBean.getCover(),0);
player.setUp(mediaBean.getUrl(), true, null);
player.setLooping(mediaBean.isLooping());
BLogUtil.log("设置视频轮播是否循环模式="+mediaBean.isLooping());
}
@Override
public void onActive() {
BLogUtil.log("视频开始播放");
if(null != mediaBean){
// 必须得在播放之前设置循环模式
player.setLooping(mediaBean.isLooping());
BLogUtil.log("设置视频轮播是否循环模式onActive="+mediaBean.isLooping());
}
player.startPlayLogic();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment