i have implemented Custom Video Player feature in my Application that will used to play online videos now i want to implement video buffering feature i am searching for it but not getting proper solution.
So can anyone guide me please.
look into the AVPlayer + AVPlayerLayer classes.
load AVPlayer with the URL of the video.
give it some time to buffer the video before calling the playing method, maybe like this:
[self performSelector:#selector(play:) withObject:nil afterDelay:10.0];
I think MPMoviePlayerController by default supports the streaming feature. Why don't you try that.
Related
Is it possible to play some audio files while my movie is playing. I don't want it to interrupt or pause he movie. Just the audio to play at same time at various predetermined points.
Many Thanks,
-Code
You shouldn't have any problems with it.
If you want to synchronize or delay these players you should use
the code they provide in AvAudioPlayer Class Reference using
playAtTime: method.
Sadly MPMediaPlayback protocol doesn't provide the same method
so exact synchronizing with video is a bit harder task.
EDIT: RoLYroLLs mentions using MPMoviePlayerLoadStateDidChangeNotification to achieve this here and this approach seems promising.
Use two or three Audioplayer at same time . Play that audio when u need it
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. :)
I'm having a few issues playing a video in MonoTouch. From what I can find there are two different approaches to take. Both result in the audio being played but no video. I'm betting I'm missing something simple so any help would be great.
Attempt one - taken from MT documentation
moviePlayer = new MPMoviePlayerController(new NSUrl("test.mp4"));
moviePlayer.Play();
Attempt two
moviePlayer = new MPMoviePlayerViewController(new NSUrl("test.mp4"));
this.PresentMoviePlayerViewController(moviePlayer);
Thanks
From looking at the documentation, you need to add the MPMoviePlayerController to a view, otherwise the video will no know where to play.
Your second attempt looks a little better, are you calling the play method on the moviePlayer (note this is a MPMoviePlayerViewController) MPMoviePlayerController (named MoviePlayer)?
For what it's worth, I can get;
moviePlayerController = new MPMoviePlayerViewController(new NSUrl("test.mp4"));
this.PresentMoviePlayerViewController(moviePlayerController);
working with no issues on a sample iPad app. Are you sure your test.mp4 is...
Encoded correctly
Included in the project
Video's build action is set to content
Documentation for MPMoviePlayerController: http://developer.apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html
Documentation for MPMoviewPlayerViewController:
http://developer.apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMoviePlayerViewController_class/Reference/Reference.html#//apple_ref/occ/cl/MPMoviePlayerViewController
Please I know how to play a sound in AVAudioPlayer but I would like to know how to give it a list of on-disk files to play one after the other (play list)
Anyone has any idea?
You have to manage this by yourself, using the 'audioPlayerDidFinishPlaying' method to know when the current song is over, and when to start a new one.
The Apple "AddMusic" sample program does exactly this, setting up a playlist of audio files using MPMusicPlayerController and AVAudioPlayer to do most of the work.
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.