Jul 25, 2021 Replies: 4 This example demonstrates how you can add a full screen button to a video. Clicking on the button, starts a new landscape activity and it then uses the native switchTargetView method to reuse the same player in the new SimpleExoPlayerView. There is also some calculations involved with adding the button based on the actual video dimension. Don't miss the manifest editor code that locks the second activity in landscape. Project updated to work with ExoPlayer v3. The change is simple, line 31 in FullScreen changed to: Code: Copy jo.InitializeStatic("androidx.media3.ui.PlayerView") Attachments Project.zip Project.zip 16.3 KB · Views: 996 Last edited: Dec 25, 2023 Click to expand...
This example demonstrates how you can add a full screen button to a video. Clicking on the button, starts a new landscape activity and it then uses the native switchTargetView method to reuse the same player in the new SimpleExoPlayerView. There is also some calculations involved with adding the button based on the actual video dimension. Don't miss the manifest editor code that locks the second activity in landscape. Project updated to work with ExoPlayer v3. The change is simple, line 31 in FullScreen changed to: Code: Copy jo.InitializeStatic("androidx.media3.ui.PlayerView")
Erel B4X founder Staff member Licensed User Longtime User Jul 25, 2021 #2 It is actually better to set the manifest editor to: Code: Copy SetActivityAttribute(FullScreen, android:screenOrientation, fullSensor) This will allow the user to change the full screen orientation.
It is actually better to set the manifest editor to: Code: Copy SetActivityAttribute(FullScreen, android:screenOrientation, fullSensor) This will allow the user to change the full screen orientation.
Jim McDougal Member Licensed User Jan 24, 2022 #3 Erel said: SetActivityAttribute(FullScreen, android:screenOrientation, fullSensor) Click to expand... Hi Erel, I added this to the manifest file via the manifest editor and no effect (but the parameter android:screenOrientation="fullSensor">did show in the manifest file for the Main activity). Then I set #SupportedOrientations: fullSensor in the #Region Project Attributes of my Main activity and all activities in the manifest show android:screenOrientation="fullSensor"> but the status bar is still showing in landscape orientation. I've attached the manifest file. Any suggestions? Thanks, Jim Attachments AndroidManifest.xml AndroidManifest.xml 1.4 KB · Views: 908
Erel said: SetActivityAttribute(FullScreen, android:screenOrientation, fullSensor) Click to expand... Hi Erel, I added this to the manifest file via the manifest editor and no effect (but the parameter android:screenOrientation="fullSensor">did show in the manifest file for the Main activity). Then I set #SupportedOrientations: fullSensor in the #Region Project Attributes of my Main activity and all activities in the manifest show android:screenOrientation="fullSensor"> but the status bar is still showing in landscape orientation. I've attached the manifest file. Any suggestions? Thanks, Jim
Erel B4X founder Staff member Licensed User Longtime User Jan 25, 2022 #4 I think that you are posting in the wrong thread.
Erel B4X founder Staff member Licensed User Longtime User Dec 25, 2023 #5 Project updated to work with ExoPlayer v3: https://www.b4x.com/android/forum/threads/exoplayer-media3-video-player.158204/
Project updated to work with ExoPlayer v3: https://www.b4x.com/android/forum/threads/exoplayer-media3-video-player.158204/