How to get the control of MoviePlayer while we are streaming video using WebView - iphone

I am trying to show YouTube videos on my application. How can I stop/pause the playing movie player after a particular amount of time. I am using/loding the url in webview rather than MPMoviePlayer. If anyone knows the solution please share. I need to implement it in one of my app.
Thanks in advance.

As you will not get any access to the actual MPMoviePlayerController and since no notifications will be visible outside the UIWebView, you will be locked into using javascript code - that is, stay within the UIWebView scope of actions.
How and if such things are exactly implemented/able using javascript, I do not know.

Related

Is there a way to get the length of a video playing in my UIWebView? Can I start my movie at a certain position?

I think the current answer for iOS 6 and less is NO, but here's my question anyway:
I want to open my movie via a UIWebView at 5 minutes into the video... is this possible?
[webView loadRequest:[NSURLRequest requestWithURL:movie.fileURL]];
I also want to get the time position of the video when the user hits the Done button. Is that possible? I looked at some undocumented notifications and I couldn't find much for this either. See here.
My walk around way to solve what you want is to use another player instead of the UIWebView. Such as MPMoviePlayerController or MPMoviePlayerViewController. Then do what you want is much easier.

MPMoviePlayerController creating a custom buffer progress bar for streaming movies

I am streaming a movie to MPMoviePlayerController by simply passing MPMoviePlayerController the URL of the movie file. I am using my own custom controls and would like to create a progress bar to see how much of the video has been buffered (like in YouTube) . But there doesn't seem to be any available data
to create this. Does anyone know how to do this. Thanks.
Prior to iOS 5.x the playableDuration did the job. But since iOS 5 this property seem to always return zero. Give it a try and please let me know if it does work for you.

is it possible to change URL dynamically inMPMoviePlayerController

I am using MPMoviePlayerController to stream movie from the internet. And now my first application start to look nice :) BUT :) I have 4 URLs to stream (different movies), and I wan't when I tap to the movie to stop current movie and play another from another URL. Like changing channels on TV. I know how to catch tap, but I don't know how to change URL and start to play movie from that URL (like TV), any help?
I have used this tutorial to make application.
I think setContentURL is the function you're looking for. See:
Apple Documentation on MPMoviePlayerController
use [self.moviePlayer setContentURL:newUrl] to show the next video/movie. It is given in the Apple Documentation on MPMoviePlayerController. :)

How to keep MPMoviePlayerController open after movie ended?

If I use MPMoviePlayerController to play video in my iPhone app, it opens, loads the movie, plays it and then closes. Is it possible to force it to stay open after the movie finishes, so that user can replay it using its controls, instead of using controls in parent view? Also, is it possible to start MPMoviePlayerController in the paused mode?
thanks for any advice.
None of that is possible using the available API in the Pre-3.2 OS. One thing you could do is take a scerenshot of the last frame and stick that behind the movie so when it's done playing, it looks like it's still there, then just stick a button on it to replay. you could make an interface that looks/behaves similar to the standard movie player interface just for the play button if you need to.
For anyone stumbling over this now... There is a way to do this. Check out this question :)

Play two videos with MPMoviePlayerView Controller

I am developing an application for IPAD and I need to play two videos one after another but can not find how. I'm using MPMoviePlayerViewController to do it and do not know how to launch a share after the first video to be played and start the second. Can someone help?
what about using MPMoviePlayerPlaybackDidFinishNotification from documentation ?
In that method:
[..] you can also change the currently playing movie by changing the value in the contentURL property. [..]
(still from documentation)
hope it helps