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

feat: Add setDeviceId method on web #1369

Closed
wants to merge 7 commits into from

Conversation

dganzella
Copy link

Added setDeviceId method, so the output speaker (HTML5AudioElement sink ID) can be set -- so developer can select which device to play sound instead of default

@ryanheise
Copy link
Owner

I would suggest renaming this to setWebDeviceId following the convention of setWebCrossOrigin since it is a web-specific method. Or given that it's specific to the web API, maybe setWebSinkId so there is no confusion about what it represents? If you're thinking of generic naming so that multiple platforms can implement it in a different way, I think there are too many platform differences in the way audio routing APIs are designed that this would not work. Maybe there is a similar notion in Android, but in just_audio it is again named androidAudioSessionId as it is unlikely Android's API works in a similar way to other platforms (for example, you don't set it, you listen to it and then pass it into separate APIs for routing.)

@dganzella
Copy link
Author

I would suggest renaming this to setWebDeviceId following the convention of setWebCrossOrigin since it is a web-specific method. Or given that it's specific to the web API, maybe setWebSinkId so there is no confusion about what it represents? If you're thinking of generic naming so that multiple platforms can implement it in a different way, I think there are too many platform differences in the way audio routing APIs are designed that this would not work. Maybe there is a similar notion in Android, but in just_audio it is again named androidAudioSessionId as it is unlikely Android's API works in a similar way to other platforms (for example, you don't set it, you listen to it and then pass it into separate APIs for routing.)

k, I will fix it this week and send to you

@ryanheise
Copy link
Owner

Did you have an opinion on setWebDeviceId vs setWebSinkId? I think "sink" is more faithful to the original API.

@dganzella
Copy link
Author

Did you have an opinion on setWebDeviceId vs setWebSinkId? I think "sink" is more faithful to the original API.

Yes, I also think setWebSinkId is better!

@ryanheise
Copy link
Owner

ryanheise commented Dec 15, 2024

Then let's go with the setWebSinkId naming, and then I can merge and release.

@dganzella
Copy link
Author

ok @ryanheise I moved this PR to another, because I needed to revert the pubspec.yaml but did not want to change the code that is working in production to stop compiling

#1378

@dganzella dganzella closed this Dec 16, 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

Successfully merging this pull request may close these issues.

2 participants