This commit is contained in:
Fabian Stamm 2023-07-02 15:57:14 +02:00
commit 7ffb691922
3 changed files with 176 additions and 175 deletions

View File

@ -26,14 +26,14 @@
<h2>Your ID: <span id="streamId"></span></h2>
<div id="streamURLCont">
<h2>Connect URL: <a id="streamURL"></a></h2>
<button id="startStramBTN">Start Stream</button>
</div>
<div id="connectToCont">
<h2>Connecting to: <span id="connectToID"></span></h2>
<button id="startStramBTN">Start Stream</button>
</div>
</div>
</div>
<video id="localVideo" style="width: 100%" controls></video>
<video id="localVideo" style="width: 100%" controls muted></video>
</div>

View File

@ -96,7 +96,6 @@ function bitrateTransform(sdp) {
return res;
}
let currentStream = undefined;
peer.on("open", (id) => {
console.log("ID", id);
@ -117,8 +116,8 @@ peer.on("open", (id) => {
video: true,
})
.then((stream) => {
if(currentStream) {
currentStream.getTracks().forEach(track => track.stop())
if (currentStream) {
currentStream.getTracks().forEach((track) => track.stop());
}
currentStream = stream;
let v = sf.localVideo;

View File

@ -1,4 +1,6 @@
{
"name": "ScreenSharingThing",
"packageManager": "yarn@3.1.1",
"scripts": {
"build:api": "jrpc compile API/main.jrpc -o=ts-node:_API/src && yarn workspace @hibas123/screen-api build",
"build:client": "yarn workspace @hibas123/screen-client build",