MPMoviePlayerController | How to play part of Video

徘徊边缘 提交于 2019-12-13 05:15:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!