我有一个10秒长的视频剪辑,我想从3秒播放到6秒。使用CCPlayer可以做到这一点吗?或者甚至是MPMoviewPlayer?
这是我的代码:
MPMoviePlayerController *_theMovie;
[_theMovie setCurrentPlaybackTime:1.0];
[_theMovie setEndPlaybackTime:2.0];
[_theMovie play]; 但视频播放时间为0到2秒:(
谢谢
发布于 2012-09-11 20:50:08
这是docs中的两个setter。
// The start time of movie playback. Defaults to NaN, indicating the natural start time of the movie.
@property(nonatomic) NSTimeInterval initialPlaybackTime;
// The end time of movie playback. Defaults to NaN, which indicates natural end time of the movie.
@property(nonatomic) NSTimeInterval endPlaybackTime;
MPMoviePlayerController *_theMovie;
[theMovie setInitialPlaybackTime:3.0]; //instead of [_theMovie setCurrentPlaybackTime:1.0];
[theMovie setEndPlaybackTime:6.0];
[_theMovie prepareToPlay];
[_theMovie play];:)
发布于 2012-09-11 20:52:22
在MPMoviewPlayer中更改currentPlaybackRate时间,
moviplayer.currentPlaybackRate =moviePlayer.duration/3 or 6;https://stackoverflow.com/questions/12369917
复制相似问题