CYPlayer基于Objective-C编写,支持RTMP和HTTP协议的播放流,如果需要smb协议,可以自行修改CYFFmpeg兼容samba协议即可。
1.支持动态帧率控制,适配各种性能的机型,最高支持1080p@60fps;
2.动态内存控制,防止老设备crash;
3.支持RTMP和HLS,Master分支暂不支持Samba(CYFFmpeg未优化好);
4.拿来可用,带控制交互界面,可自定义;
5.音频采用Sonic优化,支持倍速播放;
6.解码核心FFmpeg3.4,x264。
Previews
How To Use
vc = [CYFFmpegPlayer movieViewWithContentPath:path parameters:nil];
[vc settingPlayer:^(CYVideoPlayerSettings *settings) {
settings.definitionTypes = CYFFmpegPlayerDefinitionLLD | CYFFmpegPlayerDefinitionLHD | CYFFmpegPlayerDefinitionLSD | CYFFmpegPlayerDefinitionLUD;
settings.enableSelections = YES;
settings.setCurrentSelectionsIndex = ^NSInteger{
return 3;//假设上次播放到了第四节
};
settings.nextAutoPlaySelectionsPath = ^NSString *{
return @"http:/xtoai.com/9f76b359339f4bbc919f35e39e55eed4/efa9514952ef5e242a4dfa4ee98765fb-ld.mp4";
};
settings.useHWDecompressor = YES;
// settings.enableProgressControl = NO;
}];
vc.delegate = self;
vc.autoplay = YES;
vc.generatPreviewImages = YES;
[contentView addSubview:vc.view];
[vc.view mas_makeConstraints:^(MASConstraintMaker *make) {
if (kiPad)
{
make.center.offset(0);
make.leading.trailing.offset(0);
make.height.equalTo(vc.view.mas_width).multipliedBy(9.0 / 16.0);
}
else
{
make.center.offset(0);
make.top.bottom.offset(0);
make.width.equalTo(vc.view.mas_height).multipliedBy(16.0 / 9.0);
}
}];
__weak __typeof(&*self)weakSelf = self;
vc.lockscreen = ^(BOOL isLock) {
if (isLock)
{
[weakSelf lockRotation];
}
else
{
[weakSelf unlockRotation];
}
};
GitHub地址:CYPlayer
|