From 498929d7b858da23ceb087d88e5ed5ae1e5e15b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20Anton=20Gl=C3=A4ser?= Date: Tue, 29 Mar 2022 13:26:29 +0200 Subject: [PATCH] html pfusch --- public/css/mystyle.css | 24 ++++++++++++++++++++++++ public/index.html | 19 +++++++++---------- public/main.mjs | 16 +++++++++++++++- 3 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 public/css/mystyle.css diff --git a/public/css/mystyle.css b/public/css/mystyle.css new file mode 100644 index 0000000..d877479 --- /dev/null +++ b/public/css/mystyle.css @@ -0,0 +1,24 @@ +/* * { + box-sizing: border-box !important; + margin: 0 !important; + padding: 0 !important; +} */ +/* #main { + position: fixed; + top: 0px; + bottom: 0px; + left: 0px; + right: 0px; +} +*/ +body { + margin: 0; + height: 100vh; + width: 100%; + /* overflow: hidden; */ +} +video { + width: 100% !important; + height: auto !important; + background-color: black; +} diff --git a/public/index.html b/public/index.html index 7ea48eb..17fded8 100644 --- a/public/index.html +++ b/public/index.html @@ -1,15 +1,14 @@ - - + + SimpleStream - @@ -17,11 +16,10 @@ - -
-
+
+
-

SimpleStream

+

SimpleStream (Alpha)

Your ID:

Connect URL:

@@ -30,12 +28,13 @@

Connecting to:

-
+
+
- +
- + diff --git a/public/main.mjs b/public/main.mjs index f53b347..d27b312 100644 --- a/public/main.mjs +++ b/public/main.mjs @@ -57,9 +57,11 @@ let sf = simpleFramwork(); sf.streamId_text = "Loading..."; sf.streamURL_text = "Loading..."; +sf.localVideo.enableAutosize = true; let connectToId = new URL(window.location.href).searchParams.get("id"); -let ownId = new URL(window.location.href).searchParams.get("own_id") +let ownId = new URL(window.location.href).searchParams.get("own_id"); +let autoFullscreen = new URL(window.location.href).searchParams.get("auto_fullscreen"); let bitrate = new URL(window.location.href).searchParams.get("br") || 50000; @@ -91,6 +93,13 @@ if (ownId) { } +function fullscreenHandler(element, fullscreensetting) { + //main.mjs: 98 Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture. + //if (fullscreensetting) { + let res = element.requestFullscreen(); + console.log(res); + //} +} function bitrateTransform(sdp) { var arr = sdp.split("\r\n"); @@ -170,6 +179,11 @@ peer.on("call", (call) => { console.log("stream", remoteStream); let v = sf.localVideo; v.srcObject = remoteStream; + //fullscreenHandler(v, autoFullscreen); + v.muted = true; + v.autoplay = true; + //because of https://developer.mozilla.org/de/docs/Web/HTML/Element/video + //because of https://developer.chrome.com/blog/autoplay/ (autoplay / play not possible with sound enabled) v.play(); }); });