|
|
|
@ -371,11 +371,14 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo |
|
|
|
mBinding.control.action.decode.setText(mPlayers.getDecodeText()); |
|
|
|
mBinding.control.action.decode.setText(mPlayers.getDecodeText()); |
|
|
|
mBinding.control.action.speed.setEnabled(mPlayers.canAdjustSpeed()); |
|
|
|
mBinding.control.action.speed.setEnabled(mPlayers.canAdjustSpeed()); |
|
|
|
mBinding.control.action.reset.setText(ResUtil.getStringArray(R.array.select_reset)[Setting.getReset()]); |
|
|
|
mBinding.control.action.reset.setText(ResUtil.getStringArray(R.array.select_reset)[Setting.getReset()]); |
|
|
|
mBinding.video.addOnLayoutChangeListener((view, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> { |
|
|
|
mBinding.video.addOnLayoutChangeListener((view, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> mPiP.update(getActivity(), view)); |
|
|
|
if (left != oldLeft || right != oldRight || top != oldTop || bottom != oldBottom) { |
|
|
|
|
|
|
|
mPiP.update(getActivity(), view); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
private void setVideoView(int margin) { |
|
|
|
|
|
|
|
if (!ResUtil.isPad() || isFullscreen()) return; |
|
|
|
|
|
|
|
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mBinding.video.getLayoutParams(); |
|
|
|
|
|
|
|
params.setMargins(margin, margin, margin, margin); |
|
|
|
|
|
|
|
mBinding.video.setLayoutParams(params); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void setSubtitleView() { |
|
|
|
private void setSubtitleView() { |
|
|
|
@ -1282,13 +1285,6 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo |
|
|
|
mPlayers.play(); |
|
|
|
mPlayers.play(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void setVideoMargins(int margin) { |
|
|
|
|
|
|
|
if (!ResUtil.isPad() || isFullscreen()) return; |
|
|
|
|
|
|
|
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mBinding.video.getLayoutParams(); |
|
|
|
|
|
|
|
params.setMargins(margin, margin, margin, margin); |
|
|
|
|
|
|
|
mBinding.video.setLayoutParams(params); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isForeground() { |
|
|
|
public boolean isForeground() { |
|
|
|
return foreground; |
|
|
|
return foreground; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1505,15 +1501,15 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo |
|
|
|
super.onPictureInPictureModeChanged(isInPictureInPictureMode); |
|
|
|
super.onPictureInPictureModeChanged(isInPictureInPictureMode); |
|
|
|
if (isInPictureInPictureMode) { |
|
|
|
if (isInPictureInPictureMode) { |
|
|
|
PlaybackService.start(mPlayers); |
|
|
|
PlaybackService.start(mPlayers); |
|
|
|
setVideoMargins(0); |
|
|
|
setVideoView(0); |
|
|
|
setSubtitle(10); |
|
|
|
setSubtitle(10); |
|
|
|
hideControl(); |
|
|
|
hideControl(); |
|
|
|
hideSheet(); |
|
|
|
hideSheet(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setForeground(true); |
|
|
|
setForeground(true); |
|
|
|
PlaybackService.stop(); |
|
|
|
PlaybackService.stop(); |
|
|
|
|
|
|
|
setVideoView(ResUtil.dp2px(16)); |
|
|
|
setSubtitle(Setting.getSubtitle()); |
|
|
|
setSubtitle(Setting.getSubtitle()); |
|
|
|
setVideoMargins(ResUtil.dp2px(16)); |
|
|
|
|
|
|
|
if (isStop()) finish(); |
|
|
|
if (isStop()) finish(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|