有没有办法让MPMoviePlayerController(甚至像AVPlayer这样的低级别)从iTunes Store播放受保护的M4V文件?
在此处使用官方iTunes API:http: //www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
我可以获得电影,电视节目和音乐视频的"previewURL".音乐视频似乎没有受到保护,但电影和电视节目却受到保护.
例如,这是披头士的音乐视频的预览URL(实际上是纪录片,但无论如何):http: //a809.v.phobos.apple.com/us/r1000/006/Video/72/fe/ 52/mzm.bxhrrlns..640x480.h264lc.upm4v
这是"辛普森一家"一集的预览网址:http: //a911.v.phobos.apple.com/us/r1000/017/Video/ec/cc/cf/mzi.mnuqbbcl..640x480.h264lc. d2.p.m4v
使用MPMoviePlayerController可以播放音乐视频,但是辛普森一家的视频根本不播放.(当与MPMoviePlayerViewController一起使用时,视图控制器以模态方式显示,然后在没有任何用户交互的情况下立即被解除.)
如果您在QuickTime Pro中查看这两个URL,唯一明显的区别是第二个URL被列为"受保护",这将导致人们假设MPMoviePlayerController无法播放受保护的内容,即使该内容直接来自苹果.
在文档中的"支持的格式"部分下,M4V没有具体列出,但肯定有效.我找不到任何引用受保护内容的文档.
如果有人知道如何在应用程序内或通过其他方式播放此内容,那只是好奇.(调用[UIApplication ... openURL]也不起作用,因为Mobile Safari也不会播放内容.)
这是在iOS 4.x.
谢谢.
我试图在触摸包含它的图层时更改CAShapeLayer的fillColor.我可以像这样更改tapped图层的背景颜色:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
CALayer *layer = [(CALayer *)self.view.layer.presentationLayer hitTest:point];
layer = layer.modelLayer;
layer.backgroundColor = [UIColor blueColor].CGColor;
}
Run Code Online (Sandbox Code Playgroud)
这将"层"的背景变为预期的蓝色.我的问题是如何在"图层"中更改CAShapelayer的颜色?谢谢!
我真的很想解决这个非常恼人的问题,我通常会为App Store构建新的应用程序而没有任何问题,但这次它只是起作用.
奇怪的是,当我为"发布"做"构建"时,它没有问题,但是当我为"发布"执行"存档"时,它显示以下错误
warning: Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate. (-19011)
Executable=/Users/freak4pc/Library/Developer/Xcode/DerivedData/MyApp-atlgyhqdbhtnxvdnpfikhboujfpu/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/MyApp
AssertMacros: message, file: codesign_wrapper.c, line: 554
AssertMacros: profile, file: codesign_wrapper.c, line: 918
codesign_wrapper-0.7.10: Failed to load provision profile from: /Users/freak4pc/Library/Developer/Xcode/DerivedData/MyApp-atlgyhqdbhtnxvdnpfikhboujfpu/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/embedded.m
- (null)
我的配置文件应该完美地工作,因为组织者也认为它是有效的.我的权利只有一个get-task-allow设置为NO值,我总是在成功构建时使用它.
除了删除我的密钥并重新创建它们之外,我已经尝试过任何事情,我宁愿不这样做 - 因为这是我唯一有问题构建的应用程序.
尝试:
1. Recreating the Entitlements
2. Redownloading the Provisioning profile
3. Do a complete clean including Clean Build Folder
4. Edit the pbxproj file and clearing all …Run Code Online (Sandbox Code Playgroud) 我正在开发一个仅限Ipad的应用程序,但是当我尝试在苹果商店提交时,我在"应用程序失败的代码签名验证由于无效的权利"错误中遇到了很多问题,而且我在下面提到了一些问题.我使用Xcode 4.3.2和IOS 5.1进行开发,Target是IOS 5.0
1. iPad: application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv7 (-19033)
Run Code Online (Sandbox Code Playgroud)
为此,我确实像其他人一样提到
ARCHS = armv7 armv6
Run Code Online (Sandbox Code Playgroud)
我添加了架构armv7,但它不在这里工作是构建设置的链接我没有权利文件,因为人们告诉我,但如果你能帮助我


2. Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate. (-19011)
3. Unable to extract entitlements from application: (null) (-19045)
Run Code Online (Sandbox Code Playgroud)
这是最糟糕的错误,我希望你带我进一步,谢谢
Validate /Users/bourne/Library/Developer/Xcode/DerivedData/TurfNutritionTool_ver_5.1-azcqbuzeebaybzdjeksuhyuvyrmw/Build/Products/Release-iphoneos/TurfNutritionTool_ver_5.1.app
cd /Development/TurfNutritionTool_IOS_5.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv PRODUCT_TYPE com.apple.product-type.application
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation /Users/bourne/Library/Developer/Xcode/DerivedData/TurfNutritionTool_ver_5.1-azcqbuzeebaybzdjeksuhyuvyrmw/Build/Products/Release-iphoneos/TurfNutritionTool_ver_5.1.app
warning: iPad: application executable …Run Code Online (Sandbox Code Playgroud) 我正在使用AVPlayer和MKVolumeView来显示本机AirPlay输出菜单.
在iOS 6中,无论状态栏的方向如何,AirPlay输出菜单似乎都以纵向显示.在iOS 5中,它遵循状态栏方向.
任何方式让它跟随状态栏,或至少强制方向?
我有一个AVQueuePlayer(显然可以扩展AVPlayer)加载流媒体音频的播放列表.流媒体工作正常,但我想有一个活动指示器来显示用户音频正在加载.麻烦的是,我似乎无法在AVQueuePlayer(或AVPlayer)中找到任何此类通知,指示音频缓冲区何时完成加载/准备播放(似乎也没有委托方法).有什么想法吗?
有一个奇怪的.我已经把它归结为一个非常简单的例子.真的想不出来.
我在LinearLayout中有一个LinearLayout.我想使用动画来调整孩子的大小(有时我会做一些治疗).这是我的布局XML.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical">
<!-- Lots more controls will appear above -->
<LinearLayout android:layout_width="fill_parent" android:layout_height="0dp" android:id="@+id/animation_subject">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:gravity="center" />
</LinearLayout>
<!-- Lots more controls will appear below -->
</LinearLayout>
<Button android:text="Slide it Down!" android:layout_width="fill_parent" android:layout_height="wrap_content" android:onClick="btnDoAnimDown_OnClick" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
现在,正如您所看到的,有一个按钮,这是该按钮的代码.
public void btnDoAnimDown_OnClick(View v)
{
View pnlSlider = findViewById(R.id.animation_subject);
pnlSlider.measure(1000, 1000);
DropDownAnim anim = new DropDownAnim(pnlSlider, pnlSlider.getMeasuredHeight(), true);
anim.setDuration(2000);
pnlSlider.startAnimation(anim);
return;
}
Run Code Online (Sandbox Code Playgroud)
如果你现在运行它,它不会下滑.完全没有.但是,如果您要将Button移动到我已命名为Overview的LinearLayout并将其放在Child LinearLayout之后,那么它就可以了!像这样...
<?xml version="1.0" encoding="utf-8"?> …Run Code Online (Sandbox Code Playgroud) 我正在使用两个玩家MPMoviePlayerController,另一个是AVPlayer.henever MPMoviePlayerController是seeked,它设置的时间AVPlayer.一切都很好.将转换MPMoviePlayerController当前时间转换CMTime为ex :(如果mpplayer时间为11.80132,它将四舍五入为11).
如果没有四舍五入,我们如何设定时间AVPlayer?
获取mpplayer时间和发送到AVPlayer课堂的代码
[avplayerClass setCurrentTime:[self.videoPlayer currentPlaybackTime]];
NSLog(@"CurrentTime:%f",[self.videoPlayer currentPlaybackTime]);//11.801345
Run Code Online (Sandbox Code Playgroud)
AVPlayer类中的代码并将时间转换为CMTime
-(void)setCurrentTime:(NSTimeInterval)seekTime
{
CMTime seekingCM = CMTimeMake(seekTime, 1);
[self.player seekToTime:seekingCM
toleranceBefore:kCMTimeZero
toleranceAfter:kCMTimePositiveInfinity];
[self.player seekToTime:seekingCM];
NSLog(@"Current time123ns%%%%%%:%f",CMTimeGetSeconds(seekingCM));//11
NSLog(@"Current time123ns%%%%%%:%f",seekTime);//11.801345
}
Run Code Online (Sandbox Code Playgroud) objective-c mpmovieplayercontroller nstimeinterval avplayer cmtime
我没有找到如何从锁定屏幕iOS 7回放歌曲的方式.音量滑块可用,所有按钮都正常工作,但上部滑块不可用!
AVPlayer是我正在使用的类.
任何帮助表示赞赏!
我在iOS 7中面临MPMoviePlayerController的问题.当我单击前向搜索按钮时,视频停止并且不允许执行任何类似于再次播放全屏和滑块更改的操作.
这是我的代码.删除MPMoviePlayerPlaybackDidFinishNotification的Observer
[[NSNotificationCenter defaultCenter] removeObserver:moviePlayerViewController name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerViewController.moviePlayer];
Run Code Online (Sandbox Code Playgroud)
并添加新通知MPMoviePlayerPlaybackDidFinishNotification
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(videoFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
Run Code Online (Sandbox Code Playgroud)
这是我处理MPMoviePlayerPlaybackDidFinishNotification的自定义方法
-(void)videoFinished:(NSNotification*)aNotification{
MPMoviePlayerController *moviePlayer = [aNotification object];
NSLog(@"%f",moviePlayer.currentPlaybackTime);
int reason = [[[aNotification userInfo] valueForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey] intValue];
if (reason == MPMovieFinishReasonPlaybackEnded) {
}else if (reason == MPMovieFinishReasonUserExited) {
[self performSelector:@selector(dismiss:) withObject:aNotification afterDelay:0.5];
}else if (reason == MPMovieFinishReasonPlaybackError) {
}
}
Run Code Online (Sandbox Code Playgroud)
我需要在单击时停止这种奇怪的行为并继续播放.
有人知道怎么做吗?谢谢.
ios ×7
objective-c ×6
avplayer ×4
avfoundation ×3
ios7 ×2
iphone ×2
android ×1
app-store ×1
build ×1
calayer ×1
cmtime ×1
cocoa-touch ×1
code-signing ×1
drm ×1
ios4 ×1
ios5 ×1
ios6 ×1
mpvolumeview ×1