The previous work web page calls the camera to get the video and take pictures of the work, and the error is reported: failed to execute ‘createobjecturl’ on ‘URL’
The reason is that after chrome is upgraded, the new version of chrome no longer supports this usage. It’s the same with other mainstream browsers,
So the original code:
video.src = URL.createObjectURL(stream);
Need to be changed to
video.srcObject = stream;
A compatible writing is as follows:
try {
this.srcObject = stream;} catch (error) {
this.src = window.URL.createObjectURL(stream);}
Similar Posts:
- Unable to open thread: http request failed! (4 pesos, PHP 4)
- [Solved] OBS Studio Use VLC video to play video error: Unhandled exception: c00000005
- “>
- Installing Google Chrome in Ubuntu 14.04 LTS
- -WebKit margin before and extended browser prefix and kernel
- Easygbs runs with an error of too many open files and cannot play the video stream. How to adjust?
- [Solved] OpenCV 4 (C++) Error: “error: ‘CV_FOURCC’ was not declared in this scope”
- [Solved] Chrome Version Error: Message: session not created: This version of ChromeDriver only supports Chrome version 95
- Npapi and ppapi problems of “application / x-vlc-plugin not supported”
- Element-ui Error: Uncaught (in promise) cancel [How to Solve]