mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
prevent going full screen before the video has loaded
This commit is contained in:
parent
86b6938911
commit
7557e6f6ba
2 changed files with 7 additions and 7 deletions
|
@ -2379,13 +2379,8 @@ class VideoDetailView : ConstraintLayout {
|
|||
}
|
||||
|
||||
fun isLandscapeVideo(): Boolean? {
|
||||
var videoSourceWidth = _player.exoPlayer?.player?.videoSize?.width
|
||||
var videoSourceHeight = _player.exoPlayer?.player?.videoSize?.height
|
||||
|
||||
if (videoSourceWidth == null || videoSourceHeight == null || videoSourceWidth == 0 || videoSourceHeight == 0){
|
||||
videoSourceWidth = this.video?.video?.videoSources?.get(0)?.width
|
||||
videoSourceHeight = this.video?.video?.videoSources?.get(0)?.height
|
||||
}
|
||||
val videoSourceWidth = _player.exoPlayer?.player?.videoSize?.width
|
||||
val videoSourceHeight = _player.exoPlayer?.player?.videoSize?.height
|
||||
|
||||
return if (videoSourceWidth == null || videoSourceHeight == null || videoSourceWidth == 0 || videoSourceHeight == 0){
|
||||
null
|
||||
|
|
|
@ -592,6 +592,11 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
|
|||
|
||||
@OptIn(UnstableApi::class)
|
||||
fun setFullScreen(fullScreen: Boolean) {
|
||||
// prevent fullscreen before the video has loaded to make sure we know whether it's a vertical or horizontal video
|
||||
if(exoPlayer?.player?.videoSize?.height ?: 0 == 0 && fullScreen){
|
||||
return
|
||||
}
|
||||
|
||||
updateRotateLock()
|
||||
|
||||
if (isFullScreen == fullScreen) {
|
||||
|
|
Loading…
Add table
Reference in a new issue