Skip to content

Commit

Permalink
update support isNeedRotateWithSystem with Detail
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Nov 18, 2020
1 parent 7c25dec commit 9368430
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ protected void onDestroy() {
}


/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ protected void onDestroy() {
}


/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ protected void onDestroy() {
}


/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ protected void onDestroy() {
}
}

/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ protected void onDestroy() {



/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ protected void onDestroy() {
}


/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ protected void onDestroy() {
orientationUtils.releaseListener();
}

/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ protected void onDestroy() {
}


/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ public void onPrepared() {
orientationUtils.setEnable(true);
}

/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
public void onConfigurationChanged(Activity activity, Configuration newConfig) {
//如果旋转了就全屏
if (isPlay && itemPlayer != null && orientationUtils != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ protected void onDestroy() {
}


/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ protected void onDestroy() {



/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ protected void onDestroy() {



/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,14 @@ protected void onDestroy() {
mADOrientationUtils.releaseListener();
}

/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
//如果旋转了就全屏
boolean backUpIsPlay = isPlay;
if (!isPause && getGSYADVideoPlayer().getVisibility() == View.VISIBLE) {
if (!isPause && getGSYADVideoPlayer().getVisibility() == View.VISIBLE && isNeedRotateWithSystem()) {
if (isADStarted()) {
isPlay = false;
getGSYADVideoPlayer().getCurrentPlayer().onConfigurationChanged(this, newConfig, mADOrientationUtils, hideActionBarWhenFull(), hideStatusBarWhenFull());
Expand All @@ -144,6 +147,7 @@ public void onConfigurationChanged(Configuration newConfig) {
isPlay = backUpIsPlay;
}


@Override
public void onStartPrepared(String url, Object... objects) {
super.onStartPrepared(url, objects);
Expand Down Expand Up @@ -210,6 +214,7 @@ public OrientationOption getOrientationOption() {
return null;
}


public abstract R getGSYADVideoPlayer();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ protected void onDestroy() {
orientationUtils.releaseListener();
}

/**
* orientationUtils 和 detailPlayer.onConfigurationChanged 方法是用于触发屏幕旋转的
*/
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
//如果旋转了就全屏
if (isPlay && !isPause) {
if (isPlay && !isPause && isNeedRotateWithSystem()) {
getGSYVideoPlayer().onConfigurationChanged(this, newConfig, orientationUtils, hideActionBarWhenFull(), hideStatusBarWhenFull());
}
}
Expand Down Expand Up @@ -258,6 +261,13 @@ public OrientationOption getOrientationOption() {
return null;
}

/**
* 可配置是否需要重力旋转
*/
public boolean isNeedRotateWithSystem() {
return true;
}

/**
* 播放控件
*/
Expand Down
4 changes: 2 additions & 2 deletions gsyVideoPlayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

//api project(':gsyVideoPlayer-java')
api project(':gsyVideoPlayer-java')
//api project(':gsyVideoPlayer-exo_player2')
//api project(':gsyVideoPlayer-armv5')
//api project(':gsyVideoPlayer-armv7a')
Expand All @@ -48,7 +48,7 @@ dependencies {

//api "com.shuyu:GSYVideoPlayer:$gsyVideoVersion"

api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion"
//api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion"
api "com.shuyu:GSYVideoPlayer-exo2:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-armv5:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-armv7a:$gsyVideoVersion"
Expand Down

0 comments on commit 9368430

Please sign in to comment.