iPad Movie Player Problem - ipad

I am playing mp4 files in iPad using MPMoviePlayerController. I have a view connected in IB to play the video files. The problem is that if one of the files is audio-only, it plays fine, but then videos that play after the audio file do not show the play/pause/seek controls.
I am doing this to initialize the view:
self.theMovie = [[MPMoviePlayerController alloc] init];
[self.viewForMovie addSubview:theMovie.view];
Has anyone seen this behavior or have an idea how I can get the video controls to reappear?
Thank you!

You can set the control type with
self.theMovie.controlStyle=MPMovieControlStyleDefault
These are the available options:
MPMovieControlStyleNone
MPMovieControlStyleEmbedded
MPMovieControlStyleFullscreen
MPMovieControlStyleDefault
Details here: http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMoviePlayerController_Class/Reference/Reference.html

Related

MPMoviePlayerController shows no picture when playing online video

I used a MPMoviePlayerController to play online video in another view controller. It works well most times. But sometimes the player plays video without pictures while the sound and progress bar are working. After the black screen occurs, if I change to play another video, it will often works well. Can someone tell me what's the problem and how can I fix it?
Try to use MPMoviePlayerController to play online video.
It is the best controller for playing online videos.

MPMoviewcontroller and AVPlayer with custom control

Hi sorry for this old question. I have tried to research but still have no solution :(.
I need to implement a video controller with my own control buttons. Base on apple example
I use MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:url];
player.controlStyle = MPMovieControlStyleNone; and add my own layer over player.view. There is a problem with my seekForward function. I can not set player.currentPlaybackTime = player.duration (when user press seekForward until reaching the end of the movie). I want to switch to AVPlayer but there is another issues. How can I custom with my own button?. Please help.
I have the same issue with MPMoviePlayerController. Also We can't add more than one MPMoviePlayerController in a same view. For this, I have created a custom player using AVPlayer having basic features. You can download it from my github account HRVideoPlayer. Let me know if you want more detailed version. I have built my own video player having all functionalities like Seeking, volume control, brightness control, replace currentItem, Repeat and shuffle.

Streaming audio and video into IOS app

I am creating an iPhone app on Xcode with build in video and music, the trouble is I want to keep the whole app below 20MB
I've compressed the videos to a OK standard but I'm still over the 20MB
Is there a way I can just stream the videos from a server, so when I click on my video / Audio button in the app it plays like it was saved within the app.
Many Thanks
Try this:
MPMoviePlayerViewController *movieView = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:#"http://movieurl"]];
[self presentMoviePlayerViewControllerAnimated:movieView];
don't forget to import MediaPlayerFramework
If you need more control over streaming, playback or the view itself, see MPMoviePlayerController Class Reference

iPhone: How to play a YouTube video in a certain view (instead of fullscreen)

I found a lots posts about playing mp4 in MPMoviePlayerController (can be in a smaller view in screen) or play youtube video in YTMoviePlayer (fullscreen). I'd like to know if there are someways to play a YouTube video in a certain view? Like apple's example code for MPMoviePlayerController?
https://developer.apple.com/library/ios/#samplecode/MoviePlayer_iPhone/Introduction/Intro.html
Thanks you
You should try this. LBYoutubeView. This allows you to play a video in specific view frame.
If you're using an iPhone, there's no way of using the MPMoviePlayerController other than fullscreen. With the iPad, it's a different story, you can embed the player in another view.

iPhone SDK: Custom video player controls

In my iPhone app I have designed a custom video player, currently it is very basic with just a play pause and stop button,
but I would like the user to be able to scrub, (I think thats the right word) the video like you can do with apple's original media player.
So for Instance I would like to be able to take a UISlider and have it control the current postiion of the videos playback if you get what I mean. Oh and incase your curious, the way I pause/play/stop the video is by using this simple piece of code [self.theMovie play]; [self.theMovie stop]; [self.theMovie pause]; The trouble is I don't know how to scrub the video.
Any help appreciated.
I've asked the same question: customize quicktime iphone and here MPVideoPlayer add/remove buttons
It seams that you have to posibilities:
You can add you view over the main window. An sample can be found here: MoviePlayer Sample
You can iterate through views, found one you need and Add/Remove views. I don't know yet how must does Apple likes/dislikes this method.

Resources