You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click the 'click me' button and the audio will play.
What is expected?
It can play well in all of the modern browsers that support audio.
What is actually happening?
In PC browsers, it can play well. However, in some mobile browsers, such as iOS Safari、iOS Wechat Webview、Android Chrome,it can not play.
In Vue 2.4 or below, the nextTick function use microTask, like MutationObserver or Promise at first,the click callback and audio play function are in the same tick,so it can play well in all browsers.
Howerver, in Vue 2.5 ,macroTask will be used in DOM action, so the click callback and audio play function are not in the same tick. If we just use setTimeout 0, it will be fine, but actually MessageChannel will be firstly used because of the priority, which lead to the audio can not play in some mobile browsers mentioned above.