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

加载音频时各事件触发顺序 #62

Closed
Dream4ever opened this issue Apr 1, 2019 · 0 comments
Closed

加载音频时各事件触发顺序 #62

Dream4ever opened this issue Apr 1, 2019 · 0 comments
Labels
Front-end Everything you see and experience JS Javascript

Comments

@Dream4ever
Copy link
Owner

Dream4ever commented Apr 1, 2019

需求描述

简单记录了加载音频至 audio 标签后,各事件的触发顺序。

loadedmetadata 最先触发。
loadeddata 在其后触发。
canplay 最后触发。

注意

iOS 12 中,Safari 打开包含音频页面的话,会尝试预加载音频,所以上述事件在页面加载完成后就会触发。
但是在微信中不会预加载音频,所以上述事件只在点击播放按钮之后才会触发。
iOS 7 中,即使在 Safari 中也不会预加载音频,必须手动点击播放按钮之后,才会触发上述事件。

@Dream4ever Dream4ever added Front-end Everything you see and experience JS Javascript labels Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Front-end Everything you see and experience JS Javascript
Projects
None yet
Development

No branches or pull requests

1 participant