Skip to content

Commit 0a5cafa

Browse files
fraserxuNikhil Thorat
authored and
Nikhil Thorat
committed
Use HTMLMediaObject.srcObject in webcam-transfer-learning video stream. (#52)
Fix a deprecation warnings about using the HTMLMediaElement.srcObject instead of URL.createObjectURL api. > [Deprecation] URL.createObjectURL with media streams is deprecated and will be removed in M68, around July 2018. Please use HTMLMediaElement.srcObject instead. See https://www.chromestatus.com/features/5618491470118912 for more details.
1 parent 15143c2 commit 0a5cafa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

webcam-transfer-learning/webcam.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class Webcam {
8787
navigator.getUserMedia(
8888
{video: true},
8989
stream => {
90-
this.webcamElement.src = window.URL.createObjectURL(stream);
90+
this.webcamElement.srcObject = stream;
9191
this.webcamElement.addEventListener('loadeddata', async () => {
9292
this.adjustVideoSize(
9393
this.webcamElement.videoWidth,

0 commit comments

Comments
 (0)