Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome update-Failed to execute 'createObjectURL' on 'URL'

Tags:

I'm taking an image from the webcam and storing it to the server. Everything was working fine until I got the chrome update today. My latest chrome version is:

Version 71.0.3578.80 (64 bit)

This line is throwing an error:

camera.src = window.URL.createObjectURL(stream);   

Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.

According to this link here. I applied the code

try {   this.srcObject = stream; } catch (error) {   this.src = window.URL.createObjectURL(stream); } 

Its not displaying the camera feed.

For reference - This jsfiddle code is not working on my chrome anymore.

like image 467
Curly_Braces Avatar asked Dec 05 '18 06:12

Curly_Braces


1 Answers

It's just been removed from the current version of Chrome. I suddenly started getting this error after it updated. I have no idea why it never printed deprecation warnings before today.

Instead of setting the src property to URL.createObjectURL(stream) you're now supposed to set the srcObject property to the stream directly. It seems to be working in Chrome and Firefox.

Source: https://developers.google.com/web/updates/2018/10/chrome-71-deps-rems

like image 126
jtiscione Avatar answered Sep 19 '22 15:09

jtiscione