【m】远端占位背景添加
This commit is contained in:
@@ -15,9 +15,9 @@ const defaultStreamHeight = 720;
|
||||
|
||||
class CallStateManager {
|
||||
constructor() {
|
||||
const renderstreaming=null; // WebRTC连接管理实例
|
||||
const useWebSocket=null; // 是否使用WebSocket信令
|
||||
const connectionId=null; // 连接ID
|
||||
const renderstreaming = null; // WebRTC连接管理实例
|
||||
const useWebSocket = null; // 是否使用WebSocket信令
|
||||
const connectionId = null; // 连接ID
|
||||
// 核心状态
|
||||
this.state = {
|
||||
session: {
|
||||
@@ -194,14 +194,21 @@ class CallStateManager {
|
||||
// 创建信令实例
|
||||
const signaling = this.useWebSocket ? new WebSocketSignaling() : new Signaling();
|
||||
const config = getRTCConfiguration(); // 获取RTC配置
|
||||
// 优化RTC配置,确保支持高分辨率
|
||||
config.peerConnectionOptions = {
|
||||
optional: [
|
||||
{ googCpuOveruseDetection: false }, // 禁用CPU过度使用检测
|
||||
{ googScreencastMinBitrate: 3000 } // 设置最小比特率
|
||||
]
|
||||
};
|
||||
this.renderstreaming = new RenderStreaming(signaling, config); // 创建WebRTC连接管理实例
|
||||
|
||||
// 连接建立回调
|
||||
this.renderstreaming.onConnect = () => {
|
||||
// 连接建立后,更新状态为ongoing
|
||||
this.state.session.status = 'ongoing';
|
||||
this.notify({ type: 'CALL_STATUS_CHANGE', status: 'ongoing' });
|
||||
|
||||
this.state.session.status = 'ongoing';
|
||||
this.notify({ type: 'CALL_STATUS_CHANGE', status: 'ongoing' });
|
||||
|
||||
if (this.state.localStream) {
|
||||
const tracks = this.state.localStream.getTracks(); // 获取本地媒体轨道
|
||||
for (const track of tracks) {
|
||||
|
||||
Reference in New Issue
Block a user