jjzjj

AVPlayerViewController

全部标签

ios - 嵌入式 AVPlayerControllerView 添加 AVTouchIgnoringView 阻止默认播放器的界面

更新:这个问题与AVPlayerControllerView无关,请看下面我的回答。类名AVTouchIgnoringView一开始让我感到困惑,但这也是思考问题的错误路径。===众所周知,MediaPlayer框架在iOS9中已被弃用,因此我决定在我的新项目中尝试使用AVKit。我的任务是显示一个嵌入在CollectionView标题(UICollectionReusableView)中的视频播放器,下面有一些任意单元格。这是我在代码中的做法:overridefuncviewDidLoad(){super.viewDidLoad()apiManager.loadVideo(){vid

ios - 什么视频分辨率和格式最适合 iOS 应用程序?

我想在我的某个应用程序中播放全屏视频作为背景。问题是视频占用了大量空间。什么分辨率和格式最适合ios应用程序?主要标准是文件大小&加载时间。 最佳答案 在Appledocs中提到了支持的视频类型:iPhoneOSprovidessupportforfull-screenvideoplaybackthroughtheMediaPlayerframework(MediaPlayer.framework).Thisframeworksupportstheplaybackofmoviefileswiththe.mov,.mp4,.m4v,a

ios - 如何通过GCDWebServer在iOS上播放本地M3u8文件

我正在尝试运行本地GCDWebServer来提供我从服务器本地存储的M3U8文件。我解析了文件并将每个.ts文件保存到本地存储。现在我正在尝试通过本地Web服务器提供该文件,但我无法使用MPMoviePlayerController或AVPlayerViewController播放该文件。这是我的服务器代码:webServer=[[GCDWebServeralloc]init];[webServeraddDefaultHandlerForMethod:@"GET"requestClass:[GCDWebServerRequestclass]processBlock:^GCDWebSer

ios - Avplayer 有时显示黑屏但声音很好

我正在使用AVPlayer和AVPlayerViewController。我在视频中添加水印后正在播放视频。有时工作正常,但有时只显示黑屏,两种情况下音频都正常。vPlayer=[AVPlayerplayerWithURL:_videoFilePath];//createaplayerviewcontrollerAVPlayerViewController*controller=[[AVPlayerViewControlleralloc]init];controller.videoGravity=AVLayerVideoGravityResizeAspect;controller.pl

ios - AVPlayer UITapGestureRecognizer 不工作

我的AVPlayerViewController有这段代码。UITapGestureRecognizer*tap=[[UITapGestureRecognizeralloc]initWithTarget:selfaction:@selector(tapAvPlayer)];[self.avPlayerViewController.viewaddGestureRecognizer:tap];但这不起作用..:S,我试过设置[self.avPlayerViewController.viewsetUserInteractionEnabled:YES];还是不行..唯一可行的解​​决方案是使用

ios - Swift 4 - 尝试在 AVPlayerViewController 中从后端显示 AWS 视频 url 不起作用,出现奇怪的错误

我有一个TableView,它设置一个UIImage来保存来自AWS的图像url或从同样来自AWS的视频URL生成的缩略图。视频url拒绝在我的tableview中显示,并在调试器中抛出此错误。2017-12-2912:20:37.053337-0800VideoFit[3541:1366125]CredStore-performQuery-Errorcopyingmatchingcreds.Error=-25300,query={class=inet;"m_Limit"="m_LimitAll";"r_Attributes"=1;sync=syna;}当我单击单元格以显示图像或视频u

ios - AVI 视频不适用于 AVPlayerViewController

我正在尝试使用播放流视频,AVPlayerViewController,所有其他扩展都可以正常工作“3GPMP4...”,但“.avi”视频以空白屏幕开始。ifletvideoURL=URL(string:"http://techslides.com/demos/samples/sample.avi"){letplayer=AVPlayer(url:videoURL)letplayerViewController=AVPlayerViewController()playerViewController.player=playerself.present(playerViewContro

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

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

ios - 为什么 UIWebView 的 AVPlayerViewController 没有运行在主线程上?

我的UIWebView负责通过提示UIAlertController来下载可下载的内容,如下代码所示:funcwebView(_webView:UIWebView,shouldStartLoadWithrequest:URLRequest,navigationType:UIWebViewNavigationType)->Bool{letnvc=self.tabBarController?.viewControllers?[1]as!UINavigationControllerletdvc=nvc.viewControllers[0]as!RCHDownloadTVCvarisDownl

ios - AVPlayer View Controller 自动旋转关闭?

我正在开发一款仅采用纵向模式的iOS应用,它运行良好。问题是我在navigationController上方显示AVPlayerViewController(均以编程方式创建)。这个播放器支持所有的旋转(我不知道为什么!)。我想将其修复为仅纵向模式,就像应用的其他部分一样。我们怎样才能做到这一点? 最佳答案 创建继承自AVPlayerViewController的新类,并像这样实现支持的接口(interface)方法。在此之后,不是初始化AVPlayerViewController的对象,而是创建您创建的类的对象。classMyPo