1 line
86 KiB
Plaintext
1 line
86 KiB
Plaintext
|
{"version":3,"names":["AgoraRtcChannelModule","uni","requireNativePlugin","Prefix","RtcChannelEvent","channels","Map","RtcChannel","constructor","channelId","_defineProperty","_callMethod","method","args","Promise","resolve","reject","callMethod","res","code","create","get","set","destroyAll","forEach","value","removeAllListeners","clear","destroy","delete","addListener","event","listener","callback","data","map","_listeners","undefined","addEventListener","remove","removeListener","removeEventListener","_","key","removeAllEventListeners","setClientRole","role","options","joinChannel","token","optionalInfo","optionalUid","joinChannelWithUserAccount","userAccount","leaveChannel","renewToken","getConnectionState","publish","unpublish","getCallId","adjustUserPlaybackSignalVolume","uid","volume","muteRemoteAudioStream","muted","muteAllRemoteAudioStreams","setDefaultMuteAllRemoteAudioStreams","muteAllRemoteVideoStreams","muteRemoteVideoStream","setDefaultMuteAllRemoteVideoStreams","enableRemoteSuperResolution","enabled","setRemoteVoicePosition","pan","gain","addPublishStreamUrl","url","transcodingEnabled","removePublishStreamUrl","setLiveTranscoding","transcoding","startChannelMediaRelay","channelMediaRelayConfiguration","stopChannelMediaRelay","updateChannelMediaRelay","setRemoteDefaultVideoStreamType","streamType","setRemoteVideoStreamType","setRemoteUserPriority","userPriority","registerMediaMetadataObserver","sendMetadata","metadata","setMaxMetadataSize","size","unregisterMediaMetadataObserver","enableEncryption","config","setEncryptionMode","encryptionMode","setEncryptionSecret","secret","addInjectStreamUrl","removeInjectStreamUrl","createDataStream","reliable","ordered","createDataStreamWithConfig","sendStreamMessage","streamId","message","muteLocalAudioStream","muteLocalVideoStream","pauseAllChannelMediaRelay","resumeAllChannelMediaRelay","setAVSyncSource","startRtmpStreamWithTranscoding","startRtmpStreamWithoutTranscoding","stopRtmpStream","updateRtmpTranscoding","exports","default"],"sources":["RtcChannel.native.ts"],"sourcesContent":["import type {\r\n ChannelMediaOptions,\r\n ChannelMediaRelayConfiguration,\r\n ClientRoleOptions,\r\n DataStreamConfig,\r\n EncryptionConfig,\r\n LiveInjectStreamConfig,\r\n LiveTranscoding,\r\n} from './Classes';\r\nimport type {\r\n ClientRole,\r\n ConnectionStateType,\r\n EncryptionMode,\r\n UserPriority,\r\n VideoStreamType,\r\n} from './Enums';\r\nimport type { Listener, RtcChannelEvents, Subscription } from './RtcEvents';\r\n\r\n/**\r\n * @ignore\r\n */\r\n// @ts-ignore\r\nconst AgoraRtcChannelModule: {\r\n callMethod: (params: {}, callback: (res: any) => void) => void;\r\n} = uni.requireNativePlugin('Agora-RTC-ChannelModule');\r\n/**\r\n * @ignore\r\n */\r\nconst Prefix = 'io.agora.rtc.';\r\n/**\r\n * @ignore\r\n */\r\n// @ts-ignore\r\nconst RtcChannelEvent: {\r\n addEventListener: (event: string, callback: Function) => void;\r\n removeEventListener: (event: string, callback: Function) => void;\r\n removeAllEventListeners: (event: string) => void;\r\n} = uni.requireNativePlugin('globalEvent');\r\n\r\n/**\r\n * @ignore\r\n */\r\nconst channels = new Map<string, RtcChannel>();\r\n\r\n/**\r\n * The {@link RtcChannel} class.\r\n */\r\nexport default class RtcChannel implements RtcChannelInterface {\r\n /**\r\n * The ID of RtcChannel\r\n */\r\n public readonly channelId: string;\r\n /**\r\n * @ignore\r\n */\r\n private _listeners = new Map<string, Map<any, Listener>>();\r\n\r\n /**\r\n * @ignore\r\n */\r\n private constructor(channelId: string) {\r\n this.channelId = channelId;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n private _callMethod<T>(method: string, args?: {}): Promise<T> {\r\n return new Promise((resolve, reject) => {\r\n AgoraRtcChannelModule.callMethod(\r\n { method: method, args: { channelId: this.channelId, ...args } },\r\n (res) => {\r\n if (res && res.code) {\r\n reject(res);\r\n } else {\r\n resolve(res);\r\n }\r\n }\r\n );\r\n });\r\n }
|