Skip to content

Commit

Permalink
Merge pull request #75 from zoom/1.12.12
Browse files Browse the repository at this point in the history
1.12.12 update
  • Loading branch information
endazoom authored Nov 5, 2024
2 parents 8881f60 + 5c89276 commit 90c8465
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 27 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "react-video-sdk-demo",
"version": "1.12.10",
"version": "1.12.12",
"private": true,
"dependencies": {
"@ant-design/icons": "4.7.0",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.8.3",
"@zoom/videosdk": "^1.12.10",
"@zoom/videosdk": "^1.12.12",
"antd": "4.24.3",
"classnames": "^2.2.6",
"crypto-js": "^4.0.0",
Expand Down
7 changes: 6 additions & 1 deletion src/feature/preview/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,12 @@ const PreviewContainer = () => {
</span>
<div className="container video-app">
<div className="preview-video">
<video className={classNames({ 'preview-video-show': !isInVBMode })} muted={true} ref={videoRef} />
<video
className={classNames({ 'preview-video-show': !isInVBMode })}
muted={true}
playsInline
ref={videoRef}
/>
<canvas
className={classNames({ 'preview-video-show': isInVBMode })}
width="1280"
Expand Down
8 changes: 6 additions & 2 deletions src/feature/video/components/share-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ const ShareBar = forwardRef((props: ShareBarProps, ref: any) => {
const onShareAudioClick = useCallback(() => {
if (shareAudioStatus?.isShareAudioEnabled) {
if (shareAudioStatus.isShareAudioMuted) {
mediaStream?.unmuteShareAudio();
mediaStream?.unmuteShareAudio().then(() => {
setShareAudioStatus(mediaStream.getShareAudioStatus());
});
} else {
mediaStream?.muteShareAudio();
mediaStream?.muteShareAudio().then(() => {
setShareAudioStatus(mediaStream.getShareAudioStatus());
});
}
}
}, [mediaStream, shareAudioStatus]);
Expand Down
29 changes: 17 additions & 12 deletions src/feature/video/components/video-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ const VideoFooter = (props: VideoFooterProps) => {
}
} else {
try {
await mediaStream?.startAudio({ highBitrate: true });
if (activePlaybackUrl) {
await mediaStream?.startAudio({ mediaFile: { url: activePlaybackUrl, loop: true } });
} else {
await mediaStream?.startAudio({ highBitrate: true });
}
} catch (e: any) {
if (e.type === 'INSUFFICIENT_PRIVILEGES' && e.reason === 'USER_FORBIDDEN_MICROPHONE') {
setIsMicrophoneForbidden(true);
Expand Down Expand Up @@ -606,17 +610,18 @@ const VideoFooter = (props: VideoFooterProps) => {
}}
/>
)}
{recordingButtons.map((button: RecordButtonProps) => {
return (
<RecordingButton
key={button.text}
onClick={() => {
onRecordingClick(button.text);
}}
{...button}
/>
);
})}
{!zmClient?.getCurrentUserInfo()?.subsessionId &&
recordingButtons.map((button: RecordButtonProps) => {
return (
<RecordingButton
key={button.text}
onClick={() => {
onRecordingClick(button.text);
}}
{...button}
/>
);
})}
{liveTranscriptionClient?.getLiveTranscriptionStatus().isLiveTranscriptionEnabled && (
<>
<LiveTranscriptionButton
Expand Down
24 changes: 14 additions & 10 deletions src/feature/video/hooks/useShare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,39 +41,43 @@ export function useShare(
if (item.sharerOn) {
setIsReceiveSharing(false);
}
if (mediaStream) {
setShareUserId(mediaStream.getShareUserList());
}
}
});
}
},
[zmClient]
[zmClient, mediaStream]
);
const onShareContentChange = useCallback((payload: any) => {
setActiveSharingId(payload.userId);
}, []);
const onActiveMediaFailed = useCallback(()=>{
const onActiveMediaFailed = useCallback(() => {
Modal.error({
title:'Active media failed',
content:'Something went wrong. An unexpected interruption in media capture or insufficient memory occurred. Try refreshing the page to recover.',
okText:'Refresh',
onOk:()=>{
title: 'Active media failed',
content:
'Something went wrong. An unexpected interruption in media capture or insufficient memory occurred. Try refreshing the page to recover.',
okText: 'Refresh',
onOk: () => {
window.location.reload();
}
})
},[])
});
}, []);
useEffect(() => {
zmClient.on('active-share-change', onActiveShareChange);
zmClient.on('share-content-dimension-change', onSharedContentDimensionChange);
zmClient.on('user-updated', onCurrentUserUpdate);
zmClient.on('peer-share-state-change', onPeerShareChange);
zmClient.on('share-content-change', onShareContentChange);
zmClient.on('active-media-failed',onActiveMediaFailed)
zmClient.on('active-media-failed', onActiveMediaFailed);
return () => {
zmClient.off('active-share-change', onActiveShareChange);
zmClient.off('share-content-dimension-change', onSharedContentDimensionChange);
zmClient.off('user-updated', onCurrentUserUpdate);
zmClient.off('peer-share-state-change', onPeerShareChange);
zmClient.off('share-content-change', onShareContentChange);
zmClient.off('active-media-failed',onActiveMediaFailed)
zmClient.off('active-media-failed', onActiveMediaFailed);
};
}, [
zmClient,
Expand Down
2 changes: 2 additions & 0 deletions src/feature/video/video-attach.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { useOrientation, usePrevious } from '../../hooks';
import { useVideoAspect } from './hooks/useVideoAspectRatio';
import { Radio } from 'antd';
import { useSpotlightVideo } from './hooks/useSpotlightVideo';
import RemoteCameraControlPanel from './components/remote-camera-control';
type CustomElement<T> = Partial<T & DOMAttributes<T> & { children: any }>;

declare global {
Expand Down Expand Up @@ -194,6 +195,7 @@ const VideoContainer: React.FunctionComponent<RouteComponentProps> = (props) =>
);
})}
</ul>
<RemoteCameraControlPanel />
</AvatarActionContext.Provider>
</video-player-container>
</div>
Expand Down

0 comments on commit 90c8465

Please sign in to comment.