Question

Is there a way to customise the look or at least position of the movie progress slider on MPMovidePlayer?

Was it helpful?

Solution

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.

OTHER TIPS

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.

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;
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top