From 5163d3846558c70753af0d232bec762f337f2c66 Mon Sep 17 00:00:00 2001 From: Matthew Vander Vliet Date: Thu, 24 May 2018 22:44:23 -0600 Subject: [PATCH] CB-13384: (browser) Added deprecation of video.src compatibility (#288) * CB-13384: (browser) Added deprecation of video.src compatibility * CB-13384: Updated to reflect property detection rather than deprecation exception. --- src/browser/CameraProxy.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/browser/CameraProxy.js b/src/browser/CameraProxy.js index 362420e..ff81257 100644 --- a/src/browser/CameraProxy.js +++ b/src/browser/CameraProxy.js @@ -102,9 +102,12 @@ function capture (success, errorCallback, opts) { var successCallback = function (stream) { localMediaStream = stream; - video.src = window.URL.createObjectURL(localMediaStream); + if ('srcObject' in video) { + video.srcObject = localMediaStream; + } else { + video.src = window.URL.createObjectURL(localMediaStream); + } video.play(); - document.body.appendChild(parent); };