Is there a way to customise the look or at least position of the movie progress slider on MPMovidePlayer?
-
I think Mpmovieplayer have a by default movie progress slider. isn't? – Vishal Dec 27 '12 at 07:52
-
It has the default one. But it's not resizable or movable. A want to have a control over him... – Borut Tomazin Dec 27 '12 at 07:55
-
I think there is not a solution that we have added it on customized slider. I have also used it one of my App and I also can't find any solution for this issue... – Vishal Dec 27 '12 at 07:58
-
Do you know how it's made in new Youtube's app? – Borut Tomazin Dec 27 '12 at 07:59
-
No, dude no idea about it... – Vishal Dec 27 '12 at 08:00
3 Answers
Hide existing controls using MPMovieControlStyle
, set this to MPMovieControlStyleNone
.
Now add
your custom control
on MPMoviePlayer's
view.
Refer example uislider-to-control-avaudioplayer as its same as MPMoviePlayer
has currentPlaybackTime
Refer mpmovieplayercontroller-buffering-state link.
Refer mpmovieplayercontroller-when-will-i-know-that-the-downloading-of-the-file-reach link.

- 1
- 1

- 38,095
- 11
- 81
- 132
-
That's fine but how to create custom scroller with info about current position and buffering... ? – Borut Tomazin Dec 27 '12 at 08:26
-
how ever created custom control for AVAudioPlayer? Same implies here – Paresh Navadiya Dec 27 '12 at 08:27
-
Thanks, I'll take a look. But it still bothers me about buffering control. Where do I get info about that? – Borut Tomazin Dec 27 '12 at 08:31
-
Check this : http://stackoverflow.com/questions/9550813/mpmovieplayercontroller-buffering-state – Paresh Navadiya Dec 27 '12 at 08:35
-
There is also another property to check for: http://stackoverflow.com/q/10346327/384864 – Borut Tomazin Dec 28 '12 at 08:08
For this you have to make your own custom slider. for example you can hide the MPMoviePlayerController progress bar and make your own custom progress bar you can hide MPMoviePlayerController progress bar by this code
moviePlayerController.controlStyle = MPMovieControlStyleNone;
Then you can create custom progress bar
UISlider *progressbar;
[progressbar setMinimumTrackImage:[UIImage imageNamed:@"min.png"] forState:UIControlStateNormal];//you can set the background for which you have progressed the video
[progressbar setMaximumTrackImage:[UIImage imageNamed:@"max.png"] forState:UIControlStateNormal];//you can set the background for which you have left the video
[progressbar setThumbImage:[UIImage imageNamed:@"thumb.png"] forState:UIControlStateNormal];//you can set the thumb image for you progress bar.
This will be slider you can update the postion of slider in a thread.

- 827
- 6
- 10
-
Are there any notifications about current track position or do I have to do it myself? What about buffering track, can I get info about buffering? – Borut Tomazin Dec 27 '12 at 08:25
-
you can update the time of slider by getting the current time in thread by this control moviePlayerController.currentPlaybackTime. – Ahsan Dec 27 '12 at 08:28
-
You have to do it yourself. may be there is other way around but I'm telling you what i have used. – Ahsan Dec 27 '12 at 08:29
here is a code for progress a slider like as MPMoviePlayerController
"Use NSTimer to smoothly move slider as MPMoviePlayerController Progress Bar"
// you can change scheduledTimerWithTimeInterval as per your need
[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateSlider) userInfo:nil repeats:YES];
"Set currentPlaybackTime to Slider value"
- (void)updateSlider {
slider1.value = self.moviePlayerController.currentPlaybackTime;
}

- 173
- 1
- 6