livekit / track-processors-js

Pre-built track processors for background images, blur, etc for use with the LiveKit JS Client SDK
https://livekit.io
Apache License 2.0
36 stars 15 forks source link

Error: pipeline is not supported in this browser #10

Closed Mihai-github closed 1 year ago

Mihai-github commented 1 year ago

Hey,

I've encountered an issue trying on Firefox and Safari to use this library. It seems like the support for those 2 browsers is not present yet. I am asking because Chrome and Opera works just fine.

Below is the error I am getting on Safari and also Firefox:

image
lukasIO commented 1 year ago

yeah, that's a limitation. safari an firefox don't support the necessary APIs as of now

Mihai-github commented 1 year ago

Thanks, @lukasIO, for the update. I thought this is the case I've added for now the necessary check to identify the browser the user is on and if we have Firefox or Safari to not show the UI.

lukasIO commented 1 year ago

FWIW, the processors expose an isSupported method that you can use. That should be more accurate than a simple browser check as it checks for the presence of the necessary APIs directly

edit: ah, only the pipeline does, and the background blur raises an error earlier already... I'll think about how to improve that so that users can do BackgroundBlur.isSupported() or similar, before trying to use it.

Mihai-github commented 1 year ago

I understand. Having an option like BackgroundBlur.isSupported() would greatly enhance the experience. As of now, after realizing this limitation, I've implemented a check for these two browsers. This helps me set clear user expectations regarding the availability of this feature.

lukasIO commented 1 year ago

makes sense! you can also, already now do something like

let backgroundBlur; 
try {
 backgroundBlur = BackgroundBlur(); 
} catch (e) {
 // handle not supported
}
if(backgroundBlur) {
  // continue happy path
}
Mihai-github commented 1 year ago

Ah, I see, yap, can be a solution ... will give it a try and let you know :)