0

I try to play a video in html5 video tag for my iOS app. When I play the video in my app its open in a quick time player with full screen. How to play a video inline of video tag without open the full screen. Any one give me solution.

Karthik
  • 3
  • 3

3 Answers3

0

If you know the stream url use MPMoviePlayerController

Tony Thomas
  • 967
  • 10
  • 20
0

create a UIView. Init a MPMoviePlayerController. set the contentURL to the video URL. Add the MPMoviePlayerController as a subview to the view you want in your app.

Ian Anderson
  • 35
  • 1
  • 6
  • I tried it and works great. But I want to add MPMoviePlayerController in my html page to play video. Is it possible? Or any other ways? – Karthik Jan 07 '14 at 19:26
  • Check this link out: http://stackoverflow.com/questions/3699552/html5-inline-video-on-iphone-vs-ipad-browser – Ian Anderson Jan 07 '14 at 19:41
  • thanks works fine. But when I trying to get multiple videos from JSON. I got [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 1) in console. Why it stops playing? – Karthik Jan 07 '14 at 20:55
0

Finally I got the solution. Adding <video src="" allowfullscreen width="280" height="280" webkit-playsinline loop></video>

then use

htmlview.allowsInlineMediaPlayback = YES;
htmlview.mediaPlaybackRequiresUserAction = NO;

in my .m file viewdidload function.

Karthik
  • 3
  • 3