提交 ac415fbb 编写于 作者: S shuyu

1.3.6

上级 caedb3a5
......@@ -45,6 +45,10 @@ compile 'com.shuyu:gsyVideoPlayer:1.3.5'
* <h4>3、详情模式</h4>
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/04.gif" width="240px" height="426px"/>
### 1.3.6 区分了没有网络和没有wifi的提示;更新了Demo detailPlayer直接旋转全屏,返回正常的详情效果
### 1.3.5 增加了全屏隐藏虚拟按键;修复了缓冲过程中加载动画就停止了。
```
......
package com.example.gsyvideoplayer;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.FragmentActivity;
......@@ -10,7 +12,9 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.example.gsyvideoplayer.listener.SampleListener;
import com.shuyu.gsyvideoplayer.GSYVideoPlayer;
import com.shuyu.gsyvideoplayer.utils.Debuger;
import com.shuyu.gsyvideoplayer.utils.OrientationUtils;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
import com.transitionseverywhere.TransitionManager;
......@@ -30,6 +34,7 @@ public class DetailPlayer extends FragmentActivity {
RelativeLayout activityDetailPlayer;
private boolean isFull;
private boolean isPlay;
private OrientationUtils orientationUtils;
......@@ -51,20 +56,24 @@ public class DetailPlayer extends FragmentActivity {
resolveNormalVideoUI();
orientationUtils = new OrientationUtils(this, detailPlayer);
//初始化不打开外部的旋转
orientationUtils.setEnable(false);
detailPlayer.setIsTouchWiget(true);
detailPlayer.setRotateViewAuto(false);
detailPlayer.setLockLand(true);
//打开自动旋转
detailPlayer.setRotateViewAuto(true);
detailPlayer.setLockLand(false);
detailPlayer.setShowFullAnimation(false);
detailPlayer.getFullscreenButton().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//直接横屏
orientationUtils.resolveByClick();
//第一个true是否需要隐藏actionbar,第二个true是否需要隐藏statusbar
detailPlayer.startWindowFullscreen(DetailPlayer.this, true, true);
//这是以前旧的方式
//toDo();
}
......@@ -77,6 +86,28 @@ public class DetailPlayer extends FragmentActivity {
}
});
detailPlayer.setStandardVideoAllCallBack(new SampleListener() {
@Override
public void onPrepared(String url, Object... objects) {
super.onPrepared(url, objects);
//开始播放了才能旋转和全屏
orientationUtils.setEnable(true);
isPlay = true;
}
@Override
public void onAutoComplete(String url, Object... objects) {
super.onAutoComplete(url, objects);
isPlay = false;
}
@Override
public void onClickStartError(String url, Object... objects) {
super.onClickStartError(url, objects);
isPlay = false;
}
});
}
@Override
......@@ -95,6 +126,24 @@ public class DetailPlayer extends FragmentActivity {
orientationUtils.releaseListener();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
//如果旋转了就全屏
if (isPlay) {
if (newConfig.orientation == ActivityInfo.SCREEN_ORIENTATION_USER) {
if (!detailPlayer.isIfCurrentIsFullscreen()) {
detailPlayer.startWindowFullscreen(DetailPlayer.this, true, true);
}
} else {
//新版本isIfCurrentIsFullscreen的标志位内部提前设置了,所以不会和手动点击冲突
if (detailPlayer.isIfCurrentIsFullscreen()) {
StandardGSYVideoPlayer.backFromWindowFull(this);
}
}
}
}
private void toFull() {
isFull = true;
......
......@@ -18,7 +18,7 @@ org.gradle.jvmargs=-Xmx1536m
BINTRAY_USER=
BINTRAY_KEY=
PROJ_GROUP=com.shuyu
PROJ_VERSION=1.3.5
PROJ_VERSION=1.3.6
PROJ_NAME=gsyVideo
PROJ_WEBSITEURL=hhttps://github.com/CarGuo/GSYVideoPlayer
PROJ_ISSUETRACKERURL=
......
......@@ -311,6 +311,7 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
* 退出window层播放全屏效果
*/
public void clearFullscreenLayout() {
mIfCurrentIsFullscreen = false;
int delay = mOrientationUtils.backToProtVideo();
mOrientationUtils.setEnable(false);
if (mOrientationUtils != null)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册