MPMoviePlayerController, disallow fullscreen but allow navigation through clip?
Asked Answered
T

1

7

I have a video in my iPad app, but I dont want it to be able to go to fullscreen. However I do potentially want the user to be able to navigate to the part of the video that they want to see.

As far as I can tell there are only three options for the controls that you give the user: None, Embedded, or Fullscreen.

None gives the user no control. Embedded and Fullscreen basically give the use the same amount of control but just start in different states.

Basically what I want is Embedded with the switch to Fullscreen option taken out.

Anybody know if its possible? Thanks

Takao answered 13/7, 2010 at 7:7 Comment(0)
L
2

You can set the controls style to "None", and then add your own custom view to navigate using a UISlider (I've done this in the past).

MPMoviePlayerController adheres to the MPMediaPlayback protocol, so you take the total playback time of the movie, multiply it by the UISlider value (when it changes), and then adjust the movie's playback head position.

You'll also need an NSTimer or KVO to monitor the playback time so it can update the slider UI element in realtime.

Legumin answered 30/5, 2011 at 0:51 Comment(2)
KVO won't work here, currentPlaybackTime is not KVO-compliant and will not generate any notification. NSTimer seems the only solution right now.Uncourtly
Thanks for the comment. Thinking about it again, it makes sense -- the playback time is constantly changing, so it would create a deluge of events..Legumin

© 2022 - 2024 — McMap. All rights reserved.