MPMoviePlayerController 错误或功能:将initialPlaybackTime 设置为 t 秒会隐藏时间滑块直至 t
假设一部电影时长 10 分钟,我将 initialPlaybackTime
设置为 1 分钟标记,如下所示:
NSString *urlStr = @"http://<ip>/vod_movie.m3u8"; // 10 minute long video
MPMoviePlayerController* playerController = [[MPMoviePlayerController alloc]
initWithContentURL:[NSURL URLWithString:urlStr]] ];
[playerController prepareToPlay];
[playerController setInitialPlaybackTime:60]; // Want to play from the 1 minute mark
这会导致视频从 1 分钟标记开始播放,但时间滑块隐藏了该部分早于 1 分钟,因此您无法向后查找。
Say a movie is 10 min long and I am setting initialPlaybackTime
to the 1 minute mark, like thus:
NSString *urlStr = @"http://<ip>/vod_movie.m3u8"; // 10 minute long video
MPMoviePlayerController* playerController = [[MPMoviePlayerController alloc]
initWithContentURL:[NSURL URLWithString:urlStr]] ];
[playerController prepareToPlay];
[playerController setInitialPlaybackTime:60]; // Want to play from the 1 minute mark
This results in the video starting to play from the 1 minute mark, but the time-slider hides the part before 1 min, so there is no way you can seek backwards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是
initialPlaybackTime
的预期行为。我不知道针对您想要执行的操作有任何推荐的解决方案,但您可以尝试将initialPlaybackTime设置为-1,并在视频开始播放后使用setCurrentPlaybackTime
滚动到电影中的位置您希望播放开始于。This is the intended behavior of
initialPlaybackTime
. I don't know of any recommended solution for what you are trying to do, but you could try setting initialPlaybackTime to -1 and after the video starts playing usesetCurrentPlaybackTime
to scroll to the position in the movie that you want the playback to start at.