3

I want to use video player technique used in my website. I use html 5 videos in website and send normal URL to app so that they can be played using the native MPMoviePlayerController inside the app. Now I have requirements where I want to use the same technique as web inside the app as UIWebView. When I request the link to load, it opens up the default player view of iOS, which I want to avoid.

Can this be possible?

Saty
  • 2,563
  • 3
  • 37
  • 88
  • As per bellow SO posts you can by tweaking html5 video attributes and by natvice code. `HTML 5 : – Milan V. Oct 19 '15 at 06:57
  • Let me know if this works. – Milan V. Oct 19 '15 at 06:59
  • @amorbytes..Actually I am not from the web background so I don't know what to write when loading the URL in WebView..If you could make an example, then that would be better Lets say I want to play http://jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v – Saty Oct 19 '15 at 07:05
  • have you control over html content? – Milan V. Oct 19 '15 at 07:16
  • if so then post your html content here. – Milan V. Oct 19 '15 at 07:18
  • @Saty I think that it is only possible with iPads – Leo Dabus Oct 19 '15 at 07:45
  • I tried with phonegap inline html5 video in iphone and it just works. so it may be done with help of this code. – Milan V. Oct 19 '15 at 08:39
  • can you send me the code of the url – Saty Oct 19 '15 at 08:48

1 Answers1

3

No, this is not possible. Not in the Safari browser. Videos will always be played by the native player. Trust me, I've spent a lot of time on this.

If you build a Phonegap app, it is possible by what is mentioned here:

HTML5 inline video on iPhone vs iPad/Browser

Basically:

HTML

<video id="player" width="480" height="320" webkit-playsinline>

Obj-C

webview.allowsInlineMediaPlayback = YES;

Community
  • 1
  • 1
Paul
  • 1,179
  • 3
  • 14
  • 38
  • @Paul...I am trying this technique in webpage and trying to play it in Chrome in iPod and still it is switching to native player – Saty Apr 21 '16 at 07:12
  • Video cannot be played inline on an iOS device. If someone is able to, then it is a hack. If you want to play video inline, then you have to create an app. Either Phonegap or Native. – Paul Aug 03 '16 at 04:23
  • @Paul.....I am talking about the WebView in native app. is there any way totally remove the native player? – Saty Aug 03 '16 at 04:44
  • No, you cannot remove the native player. You can, however, play the video inline using the code example I gave above in a WebView. – Paul Aug 05 '16 at 16:35
  • Is this still the case? "You cannot stop safari/iphone browser using native player?" Shame as I wanted to use Cloudflare Stream HTML5 video player embedded but iOS video takes over everytime... – danelig May 21 '20 at 11:29