MPMoviePlayerController bug or feature: Setting initialPlaybackTime to t seconds hides the time-slider upto t
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.
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 use setCurrentPlaybackTime
to scroll to the position in the movie that you want the playback to start at.
精彩评论