diff --git a/examples/use-camera-and-microphone-example/package-lock.json b/examples/use-camera-and-microphone-example/package-lock.json index dbc8c36..cdebda6 100644 --- a/examples/use-camera-and-microphone-example/package-lock.json +++ b/examples/use-camera-and-microphone-example/package-lock.json @@ -40,7 +40,7 @@ "version": "0.1.3", "license": "Apache-2.0", "dependencies": { - "@jellyfish-dev/ts-client-sdk": "0.1.3", + "@jellyfish-dev/ts-client-sdk": "^0.2.0", "events": "3.3.0", "lodash.isequal": "4.5.0" }, diff --git a/examples/use-camera-and-microphone-example/src/MainControls.tsx b/examples/use-camera-and-microphone-example/src/MainControls.tsx index 936a2e4..c78f349 100644 --- a/examples/use-camera-and-microphone-example/src/MainControls.tsx +++ b/examples/use-camera-and-microphone-example/src/MainControls.tsx @@ -32,6 +32,9 @@ const videoPreviewAtom = atomWithStorage("videoPreview", un const audioAutoStreamingAtom = atomWithStorage("audioAutoStreaming", undefined); const audioPreviewAtom = atomWithStorage("audioPreviewAtom", undefined); +const screenshareAutoStreamingAtom = atomWithStorage("screenshareAutoStreaming", undefined); +const screensharePreviewAtom = atomWithStorage("screensharePreviewAtom", undefined); + const autostartAtom = atomWithStorage("autostart", false, undefined, { unstable_getOnInit: true }); export const MainControls = () => { @@ -47,6 +50,9 @@ export const MainControls = () => { const [audioAutoStreaming, setAudioAutoStreaming] = useAtom(audioAutoStreamingAtom); const [audioPreview, setAudioPreview] = useAtom(audioPreviewAtom); + const [screenshareAutoStreaming, setScreenshareAutoStreaming] = useAtom(screenshareAutoStreamingAtom); + const [screensharePreview, setScreensharePreview] = useAtom(screensharePreviewAtom); + const [autostart, setAutostart] = useAtom(autostartAtom); const { init } = useSetupMedia({ @@ -67,6 +73,8 @@ export const MainControls = () => { defaultTrackMetadata: DEFAULT_AUDIO_TRACK_METADATA, }, screenshare: { + autoStreaming: screenshareAutoStreaming, + preview: screensharePreview, trackConstraints: true, defaultTrackMetadata: DEFAULT_VIDEO_TRACK_METADATA, }, @@ -129,6 +137,19 @@ export const MainControls = () => { set={setAudioPreview} radioClass="radio-secondary" /> + + +