[playerView setCurrentPlaybackTime:5.100000];
LOG -> playerView.currentPlaybackTime = @"5.100000"
[playerView play];
LOG -> playerView.currentPlaybackTime = @"0"
在其他情况下会发生这种情况
LOG -> playerView.currentPlaybackTime = @"25.000000"
[playerView play];
LOG -> playerView.currentPlaybackTime = @"23.156467"
我在播放前尝试使用[playerView prepareToPlay],但它不起作用
答案 0 :(得分:0)
如果您想从某个值开始播放,则需要将initialPlaybackTime
实例上的MPMoviePlayerController
属性设置为您希望播放的值。
答案 1 :(得分:0)
我最终决定切换到AVPlayer
setCurrentPlayback是
int32_t timeScale = playerView.currentItem.asset.duration.timescale;
CMTime time = CMTimeMakeWithSeconds(value, timeScale);
[playerView seekToTime:time toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
持续时间
CMTime duration = playerView.currentItem.asset.duration;
float seconds = CMTimeGetSeconds(duration);
相同的暂停和播放功能。