0

10秒の長さのビデオクリップがあり、3秒から6秒で再生したいと思います。これはCCPlayerで可能ですか?それともMPMoviewPlayer?

これは私のコードです:

MPMoviePlayerController *_theMovie;  
[_theMovie setCurrentPlaybackTime:1.0];  
[_theMovie setEndPlaybackTime:2.0];  
[_theMovie play];  

しかし、ビデオは0〜2秒で再生されます:(

ありがとう

4

2 に答える 2

1

これがドキュメントの2つのセッターです。

// 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-11T12:50:07.993 に答える
0

MPMoviewPlayerでcurrentPlaybackRate時間を変更します。

moviplayer.currentPlaybackRate =moviePlayer.duration/3 or  6;
于 2012-09-11T12:52:21.840 に答える