diff --git a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt index 6261b6e14e8116d0e7c727f38a2687f0704c3e56..75539f9c205fe6cb530febc334dcd27a55b11418 100644 --- a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt +++ b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt @@ -1812,6 +1812,7 @@ class VideoDetailView : ConstraintLayout { _isCasting = isCasting; if(isCasting) { + setFullscreen(false); _player.stop(); _player.hideControls(false); _cast.visibility = View.VISIBLE; diff --git a/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayer.kt b/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayer.kt index 83a8355c555eb69071f30b61efad357a2bbac0ee..5f7435cb1995f8a3eca32506710ff5275235888d 100644 --- a/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayer.kt +++ b/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayer.kt @@ -71,6 +71,7 @@ class FutoVideoPlayer : FutoVideoPlayerBase { private val _control_videosettings_fullscreen: ImageButton; private val _control_minimize_fullscreen: ImageButton; private val _control_rotate_lock_fullscreen: ImageButton; + private val _control_cast_fullscreen: ImageButton; private val _control_play_fullscreen: ImageButton; private val _time_bar_fullscreen: TimeBar; private val _overlay_brightness: FrameLayout; @@ -127,6 +128,7 @@ class FutoVideoPlayer : FutoVideoPlayerBase { _control_minimize_fullscreen = _videoControls_fullscreen.findViewById(R.id.exo_minimize); _control_videosettings_fullscreen = _videoControls_fullscreen.findViewById(R.id.exo_settings); _control_rotate_lock_fullscreen = _videoControls_fullscreen.findViewById(R.id.exo_rotate_lock); + _control_cast_fullscreen = _videoControls_fullscreen.findViewById(R.id.exo_cast); _control_play_fullscreen = videoControls.findViewById(com.google.android.exoplayer2.ui.R.id.exo_play); _control_chapter_fullscreen = _videoControls_fullscreen.findViewById(R.id.text_chapter_current); _time_bar_fullscreen = _videoControls_fullscreen.findViewById(com.google.android.exoplayer2.ui.R.id.exo_progress); @@ -213,7 +215,7 @@ class FutoVideoPlayer : FutoVideoPlayerBase { updateRotateLock(); }; _control_cast.setOnClickListener { - UIDialogs.showCastingDialog(context); + }; _control_minimize_fullscreen.setOnClickListener { @@ -229,6 +231,9 @@ class FutoVideoPlayer : FutoVideoPlayerBase { StatePlayer.instance.rotationLock = !StatePlayer.instance.rotationLock; updateRotateLock(); }; + _control_cast_fullscreen.setOnClickListener { + UIDialogs.showCastingDialog(context); + }; var lastPos = 0L; videoControls.setProgressUpdateListener { position, bufferedPosition -> diff --git a/app/src/main/res/layout/video_player_ui_fullscreen.xml b/app/src/main/res/layout/video_player_ui_fullscreen.xml index 3425d2326a3cc075e9bee5e2e56bf632ab3afdfd..23ef18d1d3f63058728cc65394b6686bc803f805 100644 --- a/app/src/main/res/layout/video_player_ui_fullscreen.xml +++ b/app/src/main/res/layout/video_player_ui_fullscreen.xml @@ -57,6 +57,14 @@ android:layout_height="wrap_content" app:layout_constraintTop_toTopOf="parent" app:layout_constraintRight_toRightOf="parent"> + <ImageButton + android:id="@+id/exo_cast" + android:layout_width="50dp" + android:layout_height="50dp" + android:scaleType="fitCenter" + android:clickable="true" + android:padding="12dp" + app:srcCompat="@drawable/ic_cast" /> <ImageButton android:id="@+id/exo_rotate_lock" android:layout_width="50dp"