UNPKG

@rongcloud/plugin-wechat-rtc

Version:

@rongcloud/plugin-wechat-rtc

46 lines 1.73 kB
import { RCRTCCode } from '../enums/RCRTCCode'; import { ISubParams } from '../interfaces'; import { RCRemoteStream } from '../RCRemoteStream'; import { BaseCommand } from './BaseCommand'; import { RCCommandKind } from '../enums/RCCommandKind'; import { CommandExecuteContext } from './CommandExecuteContext'; export default class SubscribeCommand extends BaseCommand { /** * 本次传入的订阅参数 * 需和 store 中的已订阅参数做合并,增量订阅 */ private readonly _subParams; private readonly _forceSub; /** * 存储传入的参数,转化为 ISubParams 格式的数据 */ private _transSubParams; constructor( /** * 本次传入的订阅参数 * 需和 store 中的已订阅参数做合并,增量订阅 */ _subParams: (ISubParams | RCRemoteStream)[], _forceSub?: boolean); get kind(): RCCommandKind; /** * 依据 store 存储的已订阅参数,过滤重复订阅资源 * @returns 返回本次新订阅的资源列表和剩余不需要重新订阅的资源列表 */ private _filterNewSubParams; /** * 更新 store 中存储的已订阅 params、已订阅 streama、远端 stream 数据 * @param rtmpSubscribeList 服务返回的含订阅资源 rtmp 地址的数据列表 * @param totalSubParams 订阅的所有参数 */ private _updateStoreData; /** * 发 exchange 请求订阅资源 * @param exchangeSubParams 需要和 mediaServer 交互的订阅参数 * @returns 返回请求响应结果 */ private _exchange; execute(ctx: CommandExecuteContext): Promise<{ code: RCRTCCode; }>; } //# sourceMappingURL=SubscribeCommand.d.ts.map