文档

摄像头视频流

更新时间:

本文介绍连麦中摄像头视频流相关的配置。

说明

  • 部分API只有部分端可以使用。

获取当前设备可用分辨率API使用示例

Web端(JavaScript):

// 获取当前设备可用分辨率
rtcService.getCurrentDeviceAvailableResolutions().then(resolutions => {})

获取可支持的分辨率的数组信息API使用示例

Web端(JavaScript):

// 获取可支持的分辨率的数组信息
rtcService.getAvailableResolutions().then(resolutions => {})

设置摄像头的帧率和分辨率API使用示例

iOS端(Objective-C):

暂不支持修改帧率。

// 设置高分辨率视频流(大流)的编码分辨率,默认为640x480
id<AIRBRoomChannelProtocol> room = [[AIRBRoomEngine sharedInstance] getRoomChannelWithRoomID:@"xxx"]
AIRBRTCConfig* config = [[AIRBRTCConfig alloc] init];
config.videoStreamTypeHighDimensions = CGSizeMake(1280, 720);
[room.rtc setConfig:config];

Android端(Java):

// join RTC时设置分辨率
rtcService.joinRtcWithConfig(new RtcStreamConfig(width, height), nick);

/**
 * RTC配置类
 * videoStreamTypeHeightWidth 大流视频宽度,默认640
 * videoStreamTypeHeightHeight 大流视频高度,默认480
 * videoStreamTypeLowPublished 是否开启同时推低分辨率(小流),默认开启。小流无法修改分辨率
 */

设置推送低分辨率视频流(小流)API使用示例

iOS端(Objective-C):

// 是否同时推送低分辨率视频流(小流),默认开启(小流的分辨率无法修改)
id<AIRBRoomChannelProtocol> room = [[AIRBRoomEngine sharedInstance] getRoomChannelWithRoomID:@"xxx"]
AIRBRTCConfig* config = [[AIRBRTCConfig alloc] init];
config.videoStreamTypeLowPublished = NO;
[room.rtc setConfig:config];

Android端(Java):

// join RTC时设置分辨率
rtcService.joinRtcWithConfig(new RtcStreamConfig(width, height, false), nick);

// RtcStreamConfig.videoStreamTypeLowPublished
// videoStreamTypeLowPublished 是否开启同时推低分辨率(小流),默认开启。小流无法修改分辨率
  • 本页导读 (1)
文档反馈