MPMoviePlayerController 结束播放时间问题

发布于 2024-11-23 18:23:57 字数 609 浏览 7 评论 0原文

我对 endPlaybackTime 有疑问。我试图在 30 秒的视频中自动启动和停止视频

player = [[MPMoviePlayerController alloc] initWithContentURL:[self urlForVideo:video]];
player.view.frame = [self getVideoCGRect:self.interfaceOrientation];
player.view.backgroundColor = [UIColor clearColor];
player.controlStyle = MPMovieControlStyleNone;
player.shouldAutoplay = NO;
player.scalingMode = MPMovieScalingModeFill;

//-------------------------
player.currentPlaybackTime = 10.0;
player.endPlaybackTime = 18.35;
//---------------------
[self.view addSubview:player.view];

但是,这似乎不想在正确的位置停止。它只是播放到最后并停止。知道为什么不吗?

I am having an issue with the endPlaybackTime. I am trying to auto start and stop the video mid-way through the 30 second video

player = [[MPMoviePlayerController alloc] initWithContentURL:[self urlForVideo:video]];
player.view.frame = [self getVideoCGRect:self.interfaceOrientation];
player.view.backgroundColor = [UIColor clearColor];
player.controlStyle = MPMovieControlStyleNone;
player.shouldAutoplay = NO;
player.scalingMode = MPMovieScalingModeFill;

//-------------------------
player.currentPlaybackTime = 10.0;
player.endPlaybackTime = 18.35;
//---------------------
[self.view addSubview:player.view];

But, this doesn't seem to want to stop in the correct place. It just plays to the end and stops. Any idea why not?

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

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

发布评论

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

评论(1

没有伤那来痛 2024-11-30 18:23:57

endPlaybackTime 属性不可用于流视频。希望您没有试图停止播放视频。还有长度是30秒还是30分钟?

endPlaybackTime property is not available for streaming video. Hope you're not trying to stop streaming video. Also it's 30 seconds or 30 minutes in length?

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