Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Strehle committed Mar 5, 2024
1 parent 9c18e68 commit 73e0a24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/.dx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use stage from #public.uix;

endpoint: stage {
prod: @+example-videocall1
prod: @+example-videocall2
},

location: stage {
Expand Down
10 changes: 5 additions & 5 deletions frontend/entrypoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { Runtime } from "unyt_core/datex_all.ts";

const remoteEndpointName = eternal ?? $$(new URLSearchParams(globalThis.location.search).get("remote") ?? "" as "@")

const src = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
const ownVideo = <video autoplay src={src} />
const ownMediaStream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
const ownVideo = <video autoplay src={ownMediaStream} />
const remoteVideo = <video autoplay/>


@endpoint class CallManager {
@property static call(mediaStream: MediaStream) {
remoteVideo.srcObject = mediaStream;
return src;
return ownMediaStream;
}
}

Expand All @@ -21,9 +21,9 @@ export default
<div>Own Endpoint: {Runtime.endpoint.toString()}</div>
<div>Remote Endpoint: <input value={remoteEndpointName}/></div>

<button onclick={async ()=>{
<button onclick={async () => {
const endpoint = Endpoint.get(remoteEndpointName.val);
remoteVideo.srcObject = await CallManager.call.to(endpoint)(src);
remoteVideo.srcObject = await CallManager.call.to(endpoint)(ownMediaStream);
}}>Call</button>

<div class="callView">
Expand Down

0 comments on commit 73e0a24

Please sign in to comment.