大佬教程收集整理的这篇文章主要介绍了ios – AVPlayer全屏,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
AVURLAsset *avasset = [[AVURLAsset alloc] initWithURL:URL1 options:nil]; AVPlayerItem *item = [[AVPlayerItem alloc] initWithAsset:avasset]; player = [[[AVPlayer alloc] initWithPlayerItem:item]retain]; playerLayer = [AVPlayerLayer playerLayerWithPlayer:player]; CGSize size = self.view.bounds.size; float x = size.width/2.0-187.0; float y = size.height/2.0 - 125.0; playerLayer.frame = CGRectMake(x,y,474,320); [playerLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill]; [self.view.layer addSublayer:playerLayer]; [player play];
对于play
和pause
,AVPlayer中有直接的API.
对于全屏……嗯……你知道你在哪里画画:你只需要调整你的UIWindow和相应的UIView&图层为全尺寸.
对于搜索,你有像seekToTime:
这样的方法
以上是大佬教程为你收集整理的ios – AVPlayer全屏全部内容,希望文章能够帮你解决ios – AVPlayer全屏所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。