-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Webaudio example fails with error in Safari 12 on macOS Mojave (works in Firefox) #897
Comments
Web audio is supported with a prefix in safari, so the example would need to fall back to From a quick search it doesn't seem like If that's the case I'm also not sure if that's an intentional decision or not. |
Thanks for the report and thanks for the info @chinedufn! We discussed this during today's meeting and the conclusion was that we'd like to add support to |
Some examples have been failing to load in some browsers, and this ensures that whenever the promise to load Rust code fails we log any errors happening instead of accidentally failing silently. This helped debug a bit in rustwasm#897
#906 fixes using |
This commit employs the strategy described in rustwasm#908 to apply a non-breaking change to fix WebIDL to be compatible with all browsers, including Safari. The problem here is that `BaseAudioContext` and `AudioScheduledSourceNode` are not types in Safari, but they are types in Firefox/Chrome. The fix here was to move the contents of these two interfaces into mixins, and then include the mixins in all classes which inherit from these two classes. That should have the same effect as defining the methods inherently on the original interface. Additionally a special `[RustDeprecated]` attribute to WebIDL was added to signify interfaces this has happened to. Currently it's directly tailored towards this case of "this intermediate class doesn't exist in all browsers", but we may want to refine and extend the deprecation message over time. Although it's possible we could do this as a breaking change to `web-sys` I'm hoping that we can do this as a non-breaking change for now and then eventually on the next breaking release batch all these changes together, deleting the intermediate classes. This is also hopefully a good trial run for how stable web-sys can be when it's actually stable! cc rustwasm#897 cc rustwasm#908
This commit employs the strategy described in rustwasm#908 to apply a non-breaking change to fix WebIDL to be compatible with all browsers, including Safari. The problem here is that `BaseAudioContext` and `AudioScheduledSourceNode` are not types in Safari, but they are types in Firefox/Chrome. The fix here was to move the contents of these two interfaces into mixins, and then include the mixins in all classes which inherit from these two classes. That should have the same effect as defining the methods inherently on the original interface. Additionally a special `[RustDeprecated]` attribute to WebIDL was added to signify interfaces this has happened to. Currently it's directly tailored towards this case of "this intermediate class doesn't exist in all browsers", but we may want to refine and extend the deprecation message over time. Although it's possible we could do this as a breaking change to `web-sys` I'm hoping that we can do this as a non-breaking change for now and then eventually on the next breaking release batch all these changes together, deleting the intermediate classes. This is also hopefully a good trial run for how stable web-sys can be when it's actually stable! cc rustwasm#897 cc rustwasm#908
This commit employs the strategy described in rustwasm#908 to apply a non-breaking change to fix WebIDL to be compatible with all browsers, including Safari. The problem here is that `BaseAudioContext` and `AudioScheduledSourceNode` are not types in Safari, but they are types in Firefox/Chrome. The fix here was to move the contents of these two interfaces into mixins, and then include the mixins in all classes which inherit from these two classes. That should have the same effect as defining the methods inherently on the original interface. Additionally a special `[RustDeprecated]` attribute to WebIDL was added to signify interfaces this has happened to. Currently it's directly tailored towards this case of "this intermediate class doesn't exist in all browsers", but we may want to refine and extend the deprecation message over time. Although it's possible we could do this as a breaking change to `web-sys` I'm hoping that we can do this as a non-breaking change for now and then eventually on the next breaking release batch all these changes together, deleting the intermediate classes. This is also hopefully a good trial run for how stable web-sys can be when it's actually stable! cc rustwasm#897 cc rustwasm#908
Ok I've confirmed the deployed example does indeed work in safari now! |
It works for me too now, thanks. I've closed this issue yesterday already because the original problem above was fixed and the outstanding error was covered by #908. This too seems to be fixed (at least for this example) now. |
Do you guys have in mind for webkitOfflineAudioContext ? Currently |
@tat-m3dicine is that perhaps another case that's needed here? Would that fix the issue for you? |
@alexcrichton Indeed, it's missing another case. Atm, I will just deal with OfflineAudioContext using |
I've created #1865 for this, @tat-m3dicine mind trying that out and seeing if it works for you? |
The web development console says for https://rustwasm.github.io/wasm-bindgen/exbuild/webaudio/:
The text was updated successfully, but these errors were encountered: