how to play video landscape with standard api?
video play only portrait !!!
change the app orientation landscape is not useful, because video start portrait forever.
i have a portrait app with a button, when pressed video must play landscape.
yourmoviecontrollername setOrientation:UIDeviceOrientationPortrait animated:NO];
is not allowed by Apple
Maybe the regular videoplayercontroller doesnt do landscape by itself...i would suggest using MPMoviePlayerViewController available in 3.2, you set it up and use view controllers presentMoviePlayerController method in order to display, should work fine for you. here is a ref MPViewcontroller
Related
Starting on iOS 15.4 and macOS 12.3 WKPreferences has the new property isElementFullscreenEnabled, part of WKWebViewConfiguration, which enables JavaScript to make elements full-screen in a WKWebView, but enabling it on an iOS app that only supports Portrait Orientation disables screen rotation on full-screen for any playback (YouTube videos for example).
This is important if you have an app that only supports portrait mode but wants screen rotation when playing a video on full-screen (going back to portrait when the video finishes).
Having isElementFullscreenEnabled = false, you can still play videos on full-screen (at least on YouTube), and it allows screen rotation but disables making other HTML elements full-screen.
Important to note that on macOS, preferences.isElementFullscreenEnabled = true is needed if you want full-screen videos.
Question
Is there a workaround to have both: isElementFullscreenEnabled = true and screen rotation for videos on iOS when only supporting portrait mode?
I set my app that it should works only in portrait, now I'm showing a youtube video and I think it's better to see this video in landscape mode. I set my app with this flags:
How I can rotate the view when the video is playing? I display the video I'm using the HCYoutubeParser library. Can you help me?
UPDATE
storyboard:
You should check “Portrait”, "Landscape Left" and "Landscape Right" in the Deployment Info. In the video player view controller, you support Portrait and Landscape, in your other view controllers only support Portrait.
You can refer to Autorotate in iOS 6 has strange behaviour and
iOS 6 UITabBarController supported orientation with current UINavigation controller
I use phonegap to create a ios project.I want to use htmlt5 video to play a video in landscape.
So there is a way from webkit or in my application to switch in landscape mode only when i showing a HTML5 video?
Thanks!
Create view and add webView as subview to that view. Set orientation of that view to LandscapeLeft and LandScapeRight and load HTML5 video on webview. call that view when ever you want to play video; view will always appear in landscape mode.
I have an app working on iOS 5 and 6. This app must run only in portrait mode (it's done). But in this app I have to show and play some YouTube videos.
To achieve this I use a UIWebView to show the thumbnail YouTube video. So, I have a nice thumbnail and when the user touches it the app shows automatically a MPMoviePlayerController playing the video. Almost all is perfect...
My problem is that I need the MPMoviePlayerController supports both orientation (but only this controller). How could I achieve this?
Thanks a lot,
Carlos
Add the desired orientations to your Info.plist
Subclass MPMoviePlayerViewController
Override shouldAutorotate and supportedInterfaceOrientations to return YES and all the orientations you wish to support, respectively.
I'm trying to figure out a way to make it so that my ios webview is in landscape mode while the rest of my app is in portrait. Does anyone know if this is possible?
I have a video section that I link out to vimeo. The vimeo video player is brought up in webview which is the portion I would like in landscape.
you must do it programatically in the shouldAutorotateToInterfaceOrientation
webview.transform=CGAffineTransformMakeRotation(M_PI/2);