开发者

Stop and Starting MPMoviePlayerController by touch

I do a

  player.shouldAutoplay = YES;
  [player setEndPlaybackTime:initPlay];

and it works fine and then in

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
开发者_运维问答      if ([touches count] == 1) {
          [player play];
      }
    }

Even though the touch happens and the play command happens it does not work, but if I try and set the setEndPlaybackTime again it stil does not play? I just want it to keep play after the user touches the screen any ideas?


Could it be that the video must rewind to the start? Have you tried:

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
  if ([touches count] == 1) {
      player.initialPlaybackTime = 0.0;
      [player play];
  }
}

See http://developer.apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/Reference/Reference.html

A value of -1 may also work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜