Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom progress slider control on MPMoviePlayer

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

like image 876
Borut Tomazin Avatar asked Dec 27 '12 07:12

Borut Tomazin


2 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.

like image 51
Paresh Navadiya Avatar answered Sep 22 '22 09:09

Paresh Navadiya


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.

like image 37
Ahsan Avatar answered Sep 25 '22 09:09

Ahsan