-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Resume context in Chrome >= 71 #1531
Comments
Is there any solution or workaround to this? Works fine in Firefox but refuses to play in Chrome. |
Yeah, see the link; https://goo.gl/7K7WLu Basically create an AudioContext on a user gesture, like button press, and pass that to wavesurfer using |
@sundayz did you check https://goo.gl/7K7WLu? |
Thanks guys. Calling wavesurfer.backend.ac.resume() myself before wavesurfer.play() works. I'm not sure why it doesn't work without me doing it, since if I look at the code inside WebAudio.play(), WaveSurfer should be calling resume() for me. |
Maybe is better to do it from the outside, because when the Promise from the resuming of the AudioContext is returned, you could want do do more stuffs, instead of only call play. |
https://github.com/katspaugh/wavesurfer.js/blob/master/src/webaudio.js#L684 It is resumed here but doesn’t seem to work 🤔 maybe because it’s inside a Promise...? It works when you resume it before calling play |
It should play only when audioContext is resumed, that is, when the Promise returned from resume method is solved |
I've gotten the waveform to show and get rid of Chrome's (Version 84.0.4147.105) autoplay error when:
|
Same issue there. Can't this be fixed from wavesurfer.js side ? |
I think Chrome wants resume to be called directly in the click handler so it knows for sure the user is the one who started the audio, but play() is a Promise, so resume is not called inside the click handler. This is just a theory. |
@katspaugh is this solved? |
Reopened. |
the script is not working for me either. while it is loading properly and inserting various elements in the DOM, the player does not show up and chrome states the things already mentioned here. None of the solutions mentioned here worked for me. |
seems chrome is following ios safari method as well now, |
Closing because in v7 there's no web audio backend. |
@katspaugh webaudio backend was mostmy used to be able to not wait for full sound to be downloaded to press play in the middle of it (or start). Is this avlaible without it now ? |
It downloads the complete audio file in both cases. One positive difference from v6 though is that the media element receives the same downloaded data as source, so the file is fetched only once. Please see #2762 for more details. |
@katspaugh oh so it will be full HTML5 MediaElement... Interesting, I'll keep on eye on v7 official, especially cause it seems to fix old bugs like double downloads. Thx! |
Hi, I still have the issue, in wavesurfer 7.0.6, at page init, Here is a stripped down version on my init.js, https://gist.github.com/X-Raym/4ac1a331adf5ef3a126e0c3ea4bee240 I don't see what is wrong. In Firefox also there is a console log message: in french:
and in Brave (chrome):
How to fix this? Thx! PS: I'll open a new issue if requested |
Note: brave traceroute goes up to this function in the minified version of wavesurfer 7.0.6 "function" == typeof SuppressedError && SuppressedError;
const e = {
decode: function(e, i) {
return t(this, void 0, void 0, (function*() {
const t = new AudioContext({⚠
sampleRate: i
})
, s = t.decodeAudioData(e);
return s.finally((()=>t.close())),
s
}
))
}, I have added warning sign at the error line |
@X-Raym thanks, I'll open a new issue for this. |
This has nothing to do with that.
No it's not.
Why is this ticket not sufficient? |
@thijstriemstra thanks for your input. I’ve made a new issue to not disturb you with notifications on this one. |
The following warning appears in Chrome >= 71 on wavesurfer-js.org:
https://goo.gl/7K7WLu
The text was updated successfully, but these errors were encountered: