Demo地址 包含了下载缓存本地都集成在一个class文件中
WJMoviePlayerView是基于AVPlayerLayer来实现的,选择AVPlayerLayer的原因是因为AVPlayerViewController有个黑色的背景view,影响到转场动画。AVPlayerLayer并不是直接添加到UIView上的,因为CALayer自带隐式动画,在下滑关闭视频的时候会出现问题(放在UIView animateWithDuration: 中关闭隐式动画会失效,当然你也可以把AVPlayerLayer单独拿到动画外面来解决问题,但是动画时间必须和隐式动画时间一致)。我这边是写了一个继承UIView的WJPlayerView类,然后重写了它的layerClass来实现的。
重要的一块就是下拉播放器时的缩小和放大
仿微博的进度条 WJProgressView
WJMoviePlayerView的使用方法很简单
WJMoviePlayerView *playerView = [[ WJMoviePlayerView alloc ] init ];
playerView. movieURL = [ NSURL URLWithString : @"URL" ];//对应的url
playerView. coverView = view;//imageView
[playerView show ];
其中还有许多需要完善的地方,也存在bug,欢迎下载并提出意见,随便帮在下在git上点个星星,谢谢。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Web Caching
Duane Wessels / O'Reilly Media, Inc. / 2001-6 / 39.95美元
On the World Wide Web, speed and efficiency are vital. Users have little patience for slow web pages, while network administrators want to make the most of their available bandwidth. A properly design......一起来看看 《Web Caching》 这本书的介绍吧!