问题
I am using MPMoviePlayerController to play video. I want to play part of video on clicking play button. For example if my video is of 200 seconds, i want to play video from 50th-100th second. Even i'm not able to get time-length video played at particular instance like at the time of pausing.
回答1:
MPMoviePlayerController
has two properties: initialPlaybackTime
and endPlaybackTime
that you can set to an NSTimeInterval
(= double used to specify a time interval in seconds) to control the start and end time for the playback of the movie.
This code for example will play the movie from the 10th second to the 20th second:
[moviePlayerController setInitialPlaybackTime:10.f];
[moviePlayerController setEndPlaybackTime:20.f];
来源:https://stackoverflow.com/questions/18768972/mpmovieplayercontroller-how-to-play-part-of-video