Android App Force Landscape Video Whilst App Is Portrait - android

I have created an app using Ionic 3, and it's forced to be portrait only.
In the app there are lots of videos, some which play inline, others which play fullscreen. I'm using Videogular (http://www.videogular.com/).
My question is, on Android, is it possible to force landscape when playing a fullscreen video, whilst keeping the rest of the app portrait? On iOS when the video plays fullscreen with the native player, the user's free to rotate their device as they want, but on Android it's locked to playing in portrait.
I'm very new to app development, so I apologise in advance if this is a stupid question!
Thanks in advance

I've settled with manually switching the orientation lock to landscape when a video is played, and switching it back upon leaving the fullscreen video.
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
&
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);

Related

how to show video in fullscreen if tilted phone

I have a website with lots of video. Currently I am struggling to develop an app version of my website. I am developing the app in android studio and using webview to show the website in the app.
Currently I have two issues related to video playing.
First one is, if I am holding mobile phone in portrait mode, and I play a video. Video plays smooth. But if I tilt the phone to landscape mode, the audio still plays but a new website loads where video is not playing.
Second issue is, I want to achieve when a user tilts the phone from portrait to landscape mode, if a video is playing then it should occupy entire screen of phone. Similar to youtube. If a video is playing in portrait mode and if you tilt the phone then the video occupies entire screen, I want such result.
Sorry for my bad english. Please guide me. Thanks in advance.
Fast googling, it gives you anything you need to know.
http://tekeye.uk/android/examples/ui/android-portrait-landscape-screens
So you must just define two layouts, one for landscape, and one for portrait orientation.
Then just handle how it should look in both of them.

YouTubeStandAlonePlayer in Fullscreen mode with both Portrait and Landscape without restarting (Android)

Im using a YouTubeStandAlonePlayer to play a youtube video in my app
When I use YouTubeStandAlonePlayer in LightBox Mode the video rotates whenever the device orientation changes and does not restart the activity
However when I use YouTubeStandAlonePlayer in fullscreen mode it only plays in landscape mode
My app only operates in portrait mode, but when I play a video via. YouTubeStandAlonePlayer I want it to enter full screen and be able to change to both portrait and landscape mode as the orientation changes. When the user exits the video I want the app to go back to portrait mode regardless of what orientation the full screen video was being played in.
I've seen this functionality in Flipboard when YouTube Videos are played
I've been stumbling around this for weeks can someone please help me!!

Samsung Galaxy S4 Streaming Video Playback Orientation Issue

When playing back videos on the Samsung Galaxy S4 the video does not recognize the orientation metadata. It always plays on landscape.
The app also records the video and plays correctly on all other devices while streaming. The S4 plays it fine only if the video is stored in the device but it won't work for streaming.
Using MediaPlayer and SurfaceView on a Fragment, not a VideoView.
Have tried to disable Air View, Air Gesture, Smart Stay, Smart Scroll and Auto Rotate without luck.
Also even stored the orientation hint along with the video to rotate manually the element in the layout, but the SurfaceView when rotated using lockCanvas doesn't work and when rotating its parent element goes black and only plays the audio.
Any suggestions I can try to get this bug fixed? Have you experiencing the same when using the S4? Any help on this will be greatly appreciated. Thanks!
I asked this question a few months back and haven't heard anything. I would love to know as well.
https://stackoverflow.com/questions/17950072/galaxy-s4-media-player-ignores-rotation-metadata
Edit: This also occurs on the Galaxy Note 3.
Found a workaround for this issue. Try using a TextureView instead a SurfaceView, before playing the video, get the rotation info with MetadataRetriever and adjust the TextureView as needed. It worked on this side.
See the details here:
Streaming Video Playback Orientation Issue # Samsung Developers Forum

Streaming VideoView - Orientation Changes - Different layouts for Landscape and Portrait

I am working on a video streaming application like YouTube. I am using VideoView's built in streaming capability.
I am using Fragments, so on phones there is a Activity wrapper around VideoFragment.
The UX should be similar to YouTube's, so in portrait there is video playing at the top and some aditional views below it, etc., and in landscape, all there is is a fullscreen video.
What I have trouble with is orientation changes, what I obviously want is have video continue playing when orientation is changed. As I said, the video is streamed, so just persisting the current video time is not going to cut it. The only way I managed to do that is by forcing to not restart activity with android:configChanges="keyboardHidden|orientation|screenSize" set on the wrapper activity in Manifest.
So this works nicely, but fails when I want to have different layouts for layout and layout-land as YouTube does, because the activity is not restarted, so theres no oportunity for fragment to load new layout as far as I know.
Thanks!

Video plays on part of the screen after screen unlocked

I am using VideoView for playing video with given URL. I want video full screen. Everything is working well. But am facing strange problem. When you turn off screen and then unlock it, video plays on part of the screen.. approximately 3/4th area of the screen.. I searched a lot but still unable to find solution.
Just FYI, my whole application works only in portrait mode and only video plays in only landscape mode. Don't know whether this is the cause or not. But this should not be.
Please help me. Thanks in advance.

Categories

Resources