停止并启动mpmovieplayercontroller

发布于 2024-12-05 06:33:22 字数 391 浏览 0 评论 0原文

我做A

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

并且可以正常工作,然后

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

即使发生了触摸,并且发生play命令也无法正常工作,但是如果我尝试再次设置SetenDplayBacktime,则Stil不会播放?我只希望在用户触摸屏幕的任何想法之后继续播放吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独行侠 2024-12-12 06:33:22

难道视频必须倒带到开头吗?您是否尝试过:

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

请参阅 http://developer .apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/Reference/Reference.html

值可能为 -1也工作。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文