From 223137370d085d07b520496403e242e24be12eaa Mon Sep 17 00:00:00 2001 From: EkaanshArora Date: Thu, 16 Sep 2021 00:55:23 +0530 Subject: [PATCH] update build --- dist/index.d.ts | 88 ++++++++++++++++++++++++++++++++- dist/index.js | 104 +++++++++++++++++++++++++++++---------- dist/index.js.map | 2 +- dist/index.modern.js | 104 +++++++++++++++++++++++++++++---------- dist/index.modern.js.map | 2 +- package-lock.json | 2 +- 6 files changed, 244 insertions(+), 58 deletions(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index 0010cac..33da7e9 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,36 +1,122 @@ import React from 'react'; -import AgoraRTC, { BufferSourceAudioTrackInitConfig, CameraVideoTrackInitConfig, ClientConfig, CustomAudioTrackInitConfig, CustomVideoTrackInitConfig, IAgoraRTCClient, IBufferSourceAudioTrack, ICameraVideoTrack, ILocalAudioTrack, ILocalVideoTrack, IMicrophoneAudioTrack, IRemoteVideoTrack, MicrophoneAudioTrackInitConfig, ScreenVideoTrackInitConfig } from 'agora-rtc-sdk-ng'; +import AgoraRTC, { BufferSourceAudioTrackInitConfig, CameraVideoTrackInitConfig, ClientConfig, CustomAudioTrackInitConfig, CustomVideoTrackInitConfig, IAgoraRTCClient, IBufferSourceAudioTrack, ICameraVideoTrack, ILocalAudioTrack, ILocalVideoTrack, IMicrophoneAudioTrack, IRemoteVideoTrack, MicrophoneAudioTrackInitConfig, ScreenVideoTrackInitConfig, VideoPlayerConfig } from 'agora-rtc-sdk-ng'; export default AgoraRTC; export * from 'agora-rtc-sdk-ng'; +export interface AgoraRTCError { + code: AgoraRTCErrorCode; + message: string; + data?: any; + name: string; +} +export declare enum AgoraRTCErrorCode { + UNEXPECTED_ERROR = "UNEXPECTED_ERROR", + UNEXPECTED_RESPONSE = "UNEXPECTED_RESPONSE", + TIMEOUT = "TIMEOUT", + INVALID_PARAMS = "INVALID_PARAMS", + NOT_SUPPORTED = "NOT_SUPPORTED", + INVALID_OPERATION = "INVALID_OPERATION", + OPERATION_ABORTED = "OPERATION_ABORTED", + WEB_SECURITY_RESTRICT = "WEB_SECURITY_RESTRICT", + NETWORK_ERROR = "NETWORK_ERROR", + NETWORK_TIMEOUT = "NETWORK_TIMEOUT", + NETWORK_RESPONSE_ERROR = "NETWORK_RESPONSE_ERROR", + API_INVOKE_TIMEOUT = "API_INVOKE_TIMEOUT", + ENUMERATE_DEVICES_FAILED = "ENUMERATE_DEVICES_FAILED", + DEVICE_NOT_FOUND = "DEVICE_NOT_FOUND", + ELECTRON_IS_NULL = "ELECTRON_IS_NULL", + ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR = "ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR", + CHROME_PLUGIN_NO_RESPONSE = "CHROME_PLUGIN_NO_RESPONSE", + CHROME_PLUGIN_NOT_INSTALL = "CHROME_PLUGIN_NOT_INSTALL", + MEDIA_OPTION_INVALID = "MEDIA_OPTION_INVALID", + PERMISSION_DENIED = "PERMISSION_DENIED", + CONSTRAINT_NOT_SATISFIED = "CONSTRAINT_NOT_SATISFIED", + TRACK_IS_DISABLED = "TRACK_IS_DISABLED", + SHARE_AUDIO_NOT_ALLOWED = "SHARE_AUDIO_NOT_ALLOWED", + LOW_STREAM_ENCODING_ERROR = "LOW_STREAM_ENCODING_ERROR", + INVALID_UINT_UID_FROM_STRING_UID = "INVALID_UINT_UID_FROM_STRING_UID", + CAN_NOT_GET_PROXY_SERVER = "CAN_NOT_GET_PROXY_SERVER", + CAN_NOT_GET_GATEWAY_SERVER = "CAN_NOT_GET_GATEWAY_SERVER", + VOID_GATEWAY_ADDRESS = "VOID_GATEWAY_ADDRESS", + UID_CONFLICT = "UID_CONFLICT", + INVALID_LOCAL_TRACK = "INVALID_LOCAL_TRACK", + INVALID_TRACK = "INVALID_TRACK", + SENDER_NOT_FOUND = "SENDER_NOT_FOUND", + CREATE_OFFER_FAILED = "CREATE_OFFER_FAILED", + SET_ANSWER_FAILED = "SET_ANSWER_FAILED", + ICE_FAILED = "ICE_FAILED", + PC_CLOSED = "PC_CLOSED", + SENDER_REPLACE_FAILED = "SENDER_REPLACE_FAILED", + GATEWAY_P2P_LOST = "GATEWAY_P2P_LOST", + NO_ICE_CANDIDATE = "NO_ICE_CANDIDATE", + CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS = "CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS", + EXIST_DISABLED_VIDEO_TRACK = "EXIST_DISABLED_VIDEO_TRACK", + INVALID_REMOTE_USER = "INVALID_REMOTE_USER", + REMOTE_USER_IS_NOT_PUBLISHED = "REMOTE_USER_IS_NOT_PUBLISHED", + CUSTOM_REPORT_SEND_FAILED = "CUSTOM_REPORT_SEND_FAILED", + CUSTOM_REPORT_FREQUENCY_TOO_HIGH = "CUSTOM_REPORT_FREQUENCY_TOO_HIGH", + FETCH_AUDIO_FILE_FAILED = "FETCH_AUDIO_FILE_FAILED", + READ_LOCAL_AUDIO_FILE_ERROR = "READ_LOCAL_AUDIO_FILE_ERROR", + DECODE_AUDIO_FILE_FAILED = "DECODE_AUDIO_FILE_FAILED", + WS_ABORT = "WS_ABORT", + WS_DISCONNECT = "WS_DISCONNECT", + WS_ERR = "WS_ERR", + LIVE_STREAMING_TASK_CONFLICT = "LIVE_STREAMING_TASK_CONFLICT", + LIVE_STREAMING_INVALID_ARGUMENT = "LIVE_STREAMING_INVALID_ARGUMENT", + LIVE_STREAMING_INTERNAL_SERVER_ERROR = "LIVE_STREAMING_INTERNAL_SERVER_ERROR", + LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED = "LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED", + LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED = "LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED", + LIVE_STREAMING_CDN_ERROR = "LIVE_STREAMING_CDN_ERROR", + LIVE_STREAMING_INVALID_RAW_STREAM = "LIVE_STREAMING_INVALID_RAW_STREAM", + LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT = "LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT", + LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE = "LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE", + LIVE_STREAMING_WARN_FREQUENT_REQUEST = "LIVE_STREAMING_WARN_FREQUENT_REQUEST", + WEBGL_INTERNAL_ERROR = "WEBGL_INTERNAL_ERROR", + BEAUTY_PROCESSOR_INTERNAL_ERROR = "BEAUTY_PROCESSOR_INTERNAL_ERROR", + CROSS_CHANNEL_WAIT_STATUS_ERROR = "CROSS_CHANNEL_WAIT_STATUS_ERROR", + CROSS_CHANNEL_FAILED_JOIN_SRC = "CROSS_CHANNEL_FAILED_JOIN_SEC", + CROSS_CHANNEL_FAILED_JOIN_DEST = "CROSS_CHANNEL_FAILED_JOIN_DEST", + CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST = "CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST", + CROSS_CHANNEL_SERVER_ERROR_RESPONSE = "CROSS_CHANNEL_SERVER_ERROR_RESPONSE", + METADATA_OUT_OF_RANGE = "METADATA_OUT_OF_RANGE" +} export declare const createClient: (config: ClientConfig) => () => IAgoraRTCClient; export declare function createMicrophoneAndCameraTracks(audioConfig?: MicrophoneAudioTrackInitConfig | undefined, videoConfig?: CameraVideoTrackInitConfig | undefined): () => { ready: boolean; tracks: [IMicrophoneAudioTrack, ICameraVideoTrack] | null; + error: AgoraRTCError | null; }; export declare function createBufferSourceAudioTrack(config: BufferSourceAudioTrackInitConfig): () => { ready: boolean; track: IBufferSourceAudioTrack | null; + error: AgoraRTCError | null; }; export declare function createCameraVideoTrack(config?: CameraVideoTrackInitConfig): () => { ready: boolean; track: ICameraVideoTrack | null; + error: AgoraRTCError | null; }; export declare function createCustomAudioTrack(config: CustomAudioTrackInitConfig): () => { ready: boolean; track: ILocalAudioTrack | null; + error: AgoraRTCError | null; }; export declare function createCustomVideoTrack(config: CustomVideoTrackInitConfig): () => { ready: boolean; track: ILocalVideoTrack | null; + error: AgoraRTCError | null; }; export declare function createMicrophoneAudioTrack(config?: MicrophoneAudioTrackInitConfig): () => { ready: boolean; track: IMicrophoneAudioTrack | null; + error: AgoraRTCError | null; }; export declare function createScreenVideoTrack(config: ScreenVideoTrackInitConfig, withAudio?: 'enable' | 'disable' | 'auto'): () => { ready: boolean; tracks: ILocalVideoTrack | [ILocalVideoTrack, ILocalAudioTrack]; + error: AgoraRTCError | null; }; export declare const AgoraVideoPlayer: (props: React.DetailedHTMLProps, HTMLDivElement> & { videoTrack: ILocalVideoTrack | IRemoteVideoTrack | ICameraVideoTrack; +} & { + config?: VideoPlayerConfig; }) => JSX.Element; diff --git a/dist/index.js b/dist/index.js index 3cf6110..53ecbe2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -53,12 +53,18 @@ function createMicrophoneAndCameraTracks(audioConfig, videoConfig) { ready = _useState[0], setReady = _useState[1]; + var _useState2 = React.useState(null), + agoraRTCError = _useState2[0], + setAgoraRTCError = _useState2[1]; + var ref = React.useRef(tracks); React.useEffect(function () { if (ref.current === null) { createClosure().then(function (tracks) { ref.current = tracks; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -70,7 +76,8 @@ function createMicrophoneAndCameraTracks(audioConfig, videoConfig) { }, []); return { ready: ready, - tracks: ref.current + tracks: ref.current, + error: agoraRTCError }; }; } @@ -88,9 +95,13 @@ function createBufferSourceAudioTrack(config) { var track = null; return function useBufferSourceAudioTrack() { - var _useState2 = React.useState(false), - ready = _useState2[0], - setReady = _useState2[1]; + var _useState3 = React.useState(false), + ready = _useState3[0], + setReady = _useState3[1]; + + var _useState4 = React.useState(null), + agoraRTCError = _useState4[0], + setAgoraRTCError = _useState4[1]; var ref = React.useRef(track); React.useEffect(function () { @@ -98,6 +109,8 @@ function createBufferSourceAudioTrack(config) { createClosure().then(function (track) { ref.current = track; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -109,7 +122,8 @@ function createBufferSourceAudioTrack(config) { }, []); return { ready: ready, - track: ref.current + track: ref.current, + error: agoraRTCError }; }; } @@ -127,9 +141,13 @@ function createCameraVideoTrack(config) { var track = null; return function useCameraVideoTrack() { - var _useState3 = React.useState(false), - ready = _useState3[0], - setReady = _useState3[1]; + var _useState5 = React.useState(false), + ready = _useState5[0], + setReady = _useState5[1]; + + var _useState6 = React.useState(null), + agoraRTCError = _useState6[0], + setAgoraRTCError = _useState6[1]; var ref = React.useRef(track); React.useEffect(function () { @@ -137,6 +155,8 @@ function createCameraVideoTrack(config) { createClosure().then(function (track) { ref.current = track; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -148,7 +168,8 @@ function createCameraVideoTrack(config) { }, []); return { ready: ready, - track: ref.current + track: ref.current, + error: agoraRTCError }; }; } @@ -166,9 +187,13 @@ function createCustomAudioTrack(config) { var track = null; return function useCustomAudioTrack() { - var _useState4 = React.useState(false), - ready = _useState4[0], - setReady = _useState4[1]; + var _useState7 = React.useState(false), + ready = _useState7[0], + setReady = _useState7[1]; + + var _useState8 = React.useState(null), + agoraRTCError = _useState8[0], + setAgoraRTCError = _useState8[1]; var ref = React.useRef(track); React.useEffect(function () { @@ -176,6 +201,8 @@ function createCustomAudioTrack(config) { createClosure().then(function (track) { ref.current = track; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -187,7 +214,8 @@ function createCustomAudioTrack(config) { }, []); return { ready: ready, - track: ref.current + track: ref.current, + error: agoraRTCError }; }; } @@ -205,9 +233,13 @@ function createCustomVideoTrack(config) { var track = null; return function useCustomVideoTrack() { - var _useState5 = React.useState(false), - ready = _useState5[0], - setReady = _useState5[1]; + var _useState9 = React.useState(false), + ready = _useState9[0], + setReady = _useState9[1]; + + var _useState10 = React.useState(null), + agoraRTCError = _useState10[0], + setAgoraRTCError = _useState10[1]; var ref = React.useRef(track); React.useEffect(function () { @@ -215,6 +247,8 @@ function createCustomVideoTrack(config) { createClosure().then(function (track) { ref.current = track; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -226,7 +260,8 @@ function createCustomVideoTrack(config) { }, []); return { ready: ready, - track: ref.current + track: ref.current, + error: agoraRTCError }; }; } @@ -244,9 +279,13 @@ function createMicrophoneAudioTrack(config) { var track = null; return function useMicrophoneAudioTrack() { - var _useState6 = React.useState(false), - ready = _useState6[0], - setReady = _useState6[1]; + var _useState11 = React.useState(false), + ready = _useState11[0], + setReady = _useState11[1]; + + var _useState12 = React.useState(null), + agoraRTCError = _useState12[0], + setAgoraRTCError = _useState12[1]; var ref = React.useRef(track); React.useEffect(function () { @@ -254,6 +293,8 @@ function createMicrophoneAudioTrack(config) { createClosure().then(function (track) { ref.current = track; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -265,7 +306,8 @@ function createMicrophoneAudioTrack(config) { }, []); return { ready: ready, - track: ref.current + track: ref.current, + error: agoraRTCError }; }; } @@ -283,9 +325,13 @@ function createScreenVideoTrack(config, withAudio) { var tracks; return function useScreenVideoTrack() { - var _useState7 = React.useState(false), - ready = _useState7[0], - setReady = _useState7[1]; + var _useState13 = React.useState(false), + ready = _useState13[0], + setReady = _useState13[1]; + + var _useState14 = React.useState(null), + agoraRTCError = _useState14[0], + setAgoraRTCError = _useState14[1]; var ref = React.useRef(tracks); React.useEffect(function () { @@ -293,6 +339,8 @@ function createScreenVideoTrack(config, withAudio) { createClosure().then(function (tracks) { ref.current = tracks; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -300,7 +348,8 @@ function createScreenVideoTrack(config, withAudio) { }, []); return { ready: ready, - tracks: ref.current + tracks: ref.current, + error: agoraRTCError }; }; } @@ -308,10 +357,11 @@ var AgoraVideoPlayer = function AgoraVideoPlayer(props) { var vidDiv = React.useRef(null); var videoTrack = props.videoTrack, - other = _objectWithoutPropertiesLoose(props, ["videoTrack"]); + config = props.config, + other = _objectWithoutPropertiesLoose(props, ["videoTrack", "config"]); React.useEffect(function () { - if (vidDiv.current !== null) videoTrack.play(vidDiv.current); + if (vidDiv.current !== null) videoTrack.play(vidDiv.current, config); return function () { videoTrack.stop(); }; diff --git a/dist/index.js.map b/dist/index.js.map index 40f0623..2670394 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { RefObject, useEffect, useRef, useState } from 'react'\nimport AgoraRTC, {\n BufferSourceAudioTrackInitConfig,\n CameraVideoTrackInitConfig,\n ClientConfig,\n CustomAudioTrackInitConfig,\n CustomVideoTrackInitConfig,\n IAgoraRTCClient,\n IBufferSourceAudioTrack,\n ICameraVideoTrack,\n ILocalAudioTrack,\n ILocalVideoTrack,\n IMicrophoneAudioTrack,\n IRemoteVideoTrack,\n MicrophoneAudioTrackInitConfig,\n ScreenVideoTrackInitConfig\n} from 'agora-rtc-sdk-ng'\n\nexport default AgoraRTC;\nexport * from 'agora-rtc-sdk-ng';\n\nexport const createClient = (config: ClientConfig) => {\n let client: IAgoraRTCClient\n function createClosure() {\n if (!client) {\n client = AgoraRTC.createClient(config)\n }\n return client\n }\n return () => createClosure()\n}\n\nexport function createMicrophoneAndCameraTracks(\n audioConfig?: MicrophoneAudioTrackInitConfig | undefined,\n videoConfig?: CameraVideoTrackInitConfig | undefined\n) {\n let tracks: [IMicrophoneAudioTrack, ICameraVideoTrack] | null = null\n async function createClosure() {\n tracks = await AgoraRTC.createMicrophoneAndCameraTracks(\n audioConfig,\n videoConfig\n )\n return tracks\n }\n return function useMicrophoneAndCameraTracks() {\n const [ready, setReady] = useState(false)\n const ref = useRef(tracks)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((tracks) => {\n ref.current = tracks\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n tracks = null\n }\n }, [])\n return { ready, tracks: ref.current }\n }\n}\n\nexport function createBufferSourceAudioTrack(\n config: BufferSourceAudioTrackInitConfig\n) {\n let track: IBufferSourceAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createBufferSourceAudioTrack(config)\n return track\n }\n return function useBufferSourceAudioTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current }\n }\n}\n\nexport function createCameraVideoTrack(config?: CameraVideoTrackInitConfig) {\n let track: ICameraVideoTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCameraVideoTrack(config)\n return track\n }\n return function useCameraVideoTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current }\n }\n}\n\nexport function createCustomAudioTrack(config: CustomAudioTrackInitConfig) {\n let track: ILocalAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCustomAudioTrack(config)\n return track\n }\n return function useCustomAudioTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current }\n }\n}\n\nexport function createCustomVideoTrack(config: CustomVideoTrackInitConfig) {\n let track: ILocalVideoTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCustomVideoTrack(config)\n return track\n }\n return function useCustomVideoTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current }\n }\n}\n\nexport function createMicrophoneAudioTrack(\n config?: MicrophoneAudioTrackInitConfig\n) {\n let track: IMicrophoneAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createMicrophoneAudioTrack(config)\n return track\n }\n return function useMicrophoneAudioTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current }\n }\n}\n\nexport function createScreenVideoTrack(\n config: ScreenVideoTrackInitConfig,\n withAudio?: 'enable' | 'disable' | 'auto'\n) {\n let tracks: [ILocalVideoTrack, ILocalAudioTrack] | ILocalVideoTrack\n async function createClosure() {\n tracks = await AgoraRTC.createScreenVideoTrack(config, withAudio)\n return tracks\n }\n return function useScreenVideoTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(tracks)\n\n useEffect(() => {\n if (ref.current === undefined) {\n createClosure().then((tracks) => {\n ref.current = tracks\n setReady(true)\n })\n } else {\n setReady(true)\n }\n }, [])\n return { ready, tracks: ref.current }\n }\n}\n\n\nexport const AgoraVideoPlayer = (props: React.DetailedHTMLProps, HTMLDivElement> & { videoTrack: ILocalVideoTrack | IRemoteVideoTrack | ICameraVideoTrack }) => {\n const vidDiv: RefObject = useRef(null)\n const { videoTrack, ...other } = props;\n useEffect(() => {\n if (vidDiv.current !== null) videoTrack.play(vidDiv.current)\n return () => {\n videoTrack.stop()\n }\n }, [videoTrack])\n\n return
\n}\n"],"names":["createClient","config","client","createClosure","AgoraRTC","createMicrophoneAndCameraTracks","audioConfig","videoConfig","tracks","useMicrophoneAndCameraTracks","useState","ready","setReady","ref","useRef","useEffect","current","then","createBufferSourceAudioTrack","track","useBufferSourceAudioTrack","createCameraVideoTrack","useCameraVideoTrack","createCustomAudioTrack","useCustomAudioTrack","createCustomVideoTrack","useCustomVideoTrack","createMicrophoneAudioTrack","useMicrophoneAudioTrack","createScreenVideoTrack","withAudio","useScreenVideoTrack","undefined","AgoraVideoPlayer","props","vidDiv","videoTrack","other","play","stop","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAqBaA,YAAY,GAAG,SAAfA,YAAe,CAACC,MAAD;AAC1B,MAAIC,MAAJ;;AACA,WAASC,aAAT;AACE,QAAI,CAACD,MAAL,EAAa;AACXA,MAAAA,MAAM,GAAGE,iBAAQ,CAACJ,YAAT,CAAsBC,MAAtB,CAAT;AACD;;AACD,WAAOC,MAAP;AACD;;AACD,SAAO;AAAA,WAAMC,aAAa,EAAnB;AAAA,GAAP;AACD;SAEeE,gCACdC,aACAC;MAGeJ,yBAAAA;;6BACEC,iBAAQ,CAACC,+BAAT,CACbC,WADa,EAEbC,WAFa;AAAfC,QAAAA,MAAM,wBAAN;AAIA,eAAOA,MAAP;;AACD;;;;;AAPD,MAAIA,MAAM,GAAsD,IAAhE;AAQA,SAAO,SAASC,4BAAT;oBACqBC,cAAQ,CAAC,KAAD;QAA3BC;QAAOC;;AACd,QAAMC,GAAG,GAAGC,YAAM,CAACN,MAAD,CAAlB;AAEAO,IAAAA,eAAS,CAAC;AACR,UAAIF,GAAG,CAACG,OAAJ,KAAgB,IAApB,EAA0B;AACxBb,QAAAA,aAAa,GAAGc,IAAhB,CAAqB,UAACT,MAAD;AACnBK,UAAAA,GAAG,CAACG,OAAJ,GAAcR,MAAd;AACAI,UAAAA,QAAQ,CAAC,IAAD,CAAR;AACD,SAHD;AAID,OALD,MAKO;AACLA,QAAAA,QAAQ,CAAC,IAAD,CAAR;AACD;;AACD,aAAO;AACLJ,QAAAA,MAAM,GAAG,IAAT;AACD,OAFD;AAGD,KAZQ,EAYN,EAZM,CAAT;AAaA,WAAO;AAAEG,MAAAA,KAAK,EAALA,KAAF;AAASH,MAAAA,MAAM,EAAEK,GAAG,CAACG;AAArB,KAAP;AACD,GAlBD;AAmBD;SAEeE,6BACdjB;MAGeE,yBAAAA;;6BACCC,iBAAQ,CAACc,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D,GALQ,EAKN,CAACH,UAAD,CALM,CAAT;AAOA,SAAOI,4BAAA,MAAA,oBAASH;AAAOxB,IAAAA,GAAG,EAAEsB;IAArB,CAAP;AACD;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { RefObject, useEffect, useRef, useState } from 'react'\nimport AgoraRTC, {\n BufferSourceAudioTrackInitConfig,\n CameraVideoTrackInitConfig,\n ClientConfig,\n CustomAudioTrackInitConfig,\n CustomVideoTrackInitConfig,\n IAgoraRTCClient,\n IBufferSourceAudioTrack,\n ICameraVideoTrack,\n ILocalAudioTrack,\n ILocalVideoTrack,\n IMicrophoneAudioTrack,\n IRemoteVideoTrack,\n MicrophoneAudioTrackInitConfig,\n ScreenVideoTrackInitConfig,\n VideoPlayerConfig\n} from 'agora-rtc-sdk-ng'\n\nexport default AgoraRTC;\nexport * from 'agora-rtc-sdk-ng';\n\nexport interface AgoraRTCError {\n code: AgoraRTCErrorCode;\n message: string;\n data?: any;\n name: string;\n}\n\nexport declare enum AgoraRTCErrorCode {\n UNEXPECTED_ERROR = \"UNEXPECTED_ERROR\",\n UNEXPECTED_RESPONSE = \"UNEXPECTED_RESPONSE\",\n TIMEOUT = \"TIMEOUT\",\n INVALID_PARAMS = \"INVALID_PARAMS\",\n NOT_SUPPORTED = \"NOT_SUPPORTED\",\n INVALID_OPERATION = \"INVALID_OPERATION\",\n OPERATION_ABORTED = \"OPERATION_ABORTED\",\n WEB_SECURITY_RESTRICT = \"WEB_SECURITY_RESTRICT\",\n NETWORK_ERROR = \"NETWORK_ERROR\",\n NETWORK_TIMEOUT = \"NETWORK_TIMEOUT\",\n NETWORK_RESPONSE_ERROR = \"NETWORK_RESPONSE_ERROR\",\n API_INVOKE_TIMEOUT = \"API_INVOKE_TIMEOUT\",\n ENUMERATE_DEVICES_FAILED = \"ENUMERATE_DEVICES_FAILED\",\n DEVICE_NOT_FOUND = \"DEVICE_NOT_FOUND\",\n ELECTRON_IS_NULL = \"ELECTRON_IS_NULL\",\n ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR = \"ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR\",\n CHROME_PLUGIN_NO_RESPONSE = \"CHROME_PLUGIN_NO_RESPONSE\",\n CHROME_PLUGIN_NOT_INSTALL = \"CHROME_PLUGIN_NOT_INSTALL\",\n MEDIA_OPTION_INVALID = \"MEDIA_OPTION_INVALID\",\n PERMISSION_DENIED = \"PERMISSION_DENIED\",\n CONSTRAINT_NOT_SATISFIED = \"CONSTRAINT_NOT_SATISFIED\",\n TRACK_IS_DISABLED = \"TRACK_IS_DISABLED\",\n SHARE_AUDIO_NOT_ALLOWED = \"SHARE_AUDIO_NOT_ALLOWED\",\n LOW_STREAM_ENCODING_ERROR = \"LOW_STREAM_ENCODING_ERROR\",\n INVALID_UINT_UID_FROM_STRING_UID = \"INVALID_UINT_UID_FROM_STRING_UID\",\n CAN_NOT_GET_PROXY_SERVER = \"CAN_NOT_GET_PROXY_SERVER\",\n CAN_NOT_GET_GATEWAY_SERVER = \"CAN_NOT_GET_GATEWAY_SERVER\",\n VOID_GATEWAY_ADDRESS = \"VOID_GATEWAY_ADDRESS\",\n UID_CONFLICT = \"UID_CONFLICT\",\n INVALID_LOCAL_TRACK = \"INVALID_LOCAL_TRACK\",\n INVALID_TRACK = \"INVALID_TRACK\",\n SENDER_NOT_FOUND = \"SENDER_NOT_FOUND\",\n CREATE_OFFER_FAILED = \"CREATE_OFFER_FAILED\",\n SET_ANSWER_FAILED = \"SET_ANSWER_FAILED\",\n ICE_FAILED = \"ICE_FAILED\",\n PC_CLOSED = \"PC_CLOSED\",\n SENDER_REPLACE_FAILED = \"SENDER_REPLACE_FAILED\",\n GATEWAY_P2P_LOST = \"GATEWAY_P2P_LOST\",\n NO_ICE_CANDIDATE = \"NO_ICE_CANDIDATE\",\n CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS = \"CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS\",\n EXIST_DISABLED_VIDEO_TRACK = \"EXIST_DISABLED_VIDEO_TRACK\",\n INVALID_REMOTE_USER = \"INVALID_REMOTE_USER\",\n REMOTE_USER_IS_NOT_PUBLISHED = \"REMOTE_USER_IS_NOT_PUBLISHED\",\n CUSTOM_REPORT_SEND_FAILED = \"CUSTOM_REPORT_SEND_FAILED\",\n CUSTOM_REPORT_FREQUENCY_TOO_HIGH = \"CUSTOM_REPORT_FREQUENCY_TOO_HIGH\",\n FETCH_AUDIO_FILE_FAILED = \"FETCH_AUDIO_FILE_FAILED\",\n READ_LOCAL_AUDIO_FILE_ERROR = \"READ_LOCAL_AUDIO_FILE_ERROR\",\n DECODE_AUDIO_FILE_FAILED = \"DECODE_AUDIO_FILE_FAILED\",\n WS_ABORT = \"WS_ABORT\",\n WS_DISCONNECT = \"WS_DISCONNECT\",\n WS_ERR = \"WS_ERR\",\n LIVE_STREAMING_TASK_CONFLICT = \"LIVE_STREAMING_TASK_CONFLICT\",\n LIVE_STREAMING_INVALID_ARGUMENT = \"LIVE_STREAMING_INVALID_ARGUMENT\",\n LIVE_STREAMING_INTERNAL_SERVER_ERROR = \"LIVE_STREAMING_INTERNAL_SERVER_ERROR\",\n LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED = \"LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED\",\n LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED = \"LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED\",\n LIVE_STREAMING_CDN_ERROR = \"LIVE_STREAMING_CDN_ERROR\",\n LIVE_STREAMING_INVALID_RAW_STREAM = \"LIVE_STREAMING_INVALID_RAW_STREAM\",\n LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT = \"LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT\",\n LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE = \"LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE\",\n LIVE_STREAMING_WARN_FREQUENT_REQUEST = \"LIVE_STREAMING_WARN_FREQUENT_REQUEST\",\n WEBGL_INTERNAL_ERROR = \"WEBGL_INTERNAL_ERROR\",\n BEAUTY_PROCESSOR_INTERNAL_ERROR = \"BEAUTY_PROCESSOR_INTERNAL_ERROR\",\n CROSS_CHANNEL_WAIT_STATUS_ERROR = \"CROSS_CHANNEL_WAIT_STATUS_ERROR\",\n CROSS_CHANNEL_FAILED_JOIN_SRC = \"CROSS_CHANNEL_FAILED_JOIN_SEC\",\n CROSS_CHANNEL_FAILED_JOIN_DEST = \"CROSS_CHANNEL_FAILED_JOIN_DEST\",\n CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST = \"CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST\",\n CROSS_CHANNEL_SERVER_ERROR_RESPONSE = \"CROSS_CHANNEL_SERVER_ERROR_RESPONSE\",\n METADATA_OUT_OF_RANGE = \"METADATA_OUT_OF_RANGE\"\n}\n\nexport const createClient = (config: ClientConfig) => {\n let client: IAgoraRTCClient\n function createClosure() {\n if (!client) {\n client = AgoraRTC.createClient(config)\n }\n return client\n }\n return () => createClosure()\n}\n\nexport function createMicrophoneAndCameraTracks(\n audioConfig?: MicrophoneAudioTrackInitConfig | undefined,\n videoConfig?: CameraVideoTrackInitConfig | undefined\n) {\n let tracks: [IMicrophoneAudioTrack, ICameraVideoTrack] | null = null\n async function createClosure() {\n tracks = await AgoraRTC.createMicrophoneAndCameraTracks(\n audioConfig,\n videoConfig\n )\n return tracks\n }\n return function useMicrophoneAndCameraTracks() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(tracks)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((tracks) => {\n ref.current = tracks\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n tracks = null\n }\n }, [])\n return { ready, tracks: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createBufferSourceAudioTrack(\n config: BufferSourceAudioTrackInitConfig\n) {\n let track: IBufferSourceAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createBufferSourceAudioTrack(config)\n return track\n }\n return function useBufferSourceAudioTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createCameraVideoTrack(config?: CameraVideoTrackInitConfig) {\n let track: ICameraVideoTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCameraVideoTrack(config)\n return track\n }\n return function useCameraVideoTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createCustomAudioTrack(config: CustomAudioTrackInitConfig) {\n let track: ILocalAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCustomAudioTrack(config)\n return track\n }\n return function useCustomAudioTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createCustomVideoTrack(config: CustomVideoTrackInitConfig) {\n let track: ILocalVideoTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCustomVideoTrack(config)\n return track\n }\n return function useCustomVideoTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createMicrophoneAudioTrack(\n config?: MicrophoneAudioTrackInitConfig\n) {\n let track: IMicrophoneAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createMicrophoneAudioTrack(config)\n return track\n }\n return function useMicrophoneAudioTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createScreenVideoTrack(\n config: ScreenVideoTrackInitConfig,\n withAudio?: 'enable' | 'disable' | 'auto'\n) {\n let tracks: [ILocalVideoTrack, ILocalAudioTrack] | ILocalVideoTrack\n async function createClosure() {\n tracks = await AgoraRTC.createScreenVideoTrack(config, withAudio)\n return tracks\n }\n return function useScreenVideoTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(tracks)\n\n useEffect(() => {\n if (ref.current === undefined) {\n createClosure().then((tracks) => {\n ref.current = tracks\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n }, [])\n return { ready, tracks: ref.current, error: agoraRTCError }\n }\n}\n\n\nexport const AgoraVideoPlayer = (props: React.DetailedHTMLProps, HTMLDivElement> & { videoTrack: ILocalVideoTrack | IRemoteVideoTrack | ICameraVideoTrack } & {config?: VideoPlayerConfig}) => {\n const vidDiv: RefObject = useRef(null)\n const { videoTrack, config, ...other } = props;\n useEffect(() => {\n if (vidDiv.current !== null) videoTrack.play(vidDiv.current, config)\n return () => {\n videoTrack.stop()\n }\n }, [videoTrack])\n\n return
\n}\n"],"names":["createClient","config","client","createClosure","AgoraRTC","createMicrophoneAndCameraTracks","audioConfig","videoConfig","tracks","useMicrophoneAndCameraTracks","useState","ready","setReady","agoraRTCError","setAgoraRTCError","ref","useRef","useEffect","current","then","e","error","createBufferSourceAudioTrack","track","useBufferSourceAudioTrack","createCameraVideoTrack","useCameraVideoTrack","createCustomAudioTrack","useCustomAudioTrack","createCustomVideoTrack","useCustomVideoTrack","createMicrophoneAudioTrack","useMicrophoneAudioTrack","createScreenVideoTrack","withAudio","useScreenVideoTrack","undefined","AgoraVideoPlayer","props","vidDiv","videoTrack","other","play","stop","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAqGaA,YAAY,GAAG,SAAfA,YAAe,CAACC,MAAD;AAC1B,MAAIC,MAAJ;;AACA,WAASC,aAAT;AACE,QAAI,CAACD,MAAL,EAAa;AACXA,MAAAA,MAAM,GAAGE,iBAAQ,CAACJ,YAAT,CAAsBC,MAAtB,CAAT;AACD;;AACD,WAAOC,MAAP;AACD;;AACD,SAAO;AAAA,WAAMC,aAAa,EAAnB;AAAA,GAAP;AACD;SAEeE,gCACdC,aACAC;MAGeJ,yBAAAA;;6BACEC,iBAAQ,CAACC,+BAAT,CACbC,WADa,EAEbC,WAFa;AAAfC,QAAAA,MAAM,wBAAN;AAIA,eAAOA,MAAP;;AACD;;;;;AAPD,MAAIA,MAAM,GAAsD,IAAhE;AAQA,SAAO,SAASC,4BAAT;oBACqBC,cAAQ,CAAC,KAAD;QAA3BC;QAAOC;;qBAC4BF,cAAQ,CAAuB,IAAvB;QAA3CG;QAAeC;;AACtB,QAAMC,GAAG,GAAG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AAK,EAAER;AAArC,KAAP;AACD,GAlBD;AAmBD;IAGYwB,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD;AAC9B,MAAMC,MAAM,GAA8BvB,YAAM,CAAC,IAAD,CAAhD;;MACQwB,aAAiCF,MAAjCE;MAAYvC,SAAqBqC,MAArBrC;MAAWwC,sCAAUH;;AACzCrB,EAAAA,eAAS,CAAC;AACR,QAAIsB,MAAM,CAACrB,OAAP,KAAmB,IAAvB,EAA6BsB,UAAU,CAACE,IAAX,CAAgBH,MAAM,CAACrB,OAAvB,EAAgCjB,MAAhC;AAC7B,WAAO;AACLuC,MAAAA,UAAU,CAACG,IAAX;AACD,KAFD;AAGD,GALQ,EAKN,CAACH,UAAD,CALM,CAAT;AAOA,SAAOI,4BAAA,MAAA,oBAASH;AAAO1B,IAAAA,GAAG,EAAEwB;IAArB,CAAP;AACD;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/index.modern.js b/dist/index.modern.js index c2de790..0b8eb23 100644 --- a/dist/index.modern.js +++ b/dist/index.modern.js @@ -50,12 +50,18 @@ function createMicrophoneAndCameraTracks(audioConfig, videoConfig) { ready = _useState[0], setReady = _useState[1]; + var _useState2 = useState(null), + agoraRTCError = _useState2[0], + setAgoraRTCError = _useState2[1]; + var ref = useRef(tracks); useEffect(function () { if (ref.current === null) { createClosure().then(function (tracks) { ref.current = tracks; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -67,7 +73,8 @@ function createMicrophoneAndCameraTracks(audioConfig, videoConfig) { }, []); return { ready: ready, - tracks: ref.current + tracks: ref.current, + error: agoraRTCError }; }; } @@ -85,9 +92,13 @@ function createBufferSourceAudioTrack(config) { var track = null; return function useBufferSourceAudioTrack() { - var _useState2 = useState(false), - ready = _useState2[0], - setReady = _useState2[1]; + var _useState3 = useState(false), + ready = _useState3[0], + setReady = _useState3[1]; + + var _useState4 = useState(null), + agoraRTCError = _useState4[0], + setAgoraRTCError = _useState4[1]; var ref = useRef(track); useEffect(function () { @@ -95,6 +106,8 @@ function createBufferSourceAudioTrack(config) { createClosure().then(function (track) { ref.current = track; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -106,7 +119,8 @@ function createBufferSourceAudioTrack(config) { }, []); return { ready: ready, - track: ref.current + track: ref.current, + error: agoraRTCError }; }; } @@ -124,9 +138,13 @@ function createCameraVideoTrack(config) { var track = null; return function useCameraVideoTrack() { - var _useState3 = useState(false), - ready = _useState3[0], - setReady = _useState3[1]; + var _useState5 = useState(false), + ready = _useState5[0], + setReady = _useState5[1]; + + var _useState6 = useState(null), + agoraRTCError = _useState6[0], + setAgoraRTCError = _useState6[1]; var ref = useRef(track); useEffect(function () { @@ -134,6 +152,8 @@ function createCameraVideoTrack(config) { createClosure().then(function (track) { ref.current = track; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -145,7 +165,8 @@ function createCameraVideoTrack(config) { }, []); return { ready: ready, - track: ref.current + track: ref.current, + error: agoraRTCError }; }; } @@ -163,9 +184,13 @@ function createCustomAudioTrack(config) { var track = null; return function useCustomAudioTrack() { - var _useState4 = useState(false), - ready = _useState4[0], - setReady = _useState4[1]; + var _useState7 = useState(false), + ready = _useState7[0], + setReady = _useState7[1]; + + var _useState8 = useState(null), + agoraRTCError = _useState8[0], + setAgoraRTCError = _useState8[1]; var ref = useRef(track); useEffect(function () { @@ -173,6 +198,8 @@ function createCustomAudioTrack(config) { createClosure().then(function (track) { ref.current = track; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -184,7 +211,8 @@ function createCustomAudioTrack(config) { }, []); return { ready: ready, - track: ref.current + track: ref.current, + error: agoraRTCError }; }; } @@ -202,9 +230,13 @@ function createCustomVideoTrack(config) { var track = null; return function useCustomVideoTrack() { - var _useState5 = useState(false), - ready = _useState5[0], - setReady = _useState5[1]; + var _useState9 = useState(false), + ready = _useState9[0], + setReady = _useState9[1]; + + var _useState10 = useState(null), + agoraRTCError = _useState10[0], + setAgoraRTCError = _useState10[1]; var ref = useRef(track); useEffect(function () { @@ -212,6 +244,8 @@ function createCustomVideoTrack(config) { createClosure().then(function (track) { ref.current = track; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -223,7 +257,8 @@ function createCustomVideoTrack(config) { }, []); return { ready: ready, - track: ref.current + track: ref.current, + error: agoraRTCError }; }; } @@ -241,9 +276,13 @@ function createMicrophoneAudioTrack(config) { var track = null; return function useMicrophoneAudioTrack() { - var _useState6 = useState(false), - ready = _useState6[0], - setReady = _useState6[1]; + var _useState11 = useState(false), + ready = _useState11[0], + setReady = _useState11[1]; + + var _useState12 = useState(null), + agoraRTCError = _useState12[0], + setAgoraRTCError = _useState12[1]; var ref = useRef(track); useEffect(function () { @@ -251,6 +290,8 @@ function createMicrophoneAudioTrack(config) { createClosure().then(function (track) { ref.current = track; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -262,7 +303,8 @@ function createMicrophoneAudioTrack(config) { }, []); return { ready: ready, - track: ref.current + track: ref.current, + error: agoraRTCError }; }; } @@ -280,9 +322,13 @@ function createScreenVideoTrack(config, withAudio) { var tracks; return function useScreenVideoTrack() { - var _useState7 = useState(false), - ready = _useState7[0], - setReady = _useState7[1]; + var _useState13 = useState(false), + ready = _useState13[0], + setReady = _useState13[1]; + + var _useState14 = useState(null), + agoraRTCError = _useState14[0], + setAgoraRTCError = _useState14[1]; var ref = useRef(tracks); useEffect(function () { @@ -290,6 +336,8 @@ function createScreenVideoTrack(config, withAudio) { createClosure().then(function (tracks) { ref.current = tracks; setReady(true); + }, function (e) { + setAgoraRTCError(e); }); } else { setReady(true); @@ -297,7 +345,8 @@ function createScreenVideoTrack(config, withAudio) { }, []); return { ready: ready, - tracks: ref.current + tracks: ref.current, + error: agoraRTCError }; }; } @@ -305,10 +354,11 @@ var AgoraVideoPlayer = function AgoraVideoPlayer(props) { var vidDiv = useRef(null); var videoTrack = props.videoTrack, - other = _objectWithoutPropertiesLoose(props, ["videoTrack"]); + config = props.config, + other = _objectWithoutPropertiesLoose(props, ["videoTrack", "config"]); useEffect(function () { - if (vidDiv.current !== null) videoTrack.play(vidDiv.current); + if (vidDiv.current !== null) videoTrack.play(vidDiv.current, config); return function () { videoTrack.stop(); }; diff --git a/dist/index.modern.js.map b/dist/index.modern.js.map index 4dedaf9..9b35479 100644 --- a/dist/index.modern.js.map +++ b/dist/index.modern.js.map @@ -1 +1 @@ -{"version":3,"file":"index.modern.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { RefObject, useEffect, useRef, useState } from 'react'\nimport AgoraRTC, {\n BufferSourceAudioTrackInitConfig,\n CameraVideoTrackInitConfig,\n ClientConfig,\n CustomAudioTrackInitConfig,\n CustomVideoTrackInitConfig,\n IAgoraRTCClient,\n IBufferSourceAudioTrack,\n ICameraVideoTrack,\n ILocalAudioTrack,\n ILocalVideoTrack,\n IMicrophoneAudioTrack,\n IRemoteVideoTrack,\n MicrophoneAudioTrackInitConfig,\n ScreenVideoTrackInitConfig\n} from 'agora-rtc-sdk-ng'\n\nexport default AgoraRTC;\nexport * from 'agora-rtc-sdk-ng';\n\nexport const createClient = (config: ClientConfig) => {\n let client: IAgoraRTCClient\n function createClosure() {\n if (!client) {\n client = AgoraRTC.createClient(config)\n }\n return client\n }\n return () => createClosure()\n}\n\nexport function createMicrophoneAndCameraTracks(\n audioConfig?: MicrophoneAudioTrackInitConfig | undefined,\n videoConfig?: CameraVideoTrackInitConfig | undefined\n) {\n let tracks: [IMicrophoneAudioTrack, ICameraVideoTrack] | null = null\n async function createClosure() {\n tracks = await AgoraRTC.createMicrophoneAndCameraTracks(\n audioConfig,\n videoConfig\n )\n return tracks\n }\n return function useMicrophoneAndCameraTracks() {\n const [ready, setReady] = useState(false)\n const ref = useRef(tracks)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((tracks) => {\n ref.current = tracks\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n tracks = null\n }\n }, [])\n return { ready, tracks: ref.current }\n }\n}\n\nexport function createBufferSourceAudioTrack(\n config: BufferSourceAudioTrackInitConfig\n) {\n let track: IBufferSourceAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createBufferSourceAudioTrack(config)\n return track\n }\n return function useBufferSourceAudioTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current }\n }\n}\n\nexport function createCameraVideoTrack(config?: CameraVideoTrackInitConfig) {\n let track: ICameraVideoTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCameraVideoTrack(config)\n return track\n }\n return function useCameraVideoTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current }\n }\n}\n\nexport function createCustomAudioTrack(config: CustomAudioTrackInitConfig) {\n let track: ILocalAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCustomAudioTrack(config)\n return track\n }\n return function useCustomAudioTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current }\n }\n}\n\nexport function createCustomVideoTrack(config: CustomVideoTrackInitConfig) {\n let track: ILocalVideoTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCustomVideoTrack(config)\n return track\n }\n return function useCustomVideoTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current }\n }\n}\n\nexport function createMicrophoneAudioTrack(\n config?: MicrophoneAudioTrackInitConfig\n) {\n let track: IMicrophoneAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createMicrophoneAudioTrack(config)\n return track\n }\n return function useMicrophoneAudioTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current }\n }\n}\n\nexport function createScreenVideoTrack(\n config: ScreenVideoTrackInitConfig,\n withAudio?: 'enable' | 'disable' | 'auto'\n) {\n let tracks: [ILocalVideoTrack, ILocalAudioTrack] | ILocalVideoTrack\n async function createClosure() {\n tracks = await AgoraRTC.createScreenVideoTrack(config, withAudio)\n return tracks\n }\n return function useScreenVideoTrack() {\n const [ready, setReady] = useState(false)\n const ref = useRef(tracks)\n\n useEffect(() => {\n if (ref.current === undefined) {\n createClosure().then((tracks) => {\n ref.current = tracks\n setReady(true)\n })\n } else {\n setReady(true)\n }\n }, [])\n return { ready, tracks: ref.current }\n }\n}\n\n\nexport const AgoraVideoPlayer = (props: React.DetailedHTMLProps, HTMLDivElement> & { videoTrack: ILocalVideoTrack | IRemoteVideoTrack | ICameraVideoTrack }) => {\n const vidDiv: RefObject = useRef(null)\n const { videoTrack, ...other } = props;\n useEffect(() => {\n if (vidDiv.current !== null) videoTrack.play(vidDiv.current)\n return () => {\n videoTrack.stop()\n }\n }, [videoTrack])\n\n return
\n}\n"],"names":["createClient","config","client","createClosure","AgoraRTC","createMicrophoneAndCameraTracks","audioConfig","videoConfig","tracks","useMicrophoneAndCameraTracks","useState","ready","setReady","ref","useRef","useEffect","current","then","createBufferSourceAudioTrack","track","useBufferSourceAudioTrack","createCameraVideoTrack","useCameraVideoTrack","createCustomAudioTrack","useCustomAudioTrack","createCustomVideoTrack","useCustomVideoTrack","createMicrophoneAudioTrack","useMicrophoneAudioTrack","createScreenVideoTrack","withAudio","useScreenVideoTrack","undefined","AgoraVideoPlayer","props","vidDiv","videoTrack","other","play","stop","React"],"mappings":";;;;;;;;;;;;;;;;;;;IAqBaA,YAAY,GAAG,SAAfA,YAAe,CAACC,MAAD;AAC1B,MAAIC,MAAJ;;AACA,WAASC,aAAT;AACE,QAAI,CAACD,MAAL,EAAa;AACXA,MAAAA,MAAM,GAAGE,iBAAQ,CAACJ,YAAT,CAAsBC,MAAtB,CAAT;AACD;;AACD,WAAOC,MAAP;AACD;;AACD,SAAO;AAAA,WAAMC,aAAa,EAAnB;AAAA,GAAP;AACD;SAEeE,gCACdC,aACAC;MAGeJ,yBAAAA;;6BACEC,iBAAQ,CAACC,+BAAT,CACbC,WADa,EAEbC,WAFa;AAAfC,QAAAA,MAAM,wBAAN;AAIA,eAAOA,MAAP;;AACD;;;;;AAPD,MAAIA,MAAM,GAAsD,IAAhE;AAQA,SAAO,SAASC,4BAAT;oBACqBC,QAAQ,CAAC,KAAD;QAA3BC;QAAOC;;AACd,QAAMC,GAAG,GAAGC,MAAM,CAACN,MAAD,CAAlB;AAEAO,IAAAA,SAAS,CAAC;AACR,UAAIF,GAAG,CAACG,OAAJ,KAAgB,IAApB,EAA0B;AACxBb,QAAAA,aAAa,GAAGc,IAAhB,CAAqB,UAACT,MAAD;AACnBK,UAAAA,GAAG,CAACG,OAAJ,GAAcR,MAAd;AACAI,UAAAA,QAAQ,CAAC,IAAD,CAAR;AACD,SAHD;AAID,OALD,MAKO;AACLA,QAAAA,QAAQ,CAAC,IAAD,CAAR;AACD;;AACD,aAAO;AACLJ,QAAAA,MAAM,GAAG,IAAT;AACD,OAFD;AAGD,KAZQ,EAYN,EAZM,CAAT;AAaA,WAAO;AAAEG,MAAAA,KAAK,EAALA,KAAF;AAASH,MAAAA,MAAM,EAAEK,GAAG,CAACG;AAArB,KAAP;AACD,G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OAAvB;AAC7B,WAAO;AACLoB,MAAAA,UAAU,CAACG,IAAX;AACD,KAFD;AAGD,GALQ,EAKN,CAACH,UAAD,CALM,CAAT;AAOA,SAAOI,mBAAA,MAAA,oBAASH;AAAOxB,IAAAA,GAAG,EAAEsB;IAArB,CAAP;AACD;;;;;"} \ No newline at end of file +{"version":3,"file":"index.modern.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { RefObject, useEffect, useRef, useState } from 'react'\nimport AgoraRTC, {\n BufferSourceAudioTrackInitConfig,\n CameraVideoTrackInitConfig,\n ClientConfig,\n CustomAudioTrackInitConfig,\n CustomVideoTrackInitConfig,\n IAgoraRTCClient,\n IBufferSourceAudioTrack,\n ICameraVideoTrack,\n ILocalAudioTrack,\n ILocalVideoTrack,\n IMicrophoneAudioTrack,\n IRemoteVideoTrack,\n MicrophoneAudioTrackInitConfig,\n ScreenVideoTrackInitConfig,\n VideoPlayerConfig\n} from 'agora-rtc-sdk-ng'\n\nexport default AgoraRTC;\nexport * from 'agora-rtc-sdk-ng';\n\nexport interface AgoraRTCError {\n code: AgoraRTCErrorCode;\n message: string;\n data?: any;\n name: string;\n}\n\nexport declare enum AgoraRTCErrorCode {\n UNEXPECTED_ERROR = \"UNEXPECTED_ERROR\",\n UNEXPECTED_RESPONSE = \"UNEXPECTED_RESPONSE\",\n TIMEOUT = \"TIMEOUT\",\n INVALID_PARAMS = \"INVALID_PARAMS\",\n NOT_SUPPORTED = \"NOT_SUPPORTED\",\n INVALID_OPERATION = \"INVALID_OPERATION\",\n OPERATION_ABORTED = \"OPERATION_ABORTED\",\n WEB_SECURITY_RESTRICT = \"WEB_SECURITY_RESTRICT\",\n NETWORK_ERROR = \"NETWORK_ERROR\",\n NETWORK_TIMEOUT = \"NETWORK_TIMEOUT\",\n NETWORK_RESPONSE_ERROR = \"NETWORK_RESPONSE_ERROR\",\n API_INVOKE_TIMEOUT = \"API_INVOKE_TIMEOUT\",\n ENUMERATE_DEVICES_FAILED = \"ENUMERATE_DEVICES_FAILED\",\n DEVICE_NOT_FOUND = \"DEVICE_NOT_FOUND\",\n ELECTRON_IS_NULL = \"ELECTRON_IS_NULL\",\n ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR = \"ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR\",\n CHROME_PLUGIN_NO_RESPONSE = \"CHROME_PLUGIN_NO_RESPONSE\",\n CHROME_PLUGIN_NOT_INSTALL = \"CHROME_PLUGIN_NOT_INSTALL\",\n MEDIA_OPTION_INVALID = \"MEDIA_OPTION_INVALID\",\n PERMISSION_DENIED = \"PERMISSION_DENIED\",\n CONSTRAINT_NOT_SATISFIED = \"CONSTRAINT_NOT_SATISFIED\",\n TRACK_IS_DISABLED = \"TRACK_IS_DISABLED\",\n SHARE_AUDIO_NOT_ALLOWED = \"SHARE_AUDIO_NOT_ALLOWED\",\n LOW_STREAM_ENCODING_ERROR = \"LOW_STREAM_ENCODING_ERROR\",\n INVALID_UINT_UID_FROM_STRING_UID = \"INVALID_UINT_UID_FROM_STRING_UID\",\n CAN_NOT_GET_PROXY_SERVER = \"CAN_NOT_GET_PROXY_SERVER\",\n CAN_NOT_GET_GATEWAY_SERVER = \"CAN_NOT_GET_GATEWAY_SERVER\",\n VOID_GATEWAY_ADDRESS = \"VOID_GATEWAY_ADDRESS\",\n UID_CONFLICT = \"UID_CONFLICT\",\n INVALID_LOCAL_TRACK = \"INVALID_LOCAL_TRACK\",\n INVALID_TRACK = \"INVALID_TRACK\",\n SENDER_NOT_FOUND = \"SENDER_NOT_FOUND\",\n CREATE_OFFER_FAILED = \"CREATE_OFFER_FAILED\",\n SET_ANSWER_FAILED = \"SET_ANSWER_FAILED\",\n ICE_FAILED = \"ICE_FAILED\",\n PC_CLOSED = \"PC_CLOSED\",\n SENDER_REPLACE_FAILED = \"SENDER_REPLACE_FAILED\",\n GATEWAY_P2P_LOST = \"GATEWAY_P2P_LOST\",\n NO_ICE_CANDIDATE = \"NO_ICE_CANDIDATE\",\n CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS = \"CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS\",\n EXIST_DISABLED_VIDEO_TRACK = \"EXIST_DISABLED_VIDEO_TRACK\",\n INVALID_REMOTE_USER = \"INVALID_REMOTE_USER\",\n REMOTE_USER_IS_NOT_PUBLISHED = \"REMOTE_USER_IS_NOT_PUBLISHED\",\n CUSTOM_REPORT_SEND_FAILED = \"CUSTOM_REPORT_SEND_FAILED\",\n CUSTOM_REPORT_FREQUENCY_TOO_HIGH = \"CUSTOM_REPORT_FREQUENCY_TOO_HIGH\",\n FETCH_AUDIO_FILE_FAILED = \"FETCH_AUDIO_FILE_FAILED\",\n READ_LOCAL_AUDIO_FILE_ERROR = \"READ_LOCAL_AUDIO_FILE_ERROR\",\n DECODE_AUDIO_FILE_FAILED = \"DECODE_AUDIO_FILE_FAILED\",\n WS_ABORT = \"WS_ABORT\",\n WS_DISCONNECT = \"WS_DISCONNECT\",\n WS_ERR = \"WS_ERR\",\n LIVE_STREAMING_TASK_CONFLICT = \"LIVE_STREAMING_TASK_CONFLICT\",\n LIVE_STREAMING_INVALID_ARGUMENT = \"LIVE_STREAMING_INVALID_ARGUMENT\",\n LIVE_STREAMING_INTERNAL_SERVER_ERROR = \"LIVE_STREAMING_INTERNAL_SERVER_ERROR\",\n LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED = \"LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED\",\n LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED = \"LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED\",\n LIVE_STREAMING_CDN_ERROR = \"LIVE_STREAMING_CDN_ERROR\",\n LIVE_STREAMING_INVALID_RAW_STREAM = \"LIVE_STREAMING_INVALID_RAW_STREAM\",\n LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT = \"LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT\",\n LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE = \"LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE\",\n LIVE_STREAMING_WARN_FREQUENT_REQUEST = \"LIVE_STREAMING_WARN_FREQUENT_REQUEST\",\n WEBGL_INTERNAL_ERROR = \"WEBGL_INTERNAL_ERROR\",\n BEAUTY_PROCESSOR_INTERNAL_ERROR = \"BEAUTY_PROCESSOR_INTERNAL_ERROR\",\n CROSS_CHANNEL_WAIT_STATUS_ERROR = \"CROSS_CHANNEL_WAIT_STATUS_ERROR\",\n CROSS_CHANNEL_FAILED_JOIN_SRC = \"CROSS_CHANNEL_FAILED_JOIN_SEC\",\n CROSS_CHANNEL_FAILED_JOIN_DEST = \"CROSS_CHANNEL_FAILED_JOIN_DEST\",\n CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST = \"CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST\",\n CROSS_CHANNEL_SERVER_ERROR_RESPONSE = \"CROSS_CHANNEL_SERVER_ERROR_RESPONSE\",\n METADATA_OUT_OF_RANGE = \"METADATA_OUT_OF_RANGE\"\n}\n\nexport const createClient = (config: ClientConfig) => {\n let client: IAgoraRTCClient\n function createClosure() {\n if (!client) {\n client = AgoraRTC.createClient(config)\n }\n return client\n }\n return () => createClosure()\n}\n\nexport function createMicrophoneAndCameraTracks(\n audioConfig?: MicrophoneAudioTrackInitConfig | undefined,\n videoConfig?: CameraVideoTrackInitConfig | undefined\n) {\n let tracks: [IMicrophoneAudioTrack, ICameraVideoTrack] | null = null\n async function createClosure() {\n tracks = await AgoraRTC.createMicrophoneAndCameraTracks(\n audioConfig,\n videoConfig\n )\n return tracks\n }\n return function useMicrophoneAndCameraTracks() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(tracks)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((tracks) => {\n ref.current = tracks\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n tracks = null\n }\n }, [])\n return { ready, tracks: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createBufferSourceAudioTrack(\n config: BufferSourceAudioTrackInitConfig\n) {\n let track: IBufferSourceAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createBufferSourceAudioTrack(config)\n return track\n }\n return function useBufferSourceAudioTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createCameraVideoTrack(config?: CameraVideoTrackInitConfig) {\n let track: ICameraVideoTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCameraVideoTrack(config)\n return track\n }\n return function useCameraVideoTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createCustomAudioTrack(config: CustomAudioTrackInitConfig) {\n let track: ILocalAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCustomAudioTrack(config)\n return track\n }\n return function useCustomAudioTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createCustomVideoTrack(config: CustomVideoTrackInitConfig) {\n let track: ILocalVideoTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createCustomVideoTrack(config)\n return track\n }\n return function useCustomVideoTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createMicrophoneAudioTrack(\n config?: MicrophoneAudioTrackInitConfig\n) {\n let track: IMicrophoneAudioTrack | null = null\n async function createClosure() {\n track = await AgoraRTC.createMicrophoneAudioTrack(config)\n return track\n }\n return function useMicrophoneAudioTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(track)\n\n useEffect(() => {\n if (ref.current === null) {\n createClosure().then((track) => {\n ref.current = track\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n return () => {\n track = null\n }\n }, [])\n return { ready, track: ref.current, error: agoraRTCError }\n }\n}\n\nexport function createScreenVideoTrack(\n config: ScreenVideoTrackInitConfig,\n withAudio?: 'enable' | 'disable' | 'auto'\n) {\n let tracks: [ILocalVideoTrack, ILocalAudioTrack] | ILocalVideoTrack\n async function createClosure() {\n tracks = await AgoraRTC.createScreenVideoTrack(config, withAudio)\n return tracks\n }\n return function useScreenVideoTrack() {\n const [ready, setReady] = useState(false)\n const [agoraRTCError, setAgoraRTCError] = useState(null)\n const ref = useRef(tracks)\n\n useEffect(() => {\n if (ref.current === undefined) {\n createClosure().then((tracks) => {\n ref.current = tracks\n setReady(true)\n }, (e) => {\n setAgoraRTCError(e)\n })\n } else {\n setReady(true)\n }\n }, [])\n return { ready, tracks: ref.current, error: agoraRTCError }\n }\n}\n\n\nexport const AgoraVideoPlayer = (props: React.DetailedHTMLProps, HTMLDivElement> & { videoTrack: ILocalVideoTrack | IRemoteVideoTrack | ICameraVideoTrack } & {config?: VideoPlayerConfig}) => {\n const vidDiv: RefObject = useRef(null)\n const { videoTrack, config, ...other } = props;\n useEffect(() => {\n if (vidDiv.current !== null) videoTrack.play(vidDiv.current, config)\n return () => {\n videoTrack.stop()\n }\n }, [videoTrack])\n\n return
\n}\n"],"names":["createClient","config","client","createClosure","AgoraRTC","createMicrophoneAndCameraTracks","audioConfig","videoConfig","tracks","useMicrophoneAndCameraTracks","useState","ready","setReady","agoraRTCError","setAgoraRTCError","ref","useRef","useEffect","current","then","e","error","createBufferSourceAudioTrack","track","useBufferSourceAudioTrack","createCameraVideoTrack","useCameraVideoTrack","createCustomAudioTrack","useCustomAudioTrack","createCustomVideoTrack","useCustomVideoTrack","createMicrophoneAudioTrack","useMicrophoneAudioTrack","createScreenVideoTrack","withAudio","useScreenVideoTrack","undefined","AgoraVideoPlayer","props","vidDiv","videoTrack","other","play","stop","React"],"mappings":";;;;;;;;;;;;;;;;;;;IAqGaA,YAAY,GAAG,SAAfA,YAAe,CAACC,MAAD;AAC1B,MAAIC,MAAJ;;AACA,WAASC,aAAT;AACE,QAAI,CAACD,MAAL,EAAa;AACXA,MAAAA,MAAM,GAAGE,iBAAQ,CAACJ,YAAT,CAAsBC,MAAtB,CAAT;AACD;;AACD,WAAOC,MAAP;AACD;;AACD,SAAO;AAAA,WAAMC,aAAa,EAAnB;AAAA,GAAP;AACD;SAEeE,gCACdC,aACAC;MAGeJ,yBAAAA;;6BACEC,iBAAQ,CAACC,+BAAT,CACbC,WADa,EAEbC,WAFa;AAAfC,QAAAA,MAAM,wBAAN;AAIA,eAAOA,MAAP;;AACD;;;;;AAPD,MAAIA,MAAM,GAAsD,IAAhE;AAQA,SAAO,SAASC,4BAAT;oBACqBC,QAAQ,CAAC,KAAD;QAA3BC;QAAOC;;qBAC4BF,QAAQ,CAAuB,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MAAM,EAAEO,GAAG,CAACG,OAArB;AAA8BG,MAAAA,KAAK,EAAER;AAArC,KAAP;AACD,GAlBD;AAmBD;IAGYwB,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD;AAC9B,MAAMC,MAAM,GAA8BvB,MAAM,CAAC,IAAD,CAAhD;;MACQwB,aAAiCF,MAAjCE;MAAYvC,SAAqBqC,MAArBrC;MAAWwC,sCAAUH;;AACzCrB,EAAAA,SAAS,CAAC;AACR,QAAIsB,MAAM,CAACrB,OAAP,KAAmB,IAAvB,EAA6BsB,UAAU,CAACE,IAAX,CAAgBH,MAAM,CAACrB,OAAvB,EAAgCjB,MAAhC;AAC7B,WAAO;AACLuC,MAAAA,UAAU,CAACG,IAAX;AACD,KAFD;AAGD,GALQ,EAKN,CAACH,UAAD,CALM,CAAT;AAOA,SAAOI,mBAAA,MAAA,oBAASH;AAAO1B,IAAAA,GAAG,EAAEwB;IAArB,CAAP;AACD;;;;;"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index eb75eb3..24b15c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "agora-rtc-react", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": {