Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[audio] Replace MediaSource for MediaProvider #721

Open
yanickrochon opened this issue Dec 6, 2024 · 0 comments
Open

[audio] Replace MediaSource for MediaProvider #721

yanickrochon opened this issue Dec 6, 2024 · 0 comments

Comments

@yanickrochon
Copy link

Describe The Problem To Be Solved

The property srcObject on HTMLAudioElement is of type MediaProvider, however the type for src in the audio package restricts only to a subset, that is MediaSource.

For example, this is perfectly valid:

const destination:MediaStreamAudioDestinationNode = context.createMediaStreamDestination();
const bufferSource:AudioBufferSourceNode = context.createBufferSource();
bufferSource.buffer = buffer;
bufferSource.start(0);
bufferSource.connect(context.destination);
state.player.srcObject = destination.stream satisfies MediaStream;

However, destination.stream is not a valid AudioSource according the declaration.

Suggest A Solution

Change

type AudioSource = string | undefined | HTMLAudioElement | MediaSource | (string & MediaSource);

to

type AudioSource = string | undefined | HTMLAudioElement | MediaProvider | (string & MediaProvider);
@yanickrochon yanickrochon changed the title Replace MediaSource for MediaProvider in audio [audio] Replace MediaSource for MediaProvider Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant