发起视频直播
关键步骤
1.
2.
3.
4.
基础属性
属性 | 属性描述 |
---|---|
delegate | 代理 |
displayView | 用来显示摄像头拍摄内容的 View |
isMute | 设置静音,开始直播后设置有效 |
captureDevicePosition | 获取用户使用是前置还是后置摄像头 |
isPublishing | 获取当前推流状态 |
VHPublishConfig | 推流配置参数 |
关键方法
方法 | 方法描述 |
---|---|
initWithConfig | 初始化 |
startVideoCapture | 开始视频采集 |
stopVideoCapture | 停止视频采集 |
startLive | 开始发起直播 |
stopLive | 结束直播 |
disconnect | 断开推流的连接 |
reconnect | 重连流 |
swapCameras | 切换摄像头 |
setFoucsFoint | 手动对焦 |
captureDeviceZoom | 变焦 |
setDeviceTorchModel | 设置闪关灯的模式 |
setVolumeAmplificateSize | 设置音频增益大小 |
setContentMode | 修改本地相机预览填充模式 |
camVidMirror | 镜像摄像头 |
destoryObject | 销毁初始化数据 |
VHallLivePublishDelegate 代理方法
方法 | 方法描述 |
---|---|
publishStatus | 发起直播时的状态 |
firstCaptureImage | 采集到第一帧的回调 |
webinarInfo | 活动相关信息回调 |
初始化
- (instancetype)initWithConfig:(VHPublishConfig*)config;
参数名称 | 是否必须 | 示例 | 备注 |
---|---|---|---|
config | 是 | VHPublishConfig | 具体包含的参数参考地址 |
// 直播推流配置信息
VHPublishConfig* config = [VHPublishConfig configWithType:VHPublishConfigTypeDefault];
config.pushType = VHStreamTypeVideoAndAudio; // 默认视频直播
// 初始化
VHallLivePublish * livePublish = [[VHallLivePublish alloc] initWithConfig:config];
[livePublish startVideoCapture];