AVPlayerViewController 通过AirPaly

2016-12-29  本文已影响1072人  LeLeBa

引入系统框架

import <AVFoundation/AVFoundation.h>

import <AVKit/AVKit.h>

import <MediaPlayer/MediaPlayer.h>

//声明相关属性
@property (strong,nonatomic) AVPlayerViewController *playVC;
@property (strong,nonatomic) AVPlayer *player;
@property (strong,nonatomic) AVPlayerItem *item;

//播放视频代码

}

//如果想在iPhone锁屏的时候,AirPlay设备继续播放,还需在Info.plist设置App的后台模式支持AirPlay。
Required background modes 里面添加 App plays audio or streams audio/video using AirPlay!

上一篇 下一篇

猜你喜欢

热点阅读