how to show video in fullscreen if tilted phone - android

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.

Related

Android App Force Landscape Video Whilst App Is Portrait

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);

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

Android Orientation with Video

I am just developing one Android app, in which we have to capture the video. Now user will capture the video in portrait view but while it will play, it will automatically play in landscape.
i.e. video is capture in portrait view, though it will play in landscape view. when i will check in memory card, video is still captured in portrait view and also while playing video from memory card, it will play in portrait view.
I have checked, manifest file and seems all files are fine.
Please let me know if any one have any idea.
Regards,
Keyur Satyadev

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.

Play video based on orientation

im new one for android. im developing one application that
application getting videos from sd card and display thumbnail view.
after user click any one video it will be play its working fine to me.
but if that video file is taken from landscape means it will be play
landscape, or that video file taken from portrait means it will play
portrait view.so i search this long time but i could not find
anything. so any one knows any idea share with me.
You can use different layout files for different orientations, place in /layout and /layout-land.

Categories

Resources