How to Play Two Videos Simultaneously in a UIWebView - iphone

I'd like to play two videos at the same time from an HTML page in a UIWebView. By default any playing video is stopped when another is started. This happens even if the two videos live in different web views.
Is there a way to force continued play for the first video?

You can only play one at a time.

Not possible yet (Mar 15, 2017)
See ref. from Apple Developer website under section "Multiple Simultaneous Audio or Video Streams"

just make two webviews with interface builder or coding on the same window or view and then u can do differnt things with both of them ..
but u have to take two webviews on diffent side of screen ,u cant take one web view over another

Related

Add multiple MPMoviePlayerController on UIScrollView?

I'm new at iOS development;
I add two MPMoviePlayerController on my scrollView for play audio file.
All is well but problem is any one media player such like
I am sure that my URL of file is proper. Then is issue here.
I don't know that Apple's iOS provide feature that we can add only one media player??
Please give me any suggestion.
It is very important for my application to add two MPMoviePlayerController so user can display TWO Media player.
I think you can add multiple MPMoviePlayerController objects, though only one can play a file at one time.
This is from Apple Documentation:
Note: Although you can create multiple MPMoviePlayerController objects
and present their views in your interface, only one movie player at a
time can play its movie.
Here is the link.
I know that you can play multiple videos in a single view by using the Apple AVFoundation framework (rather than MPMoviePlayerController). I imagine this is true of audio files as well.
Here is a similar SO question with tips about implementing AVFoundation.
I was having a similar issue with multiple MPMoviePlayerControllers in a UIScrollView, my solution being to add the media programatically to scrollViewDidEndDecelerating.
Not ideal because you then have to work around the fact the media isn't there until the scroll is finished but a nice bit of animation is working quite well in my case.

Playing youtube videos in a custom player using AVFoundation

AVFoundation allows a developer to create a custom Video Player instead of using Apple's own fullscreen MPMoviePlayer.
In my project, I'm using this approach to achieve something close to what the YouTube iOS app does, which is to have a "canvas" view up on top where playback takes place, along with several controls and text labels at the bottom:
As you know, a YouTube URL "points" to HTML data, and it is meant to be used within a UIWebView. Tapping on the thumbnail inside this UIWebView brings up a fullscreen Player, which is what I'm trying to avoid.
I would like to know if the YouTube API provides a URL pointing to the actual video (mp4 file), so that I may use it along AVFoundation.
I want to find a legal way to do this, so it should definetely comply to both Apple's and Google's terms of service.
Thanks,
The easiest way to achieve this is by adding an overlay UIView, which you can place over any part of the screen. And putting it on top of the UIWebView, and set it to not respond to user interactions. As you can change size and placement and making it transparent, you can effectively choose which user interactions you want and which you don't want. And you will not mess around with youTube ToS in any way.
http://www.youtube.com/get_video_info?video_id= with the video id appended contains the mp4 url, may require some regex work (found here: https://github.com/hellozimi/HCYoutubeParser/blob/master/YoutubeParser/Classes/HCYoutubeParser.m)

IPhone disable/hide scrubbar mpmovieplayercontroller in fullscreen mode

I'm creating an iphone app with video clips (among other things) where I need to play one or more ads before the actual video clip. Naturally my client doesn't want users to be able to fast forward during the ads but at the same time they must be able to exit the view so I cant set controlStyle to MPMovieControlStyleNone.
I would prefer not to hack the default view and remove the scrubbar so it seems my only option is to implement a custom bar with a single "Done"/"Back" button.
I've googled my eyes out trying to find example code for this, but no dice. I've seen similar questions posted here as well but no answers are given that could help me out. I'm a novice IOS developer and could really use som help with this (custom control bar with single "Done" button for fullscreen MPMoviePlayerController that shows/hideson tap OR disable scrubbar in an acceptable fashion – in fullscreen mode).
Anyone done this before or know where to find some example code? Thanks!

Create interactive videos in iPad - An app for product demo

I would like to create videos that needs to run on an iPad native app. The app needs to show a demonstration of a product through iPad. It needs to be interactive as well. I know we can do these in Flash, since Flash is not supported in iPad what are my options?
I appreciate any guidelines or hints. Thank you in advance
The easiest way to create interactive videos for iOS is to use Apple's HTTP Live Streaming technology. You have to create a video, embed metadata, play it using MPMoviePlayerController or AVPlayerItem, and then display clickable areas in response to metadata notifications.
Metadata should contain coordinates for the element you are tracking, eg: a dress, and a identifier for the product. You overlay this info with a clickable subview that reveals more information about the product. There are several applications of this kind in iTunes, here is one.
Once you get a working product and weeks-time of videos, the most difficult part is to perform motion tracking with the less possible human interaction. One approach is to use Adobe After Effects, another is to code your own solution based on OpenCV.
Some ideas:
You could use an MPMoviePlayerController with no controls, on loop.
Here's a solution I thought of using interactive HTML popover's over the video:
You could have a data store (say an NSDictionary), with playback times as keys.
The values could then be a custom class, which includes all the necessary data for an interactive popover on the video.
Your custom class could look something like this
#interface InteractivePopover : NSObject
{
NSString *snippetTitle;
NSString *htmlData; // could include links etc.
CGPoint popoverDisplayPoint;
// other styling attributes etc.
}
Now, when a user taps the video, it pauses it at the next 'interactive' point (by looking for the next key after the current playback time), and displays (animates on) all the popups, which you set before to show off different parts of the product.
That class might be your data store, then you create another class to handling displaying, animating, controlling, sizing (etc) these interactive popovers. It would create a UIWebView for the HTML. It would also control direction, and indication of the source point for your popover.
This is clearly very expandable because you could put images, embedded content etc into the HTML for these interactive popovers.
Anyway, that's how I would do it.
Though flash will not run on ipad you can still create apps for it with flash cs5 .

display two different Video-Streams at the same time

I try to display two different http/rtsp-Video-Streams at the same time on the same UIView.
So my first thought was to use the UIViews of two MPMoviePlayerController.
But the documentation says:
Note: Although you may create multiple MPMoviePlayerController objects and present their views in your interface, only one movie player at a time may play its movie.
Okey!
My second thought was to use the UIWebView.
But that also doesn't work. I can display only one stream.
I hope you can help me.
Best regards.
On iPhone, as the documentation says, only one Video can be shown at any point. Video has to be full Screen! check also:
Customizable non-full screen video player in iPhone