diff --git a/examples/basic/main.tsx b/examples/basic/main.tsx index 0fe02805..bab52fb9 100644 --- a/examples/basic/main.tsx +++ b/examples/basic/main.tsx @@ -7,7 +7,7 @@ import ReactDOM from "react-dom/client"; import { HashRouter as Router } from "react-router-dom"; import App from "./src/App"; -AgoraRTC.setLogLevel(/* warning */ 2); +AgoraRTC.setLogLevel(/* DEBUG */ 0); ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( diff --git a/packages/agora-rtc-react-ui/package.json b/packages/agora-rtc-react-ui/package.json index e7a18414..b1b0a00e 100644 --- a/packages/agora-rtc-react-ui/package.json +++ b/packages/agora-rtc-react-ui/package.json @@ -71,7 +71,7 @@ "@vitest/coverage-v8": "^0.34.1", "agora-rtc-react": "workspace:*", "agora-rtc-sdk-ng": "4.18.2", - "agora-rtc-sdk-ng-fake": "github:AgoraIO-Extensions/agora-rtc-sdk-ng-fake#semver:^1.0.0", + "agora-rtc-sdk-ng-fake": "github:AgoraIO-Extensions/agora-rtc-sdk-ng-fake#semver:^1.0.4", "jsdom": "^22.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/packages/agora-rtc-react/package.json b/packages/agora-rtc-react/package.json index 5a85aa78..bad3eec0 100644 --- a/packages/agora-rtc-react/package.json +++ b/packages/agora-rtc-react/package.json @@ -75,7 +75,7 @@ "@vitest/ui": "^0.34.1", "agora-rtc-react-ui": "workspace:*", "agora-rtc-sdk-ng": "4.18.2", - "agora-rtc-sdk-ng-fake": "github:AgoraIO-Extensions/agora-rtc-sdk-ng-fake#semver:^1.0.0", + "agora-rtc-sdk-ng-fake": "github:AgoraIO-Extensions/agora-rtc-sdk-ng-fake#semver:^1.0.4", "jsdom": "^22.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/packages/agora-rtc-react/src/hooks/useLocalCameraTrack.ts b/packages/agora-rtc-react/src/hooks/useLocalCameraTrack.ts index 881f3c5b..9275f593 100644 --- a/packages/agora-rtc-react/src/hooks/useLocalCameraTrack.ts +++ b/packages/agora-rtc-react/src/hooks/useLocalCameraTrack.ts @@ -73,9 +73,6 @@ export function useLocalCameraTrack( setIsLoading(false); } } - if (!isConnected && !isUnmountRef.current) { - setTrack(null); - } }, [isConnected, ready]); return { localCameraTrack: track, isLoading: isLoading, error: error }; } diff --git a/packages/agora-rtc-react/src/hooks/useLocalMicrophoneTrack.ts b/packages/agora-rtc-react/src/hooks/useLocalMicrophoneTrack.ts index 56548237..c5d3d2df 100644 --- a/packages/agora-rtc-react/src/hooks/useLocalMicrophoneTrack.ts +++ b/packages/agora-rtc-react/src/hooks/useLocalMicrophoneTrack.ts @@ -73,9 +73,6 @@ export function useLocalMicrophoneTrack( setIsLoading(false); } } - if (!isConnected && !isUnmountRef.current) { - setTrack(null); - } }, [isConnected, ready]); return { localMicrophoneTrack: track, isLoading: isLoading, error: error }; } diff --git a/packages/agora-rtc-react/src/hooks/useLocalScreenTrack.ts b/packages/agora-rtc-react/src/hooks/useLocalScreenTrack.ts index 3009a483..e0cda6d0 100644 --- a/packages/agora-rtc-react/src/hooks/useLocalScreenTrack.ts +++ b/packages/agora-rtc-react/src/hooks/useLocalScreenTrack.ts @@ -68,7 +68,7 @@ export function useLocalScreenTrack( error: AgoraRTCReactError | null; }; export function useLocalScreenTrack( - ready: boolean, + ready = true, screenVideoTrackInitConfig: ScreenVideoTrackInitConfig, withAudio: "enable" | "disable" | "auto", client?: IAgoraRTCClient, @@ -111,7 +111,7 @@ export function useLocalScreenTrack( setIsLoading(false); } } - if ((!isConnected || !ready) && !isUnmountRef.current) { + if (!ready && !isUnmountRef.current) { setTrack(null); } }, [isConnected, ready]); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a2232c1..9bce328a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -300,8 +300,8 @@ importers: specifier: 4.18.2 version: 4.18.2 agora-rtc-sdk-ng-fake: - specifier: github:AgoraIO-Extensions/agora-rtc-sdk-ng-fake#semver:^1.0.0 - version: github.com/AgoraIO-Extensions/agora-rtc-sdk-ng-fake/47f32309fec61037c83de13f215dc38c4f1d3858 + specifier: github:AgoraIO-Extensions/agora-rtc-sdk-ng-fake#semver:^1.0.4 + version: github.com/AgoraIO-Extensions/agora-rtc-sdk-ng-fake/0a75c0c8fe4748e6063e188dbeee5ead2e698735 jsdom: specifier: ^22.1.0 version: 22.1.0 @@ -393,8 +393,8 @@ importers: specifier: 4.18.2 version: 4.18.2 agora-rtc-sdk-ng-fake: - specifier: github:AgoraIO-Extensions/agora-rtc-sdk-ng-fake#semver:^1.0.0 - version: github.com/AgoraIO-Extensions/agora-rtc-sdk-ng-fake/47f32309fec61037c83de13f215dc38c4f1d3858 + specifier: github:AgoraIO-Extensions/agora-rtc-sdk-ng-fake#semver:^1.0.4 + version: github.com/AgoraIO-Extensions/agora-rtc-sdk-ng-fake/0a75c0c8fe4748e6063e188dbeee5ead2e698735 jsdom: specifier: ^22.1.0 version: 22.1.0 @@ -14810,10 +14810,10 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - github.com/AgoraIO-Extensions/agora-rtc-sdk-ng-fake/47f32309fec61037c83de13f215dc38c4f1d3858: - resolution: {tarball: https://codeload.github.com/AgoraIO-Extensions/agora-rtc-sdk-ng-fake/tar.gz/47f32309fec61037c83de13f215dc38c4f1d3858} - name: agora-rtc-sdk-ng-fake - version: 1.0.0 + github.com/AgoraIO-Extensions/agora-rtc-sdk-ng-fake/0a75c0c8fe4748e6063e188dbeee5ead2e698735: + resolution: {tarball: https://codeload.github.com/AgoraIO-Extensions/agora-rtc-sdk-ng-fake/tar.gz/0a75c0c8fe4748e6063e188dbeee5ead2e698735} + name: '@agoraio-extensions/agora-rtc-sdk-ng-fake' + version: 1.0.4 prepare: true requiresBuild: true dev: true