Created
November 5, 2014 03:17
-
-
Save jebai0521/d368a31706d92f0bbbd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 方法1 | |
| 1. 构造AVURLAsset | |
| 2. 请求key | |
| 3. 准备播放--检查请求结果 | |
| 4. 准备播放--检查可否播放 | |
| 5. 准备播放--预处理 AVPlayerItem | |
| 6. 准备播放--初始化 AVPlayerItem | |
| 7. 准备播放--预处理 AVPlayer | |
| 8. 准备播放--替换 AVPlayer 的 AVPlayerItem | |
| 方法2 | |
| 1. 用nsurl 生成 AVPlayerItem | |
| AVPlayerItem *playerItem = [AVPlayerItemplayerItemWithURL:url]; | |
| 2. 添加播放状态监听 | |
| [playerItem addObserver:self | |
| forKeyPath:@"status" | |
| options:NSKeyValueObservingOptionNew | |
| context:nil]; | |
| [playerItem addObserver:self | |
| forKeyPath:@"playbackBufferEmpty" | |
| options:NSKeyValueObservingOptionNew | |
| context:nil]; | |
| [playerItem addObserver:self | |
| forKeyPath:@"playbackLikelyToKeepUp" | |
| options:NSKeyValueObservingOptionNew | |
| context:nil]; | |
| [playerItem addObserver:self | |
| forKeyPath:@"loadedTimeRanges" | |
| options:NSKeyValueObservingOptionNew | |
| context:nil]; | |
| 相关的监控 | |
| 相关的状态 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment