From 26c41630d95e8865786fece50e8d7b595c103388 Mon Sep 17 00:00:00 2001 From: acj Date: Sat, 3 Aug 2019 13:02:10 +0200 Subject: [PATCH 1/2] Repair webcam streams by using srcObject rather than createObjectURL. See https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL. --- examples/camera/index.html | 2 +- index.html | 7 +------ sources/seriously.camera.js | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/examples/camera/index.html b/examples/camera/index.html index f07fa64..077994a 100644 --- a/examples/camera/index.html +++ b/examples/camera/index.html @@ -46,7 +46,7 @@ if (video.mozCaptureStream) { video.mozSrcObject = stream; } else { - video.src = (URL && URL.createObjectURL(stream)) || stream; + video.srcObject = stream; } video.play(); }, diff --git a/index.html b/index.html index e6762ab..f057fa8 100644 --- a/index.html +++ b/index.html @@ -296,12 +296,7 @@ target.width = video.videoWidth; } - if (window.webkitURL) { - video.src = window.webkitURL.createObjectURL(stream); - } else { - video.src = stream; - } - + video.srcObject = stream; webCamStream = stream; video.play(); diff --git a/sources/seriously.camera.js b/sources/seriously.camera.js index 81494d3..0000df2 100644 --- a/sources/seriously.camera.js +++ b/sources/seriously.camera.js @@ -97,7 +97,7 @@ if (video.mozCaptureStream) { video.mozSrcObject = stream; } else { - video.src = (URL && URL.createObjectURL(stream)) || stream; + video.srcObject = stream; } if (video.readyState) { From 24274a9922e07a8477e497022b74b53cad9bba8c Mon Sep 17 00:00:00 2001 From: acj Date: Sat, 3 Aug 2019 13:49:53 +0200 Subject: [PATCH 2/2] Repair webcam streams by using srcObject rather than createObjectURL. See https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL. --- index.html | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/index.html b/index.html index 912e4b1..d83bc37 100644 --- a/index.html +++ b/index.html @@ -296,12 +296,7 @@ target.width = video.videoWidth; } - if (window.URL) { - video.src = window.URL.createObjectURL(stream); - } else { - video.src = stream; - } - + video.srcObject = stream; webCamStream = stream; video.play();