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

MP3播放器问题 #7

Closed
jessjava opened this issue Feb 24, 2017 · 2 comments
Closed

MP3播放器问题 #7

jessjava opened this issue Feb 24, 2017 · 2 comments

Comments

@jessjava
Copy link

您好。MP3播放器使用的是 audio 标签吗?如何解决边加载边播放呢?
现在碰到的问题是。点击之后等待加载完成(好几 M),才播放。体验很不好。(服务端是 MP3
文件)
有没有什么好的解决方案?

@nanedo
Copy link

nanedo commented Feb 24, 2017

HTTP/1.1 里新增了一个 header field 叫做 range 的字段,服务器支持这个就可以实现边下载边播放。

@javaswing
Copy link
Owner

javaswing commented Feb 28, 2017

@jessjava 是用的audio标签,请参考:http://www.cnblogs.com/tianma3798/p/6033108.html, 做的时候并没有加载完成才播放,他有一个canPlay方法,只要浏览器判断加载数据能播放的时候就会自动播放。没有必要加载完成!

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

No branches or pull requests

3 participants