1

In my app I have a tab that brings in a mobile website in a UIWebView and the mobile site basically has a list of videos that you can play. When I click to play one, it plays the video but I can't get it to go into fullscreen landscape mode, when I rotate it just stays in portrait orientation.

Is there a way using MediaPlayer framework to detect when a video is playing and allow fullscreen landscape orientation for this particular case?

All i've been able to locate is doing it when loading a movie directly with a url, but I'm not, Im loading a .html in a web view, then playing videos through that website.

Any way I can make it shift to landscape?

Thanks

Matt
  • 2,920
  • 6
  • 23
  • 33

1 Answers1

0

In your UIWebViewDelegate, implement the - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType and when you detect a movie, use the MediaPlayer.framework.

Marcelo Alves
  • 1,856
  • 11
  • 12
  • Probably duplication of https://stackoverflow.com/questions/42489852/how-to-force-view-to-enter-landscape-in-ios – Lei Zhang Oct 23 '19 at 12:03