Skip to content

[partytracks] audioElement.setSinkId is not available on mobile browsers #276

@danieljvdm

Description

@danieljvdm

My app crashes on mobile devices (e.g. safari) when trying to use the audiosink utility. I had to add the following polyfill for it to not throw errors:

if (
  typeof HTMLMediaElement !== "undefined" &&
  HTMLMediaElement.prototype &&
  !HTMLMediaElement.prototype.setSinkId
) {
  HTMLMediaElement.prototype.setSinkId = async () => {
    console.warn("setSinkId is not supported on this browser");
    return;
  };
}

Additionally, there doesn't seem to be any examples of how to use it properly in react (it took me a few goes to get the observable setup and memoization correct). It doesn't seem like the orange demo uses it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions