-
+
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();
});
});