草庐IT

moviePlayerController

全部标签

ios - 下载时播放 Mp4 和 Mp3 文件

我想播放一个音频和视频文件,但我没有这些文件的URL。我现在正在使用AFNetwork下载文件,文件数据是字节形式的。[operationsetDownloadProgressBlock:^(NSUIntegerbytesRead,longlongtotalBytesRead,longlongtotalBytesExpectedToRead){floatval=(float)totalBytesRead/totalBytesExpectedToRead;if(!isStart&&val>=0.5){isStart=YES;UIWindow*window=[UIApplicationsh

ios - 在 iphone 中单击完成按钮时,MP 电影 Controller 会删除

我在MPmovieController中播放视频它工作正常但播放器在播放完整视频时删除。我希望当用户按下完成按钮时视频应该停止在这里是我正在使用的代码。NSURL*myURL=[NSURLfileURLWithPath:url];MPMoviePlayerController*moviePlayerController=[[MPMoviePlayerControlleralloc]initWithContentURL:myURL];[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(moviePl

iphone - 如何在同一个 MPMoviePlayerController 中播放另一个视频?

*我正在创建一个iPhone应用程序,我们可以在其中观看视频...我一直在制作自己的控件,所以我想实现下一个后退按钮,我可以显示主题,所以对于UI来说一切正常,问题是用另一个内容重新启动MoviePlayer...有什么想法吗???我可以在播放完成后使用相同的配置,我的意思是...如果视频结束播放以开始播放另一个...我试图设置contentUrl但它抛出了一个异常:2012-04-1711:37:41.198NexTest2[8218:11f03]***Terminatingappduetouncaughtexception'CALayerInvalidGeometry',reaso

iphone - 按下主页按钮时 MPMoviePlayerViewController 消失

我正在像这样创建我的MPMoviePlayerViewController:MPMoviePlayerViewController*playerView=[[MPMoviePlayerViewControlleralloc]initWithContentURL:videoURL];[selfpresentMoviePlayerViewControllerAnimated:playerView];它工作正常,直到我按下主页按钮:这样,在我重新打开应用程序后,播放器ViewController消失了,我看到了我最初调用它的ViewController。如果我双击主屏幕按钮打开多任务面板,播

iphone - nsinvalidargumentexception' 原因 'an avplayeritem cannot be associated with more than one instance of avplayer'

我正在使用MPMoviePlayerController用于播放视频,在此我使用自定义搜索栏来跳转视频。但是当我不断地向前和向后搜索时,应用程序崩溃并抛出以下错误:nsinvalidargumentexception'reason'anavplayeritemcannotbeassociatedwithmorethanoneinstanceofavplayer'所以请提出建议。谢谢 最佳答案 有同样的问题,尝试在设置SourceType后设置ContentURL,如下所示,moviePlayerController_=[[MPMov

ios - 如何使用从 iOS 中的服务器获取的 URL 在 UIView 中播放视频

我想通过从服务器的JSON响应中获得的URL在我的UIView中播放视频。这是我为播放视频而编写的代码,但没有任何反应。NSURL*movieURL=[NSURLURLWithString:objAlbum.strVideoURL];MPMoviePlayerController*moviePlayerController=[[MPMoviePlayerControlleralloc]initWithContentURL:movieURL];[moviePlayerController.viewsetFrame:self.movieView.bounds];[self.movieVie

iphone - 如何在 iPhone 中使用移动和缩放 UIImagePickerController?

我是iPhone开发新手。我正在使用图像选取器Controller,我想在其中移动和缩放从照片库中选取的图像,因此我启用了allowsediting=yes。我的选择器确实完成了方法:-(void)imagePickerController:(UIImagePickerController*)pickerdidFinishPickingMediaWithInfo:(NSDictionary*)info{//AccesstheuncroppedimagefrominfodictionaryUIImage*image=[infoobjectForKey:@"UIImagePickerCon

swift - 从前台导航到后台时如何暂停和播放背景视频?

当我启动我的应用程序时,背景视频正在播放。如果我碰巧按下主页按钮,我希望视频暂停并从中断处继续播放。这是我的代码:classViewController:UIViewController{letmoviePlayerController=AVPlayerViewController()varaPlayer=AVPlayer()funcplayBackgroundMovie(){ifleturl=NSBundle.mainBundle().URLForResource("IMG_0489",withExtension:"m4v"){aPlayer=AVPlayer(URL:url)}mo

swift - 使用 Swift 使用 MPMoviePlayerController 禁用音频(和中断)

目前,这就是我在UIViewController的subview上播放视频的方式:overridefuncviewDidAppear(animated:Bool){letfilePath=NSBundle.mainBundle().pathForResource("musicvideo",ofType:"mp4")self.moviePlayerController.contentURL=NSURL.fileURLWithPath(filePath)self.moviePlayerController.play()self.moviePlayerController.repeatMod

ios - 如何在 iOS 中从本地或服务器 URL 播放视频

如何在iOS中从InternetURL或本地文件播放.mp4或.mov视频? 最佳答案 1.首先在XCode中添加MediaPlayer.Framework2.然后在你的viewController的.h文件中添加#import3.现在在你的viewDidLoad方法中实现这段代码//NSString*filepath=[[NSBundlemainBundle]pathForResource:@"aaa"ofType:@"mp4"];//NSURL*fileURL=[NSURLfileURLWithPath:filepath];NS
12