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

Make audioplayer package compatible with WASM #1765

Closed
1 task done
zoeyfan opened this issue Mar 11, 2024 · 1 comment · Fixed by #1766
Closed
1 task done

Make audioplayer package compatible with WASM #1765

zoeyfan opened this issue Mar 11, 2024 · 1 comment · Fixed by #1766

Comments

@zoeyfan
Copy link

zoeyfan commented Mar 11, 2024

Checklist

  • I made sure that the issue I am raising doesn't already exist

Use case / Problem

We are hoping to use this package to create an exciting demo game (that uses Flutter and Flame) for an upcoming event. The game will support WASM, which is a critical product message Flutter team wants to land. Therefore, we would also appreciate it if this package could support WASM.

Proposal / Solution

Having a quick look, it looks like all the web code is here:
https://github.com/bluefireteam/audioplayers/tree/main/packages/audioplayers_web/lib
There's one file importing package:js and one file importing dart:html.
Hopefully these are the only two files that need to be touched in order to make the package compatible with WASM.

Example Code

Example Code
void main() {
}

Affected platforms

web

Platform details

WASM specific support

Audio Files/URLs/Sources

No response

Mockups

No response

Related issues / more information

No response

Working on PR

no way

@kevmoo
Copy link

kevmoo commented Mar 11, 2024

Gustl22 pushed a commit that referenced this issue Mar 13, 2024
# Description

This PR migrates usage of `dart:html` and `package:js` to their new
replacements. It also updates version constraints and CI configuration
to account for the versions required. These changes enable compilation
to Wasm and improves compatibility with Dart's evolving web interop
story. There are potentially bundle size improvements as well.

Dart and Flutter will prefer `dart:js_interop`, extension types, and
`package:web` as used here going forward. Check out
https://dart.dev/interop/js-interop/package-web to learn more.

Fixes #1765
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants