Skip to content

Commit 5163d38

Browse files
mvandervlietshazron
authored andcommitted
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.
1 parent 36343a8 commit 5163d38

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/browser/CameraProxy.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ function capture (success, errorCallback, opts) {
102102

103103
var successCallback = function (stream) {
104104
localMediaStream = stream;
105-
video.src = window.URL.createObjectURL(localMediaStream);
105+
if ('srcObject' in video) {
106+
video.srcObject = localMediaStream;
107+
} else {
108+
video.src = window.URL.createObjectURL(localMediaStream);
109+
}
106110
video.play();
107-
108111
document.body.appendChild(parent);
109112
};
110113

0 commit comments

Comments
 (0)