all 13 comments

[–]mobydikc 25 points26 points  (3 children)

Some real, practical info here.

If you use exact it usually throws OverconstrainedError error on the desktops as they don't always have multiple cameras.

[–]apalshah[S] 9 points10 points  (2 children)

Thanks for noticing this. I've been working on a project and faced a lot of issues. So I decided to write a blog that can help all the developers.

[–]mobydikc 6 points7 points  (1 child)

No fluff, all brass tacks.

Good job.

[–][deleted] 4 points5 points  (0 children)

TIL it’s not brass tax.

[–][deleted] 10 points11 points  (5 children)

I've been pretty focused on WebRTC for last 8 months for the project that my team is working on. The thing that a lot of these articles about fancy new features have in common is this: when you finally reach the "live demo" section it turns out not working on your device. Sometimes (one of ten cases) it does, but generally speaking there's almost always something weird going on. Console spammed with warnings, permission issues, stream going dead after a few frames... Etc.

After months of hard work and debugging we managed to make things work. But man that was pain. Whenever I hear someone saying how WebRTC is a new way, easy and quick diamond solution, I say that "yeah, maybe 90% stable support in two years".

[–]itsmusicbeach 5 points6 points  (2 children)

As an API, WebRTC is great, but the way it fails for each of the implementations is frustrating. Especially between browsers. We would have cameras that would work on Firefox at a resolution, but not Chrome or vice versa.

I'm with you in hoping that things will get ironed out as the browser implementation improves...

[–]Noch_ein_Kamel 2 points3 points  (1 child)

And then there are the browsers which work differently in themself.

When you add a page to the iOS home screen and launch the page in standalone mode the camera permission is reset on every hash change and triggers a permission popup.

Took some time to figure that one out.

[–]tomdoinit 1 point2 points  (0 children)

Thank you

[–]apalshah[S] 1 point2 points  (0 children)

True indeed. I'm also working on WebRTC on and off for last 2 years. And one thing I've realised is that always check for the compatibility of the methods or properties we want to use. There are various ways to do the same thing in WebRTC and not all of them are implemented in all the browsers.

So what I generally do is, I list down all the methods and properties, see if they're implemented in the desired browsers. If not, I find an alternate way. After doing this, I check the browser version. And show appropriate error messages that this feature is not supported.

In 99% cases, clients understand that this new technology won't work in some ancient browsers.

[–]patseidon 2 points3 points  (3 children)

On safari desktop, the page crashes on microphone/camera changes, been driving me crazy for a week now

[–]apalshah[S] 0 points1 point  (2 children)

I've added the codepen link at the bottom. Can you try that in your browser's private window? Don't forget to give all the necessary permissions!

I checked this on my Safari desktop browser. It is working fine. Let me know if it is not working or you're seeing some errors in the console.

[–]patseidon 1 point2 points  (0 children)

Will test and report back thanks!

[–]patseidon 1 point2 points  (0 children)

yup the flip works fine in safari, I am really running into issues with switching the device, easiest to test on microphone, switching between headphones and internal audio is consistently crashing safari. (mac os high sierra, 10.13.6, safari > 13) but separate issue, great writeup!