gpt4 book ai didi

iphone - 使用 MPMoviePlayerController 播放 iTunes 预览视频

转载 作者:行者123 更新时间:2023-11-29 04:40:56 26 4
gpt4 key购买 nike

我正在尝试从 URL 播放视频,我要播放的视频是 iTunes 预览视频,如下所示: http://a236.v.phobos.apple.com/us/r1000/051/Video/ec/1d/7f/mzm.hwbfvfdq..640x480.h264lc.d2.p.m4v我在 iPhone 上尝试过,打开播放器,我看到缓冲区已加载,但如果我播放它,我看不到任何内容,我该怎么办?...这是代码:

- (void) moviePlayBackDidFinish:(NSNotification*)notification {

MPMoviePlayerController *moviePlayer = [notification object];

[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];

if ([moviePlayer
respondsToSelector:@selector(setFullscreen:animated:)])
{
[moviePlayer.view removeFromSuperview];
}
[moviePlayer release];
}

- (IBAction)playVideo:(id)sender {

NSURL *url = [NSURL URLWithString:@"http://a236.v.phobos.apple.com/us/r1000/051/Video/ec/1d/7f/mzm.hwbfvfdq..640x480.h264lc.d2.p.m4v"];

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];

moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;

[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];


}

最佳答案

因为您正在尝试从 iTunes 访问 .m4v 文件。 DRM 保护是问题所在。

编辑:您的链接在 Quicktime 中有效,但在浏览器中无效。

Apple 不允许在 MPMoviePlayerConroller 中播放 iTunes 中受 DRM 保护的音乐或视频(包括预览)。

另请参阅 Stackoverflow 上的以下链接

关于iphone - 使用 MPMoviePlayerController 播放 iTunes 预览视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10405958/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com