| 类名 | 类描述 |
|---|---|
| VHallLivePublish | 直播发起类 |
| VHRoom | 互动直播类 |
| VHallRehearsalObject | 彩排类 |
| 方法 | 方法描述 |
|---|---|
| isRehearsal | 是否彩排 YES:彩排模式开播 NO:正常直播 (默认 NO,开播前设置有效) |
| 所属类 | 属性 | 属性描述 |
|---|---|---|
| VHRoomInfo | live_type | 0-直播;2-彩排 |
| 方法 | 方法描述 |
|---|---|
| didToStartRehearsal | 开始彩排 |
| didToStopRehearsal | 结束彩排 |
@property (strong, nonatomic) VHallLivePublish *engine;
// 初始化
self.engine = [[VHallLivePublish alloc] init];
self.engine.liveView.frame = _perView.bounds;
// 设置为彩排直播
self.engine.isRehearsal = YES;
// 开始直播
NSMutableDictionary * publishParam = [[NSMutableDictionary alloc]init];
publishParam[@"id"] = xxxxxx;
[self.engine startLive:publishParam];/** 互动SDK */
@property (nonatomic, strong) VHRoom *inavRoom;
// 初始化
self.inavRoom = [[VHRoom alloc] init];
//设置代理
self.inavRoom.delegate = self;
// 设置为彩排互动
self.inavRoom.isRehearsal = YES;
// 开始直播
[self.inavRoom hostEnterRoomStartWithParams:self.params success:^(VHRoomInfo *roomInfo) {} fail:^(NSError *error) {}];
#pragma mark - VHRoomDelegate
// 房间连接成功回调
- (void)room:(VHRoom *)room didConnect:(NSDictionary *)roomMetadata {
//开始推流
[self.inavRoom publishWithCameraView:self.localRenderView];
}
#pragma mark - 懒加载
- (VHLocalRenderView *)localRenderView
{
if (!_localRenderView) {
_localRenderView = [[VHLocalRenderView alloc] initCameraViewWithFrame:self.view.bounds];
}
return _localRenderView;
}- (void)didToStartRehearsal;- (void)didToStopRehearsal;