Closed Bug 1489300 Opened 3 years ago Closed 3 years ago

After upgrade to v62, the webcam will no longer show an image in FF even though the settings indicate it's allowed.

Categories

(Web Compatibility :: Desktop, defect)

Firefox 62
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1483220

People

(Reporter: chris.livesay, Unassigned)

References

()

Details

(Keywords: regression, site-compat, Whiteboard: [needinfo to reporter 2018/09/10] [needsdiagnosis] [webcompat])

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Steps to reproduce:

Upgrade to Version 62.0 in Windows


Actual results:

Webcam is no longer active in the browser though the settings show it is allowed


Expected results:

Image in webcam should be visible.
Is it still working in Firefox 61 if you downgrade?  If so, it would be very helpful if you could try mozregression to narrow down which set of changes between 61 and 62 may have caused this.  Please see the video linked from https://mozilla.github.io/mozregression/quickstart.html for instructions.
Flags: needinfo?(chris.livesay)
Hi Matthew. I did confirm that a downgrade to 61.0.2 has the webcam window working as normal. I am looking now at the regression link you sent me. This is a pretty big deal for us. 

Thank you
Flags: needinfo?(chris.livesay)
mozgression is not working. When I bring up each build and select the camera, it flashes a couple times in the address bar then goes away. I go into the camera settings and don't have the option to enable. This was in every build that came up although I know it's worked fine in all previous builds.
I don't see the option here to include a screenshot but I have one if needed.
Attached image FF_camera.PNG
The empty box you see in this screenshot should have a live picture
Attached image FF_camera2.PNG
This is what it looks like in 61.0.2 with the webcam working.
This is probably due to Bug 1454889, just like Bug 1483220.
That sounds like the most likely culprit. Please ask the webmaster of the affected site to replace:

    video.src = URL.createObjectURL(stream)

with:

    video.srcObject = stream
Flags: needinfo?(chris.livesay)
Whiteboard: [needinfo to reporter 2018/09/10]
Component: Audio/Video → Desktop
Keywords: site-compat
Product: Core → Tech Evangelism
Version: 62 Branch → Firefox 62
This site requires a login and a password to access. 
Fortunately the scripts are loaded in the document.
In https://secure.safevisitorsolutions.com/Scripts/webcam.js


			function(stream) {
				// got access, attach stream to video
			    try {
			        video.src = window.URL.createObjectURL(stream) || stream;
			    }
			    catch (e) {
			        if (typeof video.srcObject == "object") {
			            video.srcObject = stream;
			        } else {
			            video.src = URL.createObjectURL(stream);
			        }
			    }
				Webcam.stream = stream;
				Webcam.loaded = true;
				Webcam.live = true;
				Webcam.dispatch('load');
				Webcam.dispatch('live');
			},


It seems the try/catch doesn't fail the right way. Also if chrome is still supporting createObjectURL(), This is a risk for Firefox.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jib)
Whiteboard: [needinfo to reporter 2018/09/10] → [needinfo to reporter 2018/09/10] [needsdiagnosis] [webcompat]
Good morning. I confirmed with our developers that the following code fixed the issue for us. 

Hi Chris,

// Original Code was
video.src = window.URL.createObjectURL( stream ) || stream; 


// Replaced with following code.

try {
        video.src = window.URL.createObjectURL(stream) || stream;
}
catch (e) {
        if (typeof video.srcObject == "object") {
            video.srcObject = stream;
        } else {
            video.src = URL.createObjectURL(stream);
        }
}

Regards
Sanjay Jindal


Thank you for your help!
Flags: needinfo?(chris.livesay)
Great, glad you got it fixed! Though note that:

    video.src = stream; // always WRONG

... is always wrong, since src expects a string, not an object. Therefore, so is the || version.

All browsers that support WebRTC support srcObject, so I recommend the much simpler:

    video.srcObject = stream; // always right

... without all the try/catch stuff.

Thanks.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1454889
(In reply to Karl Dubost :karlcow from comment #9)
> Also if chrome is still supporting createObjectURL(), This is a risk for Firefox.

I agree. Chrome has removed it in Canary 71, but it still works in release 69 with this web console warning:

[Deprecation] URL.createObjectURL with media streams is deprecated and will be removed in M71, around December 2018. Please use HTMLMediaElement.srcObject instead. See https://www.chromestatus.com/features/5618491470118912 for more details.

We've been emitting web console warnings for a long time, but few people read them it seem. I'll have to defer to baku why we jumped ahead of Chrome here.
Blocks: 1454889
Flags: needinfo?(jib) → needinfo?(amarchesini)
Duplicate of bug: 1483220
I don't have a valid answer for this question. What I can say is that this issue has been discussed in dev-platform, and at that time, I didn't know when Chrome was planning to remove this feature.
Flags: needinfo?(amarchesini)
Per https://groups.google.com/d/msg/mozilla.dev.platform/o_0RoYoCmM4/uQ2-lt1DCgAJ the expectation was that Chrome would remove it in 68. It seems they delayed that.
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.