提交 8e6106d6 编写于 作者: S shuyu

1.2.7

上级 b672fec8
......@@ -17,13 +17,13 @@
<dependency>
<groupId>com.shuyu</groupId>
<artifactId>gsyVideoPlayer</artifactId>
<version>1.2.6</version>
<version>1.2.7</version>
<type>pom</type>
</dependency>
```
```
compile 'com.shuyu:gsyVideoPlayer:1.2.6'
compile 'com.shuyu:gsyVideoPlayer:1.2.7'
```
## 效果,录屏下的屏幕旋转和实际有些出入
......@@ -44,6 +44,9 @@ compile 'com.shuyu:gsyVideoPlayer:1.2.6'
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/04.gif" width="240px" height="426px"/>
### 1.2.7 修改了循环播放的时候,重新播放不弹出控制UI;修改了FragmentActivity的actionBar问题
### 1.2.6 修正了StandardGSYVideoPlayer的接口全屏回调问题,增加了循环播放的接口
```
......
......@@ -18,7 +18,7 @@ org.gradle.jvmargs=-Xmx1536m
BINTRAY_USER=
BINTRAY_KEY=
PROJ_GROUP=com.shuyu
PROJ_VERSION=1.2.6
PROJ_VERSION=1.2.7
PROJ_NAME=gsyVideo
PROJ_WEBSITEURL=hhttps://github.com/CarGuo/GSYVideoPlayer
PROJ_ISSUETRACKERURL=
......
......@@ -678,6 +678,7 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View.
Debuger.printfLog("onPrepared");
mVideoAllCallBack.onPrepared(mUrl, mObjects);
}
mHadPlay = true;
}
@Override
......@@ -760,10 +761,18 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View.
public void onInfo(int what, int extra) {
if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) {
BACKUP_PLAYING_BUFFERING_STATE = mCurrentState;
setStateAndUi(CURRENT_STATE_PLAYING_BUFFERING_START);
if (mLooping && mHadPlay) {
//循环在播放的不显示
} else {
setStateAndUi(CURRENT_STATE_PLAYING_BUFFERING_START);
}
} else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END) {
if (BACKUP_PLAYING_BUFFERING_STATE != -1) {
setStateAndUi(BACKUP_PLAYING_BUFFERING_STATE);
if (mLooping && mHadPlay) {
//循环在播放的不显示
} else {
setStateAndUi(BACKUP_PLAYING_BUFFERING_STATE);
}
BACKUP_PLAYING_BUFFERING_STATE = -1;
}
} else if (what == IMediaPlayer.MEDIA_INFO_VIDEO_ROTATION_CHANGED) {
......@@ -902,6 +911,7 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View.
(System.currentTimeMillis() - CLICK_QUIT_FULLSCREEN_TIME) > FULL_SCREEN_NORMAL_DELAY) {
releaseAllVideos();
}
mHadPlay = false;
}
......
......@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.ContextWrapper;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.internal.view.ContextThemeWrapper;
......@@ -99,28 +100,54 @@ public class CommonUtil {
public static void hideSupportActionBar(Context context, boolean actionBar, boolean statusBar) {
if (actionBar) {
ActionBar ab = CommonUtil.getAppCompActivity(context).getSupportActionBar();
if (ab != null) {
ab.setShowHideAnimationEnabled(false);
ab.hide();
if (context instanceof FragmentActivity) {
FragmentActivity fragmentActivity = (FragmentActivity)context;
android.app.ActionBar ab = fragmentActivity.getActionBar();if (ab != null) {
ab.hide();
}
} else {
ActionBar ab = CommonUtil.getAppCompActivity(context).getSupportActionBar();
if (ab != null) {
ab.setShowHideAnimationEnabled(false);
ab.hide();
}
}
}
if (statusBar) {
CommonUtil.getAppCompActivity(context).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (context instanceof FragmentActivity) {
FragmentActivity fragmentActivity = (FragmentActivity)context;
fragmentActivity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
CommonUtil.getAppCompActivity(context).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
}
public static void showSupportActionBar(Context context, boolean actionBar, boolean statusBar) {
if (actionBar) {
ActionBar ab = CommonUtil.getAppCompActivity(context).getSupportActionBar();
if (ab != null) {
ab.setShowHideAnimationEnabled(false);
ab.show();
if (context instanceof FragmentActivity) {
FragmentActivity fragmentActivity = (FragmentActivity)context;
android.app.ActionBar ab = fragmentActivity.getActionBar();if (ab != null) {
ab.show();
}
} else {
ActionBar ab = CommonUtil.getAppCompActivity(context).getSupportActionBar();
if (ab != null) {
ab.setShowHideAnimationEnabled(false);
ab.show();
}
}
}
if (statusBar) {
CommonUtil.getAppCompActivity(context).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (context instanceof FragmentActivity) {
FragmentActivity fragmentActivity = (FragmentActivity)context;
fragmentActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
CommonUtil.getAppCompActivity(context).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
}
......
......@@ -67,6 +67,8 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
protected boolean mLooping = false;//循环
protected boolean mHadPlay = false;//是否播放过
protected Context mContext;
protected String mOriginUrl; //原来的url
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册