首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >iOS手机上开启直播后,在另外一个手机拉流播放,只有声音没有画面,画面是纯红色的,配置有什么问题吗?

iOS手机上开启直播后,在另外一个手机拉流播放,只有声音没有画面,画面是纯红色的,配置有什么问题吗?

提问于 2020-03-28 16:42:16
回答 0关注 0查看 354

配置是用专业版demo上代码写的

- (TXLivePush *)push

{

if(!_push)

{

// config初始化

TXLivePushConfig *config = [[TXLivePushConfig alloc] init];

config.pauseFps = 5;

config.pauseTime = 300;

config.pauseImg = [UIImage imageNamed:@"activity_pausePublish"];

config.touchFocus = [PushMoreSettingViewController isEnableTouchFocus];

config.enableZoom = [PushMoreSettingViewController isEnableVideoZoom];

config.enablePureAudioPush = [PushMoreSettingViewController isEnablePureAudioPush];

config.enableAudioPreview = [PushSettingViewController getEnableAudioPreview];

config.frontCamera = NO; //前后置摄像头

if ([PushMoreSettingViewController isEnableWaterMark]) {

config.watermark = [UIImage imageNamed:@"activity_watermark"];

config.watermarkPos = CGPointMake(10, 10);

}

_push = [[TXLivePush alloc] initWithConfig:config];

[_push setReverbType:[PushSettingViewController getReverbType]];

[_push setVoiceChangerType:[PushSettingViewController getVoiceChangerType]];

[_push toggleTorch:[PushMoreSettingViewController isOpenTorch]];

[_push setMirror:[PushMoreSettingViewController isMirrorVideo]];

[_push setMute:[PushMoreSettingViewController isMuteAudio]];

[_push setVideoQuality:[PushSettingViewController getVideoQuality] adjustBitrate:[PushSettingViewController getBandWidthAdjust] adjustResolution:NO];

// 修改软硬编需要在setVideoQuality之后设置config.enableHWAcceleration

config.enableHWAcceleration = [PushSettingViewController getEnableHWAcceleration];

// 横屏推流需要先设置config.homeOrientation = HOME_ORIENTATION_RIGHT,然后再[pusher setRenderRotation:90]

config.homeOrientation = ([PushMoreSettingViewController isHorizontalPush] ? HOME_ORIENTATION_RIGHT : HOME_ORIENTATION_DOWN);

if ([PushMoreSettingViewController isHorizontalPush]) {

[_push setRenderRotation:90];

} else {

[_push setRenderRotation:0];

}

[_push setLogViewMargin:UIEdgeInsetsMake(120, 10, 60, 10)];

[_push showVideoDebugLog:[PushMoreSettingViewController isShowDebugLog]];

[_push setEnableClockOverlay:[PushMoreSettingViewController isEnableDelayCheck]];

[_push setConfig:config];

}

return _push;

}

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档