is it possible to change URL dynamically inMPMoviePlayerController - iphone

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. :)

Related

add more than 1 video player in iphone

Is there any way to add more than 1 video player in a single View? I am getting the .m4v list from server adn have to display that much videos in single page.
It doesnot matter if I play 1 video at a time but which ever video I want must play there itself.
So the videos are placed one below other.
I have tried using mpmoviecontroller but it's drawback is it can have only one instance in the whole applicaiton So if i try to alloc 2 players in a view then the first one does not work and only one player works..
Is there any legal alternate way for the same?
MPMoviePlayerController will allow multiple instances, but only one of them can be playing their movie at any given time.
Please check the link : http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html
I used AVPlayer class (which also MPMoviePlayerController uses under the hood) to successfully play multiple videos from multiple source.
The process of using it is more involved than MPMoviePlayerController, but I would say it is definitely worth to look at if you want some customized behavior in your player. The official programming guide is a good start.

MPMoviePlayerController - handle phone call

I'm using MPMoviePlayerController to play a video.
When a call comes, i want to pause and when he completes, i want to continue the video.
I couldn't find relevant solution in my search.
Is this something possible?
Its possible to handle the interruptions using AVAudioSessionDelegate "beginInterruption" and "endInterruption". But when I am setting the session to play back, my movie player sound is not heard at all.
Does any one know the solution?
There is a callEventHandler in Core Telephony framework. I hope, You could find what you want here.
We've to set the session active after endInterruption.

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

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.

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

How to use AVAudioPlayer to play MP4?

I want to use AVAudioPlayer to play MP4 files from iTunes generator. I could use UIWebView to play it and it worked, but I want to put an image of my choice on the background of the player instead of the "QuickTime"-logo.
Here is an example of the m4p file I want to play with AVAudioPlayer.
If your question is, "can someone help me figure out how to use AVAudioPlayer," then I'd recommend taking a look at Apple's avTouch sample app, the documentation for AVAudioPlayer, and the guide Getting Started with Audio & Video.
When it happened to me I had a missing '/' on the end of my url. Adding that cleared me right up.