question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chrome fires deviceReady event when cam is in use

See original GitHub issue

Description

In Firefox 66 I get a deviceErrorCode name of “NotReadableError” if video is in use.

In Chrome 73 I do not get a deviceError in fact i get a deviceReady But when I try to start recording I get an error in console.

This data is captured in my local dev environment.

Steps to reproduce

On my Windows 10 (build 1803) development pc.

  1. I start the local windows 10 camera app and let it hold camera.
  2. I then proceed into my app and go to the video recording page.
  3. In Chrome I get a deviceReady called in my page - my page enables the start video capture button.
  4. When I click the start capture button get the above error in javascript console.

The error isn’t surprising, what is surprising is that I get a deviceReady. Despite reporting deviceReady I do not see the video preview it remains black.

Results

Expected

In Chrome I should receive deviceError event.

Actual

In Chrome I do receive a deviceReady event. It fails later in start() video capture.

Error output

This error appears in the Chrome js console when I execute start() because Chrome things I have the device due to deviceReady event.

VM16438 1.chunk.js:83096 VIDEOJS: ERROR: DOMException: Failed to execute 'start' on 'MediaRecorder': The MediaRecorder failed to start because there are no audio or video tracks available.
    at MediaStreamRecorder.record (http://localhost:5004/static/js/1.chunk.js:99218:21)
    at initRecorder (http://localhost:5004/static/js/1.chunk.js:97053:19)
    at Object.startRecording (http://localhost:5004/static/js/1.chunk.js:97035:5)
    at MRecordRTC.startRecording (http://localhost:5004/static/js/1.chunk.js:98180:28)
    at RecordRTCEngine.start (webpack://VideojsRecord/./src/js/engine/record-rtc.js?:96:19)
    at Record.startRecording (webpack://VideojsRecord/./src/js/videojs.record.js?:622:19)
    at Player.eval (webpack://VideojsRecord/./src/js/videojs.record.js?:600:22)
    at HTMLDivElement.bound (http://localhost:5004/static/js/1.chunk.js:116215:15)
    at HTMLDivElement.func (http://localhost:5004/static/js/1.chunk.js:116042:8)
    at HTMLDivElement.data.dispatcher (http://localhost:5004/static/js/1.chunk.js:115857:31)
    at trigger (http://localhost:5004/static/js/1.chunk.js:115995:25)
    at Player.trigger$$1 [as trigger] (http://localhost:5004/static/js/1.chunk.js:116904:12)
    at Player.(anonymous function) [as handleTechLoadedmetadata_] (http://localhost:5004/static/js/1.chunk.js:138060:17)
    at Html5.bound (http://localhost:5004/static/js/1.chunk.js:116215:15)
    at HTMLVideoElement.bound (http://localhost:5004/static/js/1.chunk.js:116215:15)

Additional Information

Please include any additional information necessary here. Including the following:

versions

videojs

“videojs-record”: “^3.6.0”

browsers

Launched in Incognito mode in Chrome to isolate addons.

OSes

Windows 10 build 1803 64bit, up to date patches.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
rluitencommented, Apr 16, 2019

Nice, I should be able to figure where I am at with that page and your example. Thanks so much! I’ll let you know if I learn anything else I think might be useful.

0reactions
thijstriemstracommented, Apr 19, 2019

this is from '15: https://stackoverflow.com/questions/31108855/webrtc-check-if-camera-and-microphone-are-in-use-on-chrome If it’s still a bug, chrome is just lame.

I do hope the chromium devs have an open issue for this, haven’t found it yet though.

The testrtc project has a test that detects silence from a microphone here that could be useful in determining if the audio track returned is silent, and a similar video test that detects frozen or black frames.

Come on, this can’t be real. 🤦‍♂️

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fire deviceready event in Chrome browser (trying to ...
Event "deviceready" is fired in cordova.js so I don't know a way to detect existence ... Another added bonus is the ability to...
Read more >
MediaDevices: devicechange event - Web APIs | MDN
A devicechange event is sent to a MediaDevices instance whenever a media device such as a camera, microphone, or speaker is connected to...
Read more >
Media Capture
This plugin defines global navigator.device.capture object. Although in the global scope, it is not available until after the deviceready event. document.
Read more >
Alpha Anywhere | Getting Started with Mobile Apps
iOS devices typically use Mobile Safari, while Android devices can use a variety ... When the app is fired up, the client side...
Read more >
PhoneGap app only running with PhoneGap Desktop and ...
My AppStudio camera app, built with PhoneGap, always stops with Uncaught ... B) When the deviceready event fires, then and only then can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found