Added log

This commit is contained in:
EpicKiwi 2023-09-21 12:04:11 +02:00
parent c5fb07f6da
commit 68b20a8b4f
Signed by: epickiwi
GPG Key ID: C4B28FD2729941CE

View File

@ -3,6 +3,7 @@
const currentScriptSrc = document.currentScript.src; const currentScriptSrc = document.currentScript.src;
const sourceElt = document.querySelector("canvas,video"); const sourceElt = document.querySelector("canvas,video");
console.log("Grabbing", sourceElt)
if(!sourceElt){ if(!sourceElt){
console.error("No canvas found on this page") console.error("No canvas found on this page")
@ -41,6 +42,8 @@
const canvasStreamTracks = canvasStream.getVideoTracks() const canvasStreamTracks = canvasStream.getVideoTracks()
if(canvasStreamTracks.length > 0){ if(canvasStreamTracks.length > 0){
conn.addTrack(canvasStreamTracks[0], canvasStream) conn.addTrack(canvasStreamTracks[0], canvasStream)
} else {
throw new Error("Element don't habe video track")
} }
const offer = await conn.createOffer(); const offer = await conn.createOffer();