DIYgod / APlayer

:lollipop: Wow, such a beautiful HTML5 music player
http://aplayer.js.org
MIT License
7.33k stars 1.03k forks source link

Unable to set playback progress #607

Open huangchanghuai opened 4 years ago

huangchanghuai commented 4 years ago

image

For example, my mouse set the music playback schedule to 02:13. When I let go, the music started playing again from 00:00

ap.seek ( time:s )The way the problem is the same

lazy-phosphorus commented 1 year ago

This is due to the “NO-CACHE” header which is the response from server. When you drag the progress bar, browser will reload the resources. ap.seek() is also invalid when “NO-CACHE” is enable.

老哥我看你的repo有中文,那我就直接中文说了,你的服务器是不是开了 “NO-CACHE” 响应标头,开了那进度条就会失效。如果是在本地调试,例如HEXO,在动态编译的情况下(即不生成html文件,直接作为本地服务器预览网页)HEXO会默认开启 “NO-CACHE” 响应标头,只需要先生成静态文件(hexo g)再于hexo s 的时候追加参数 -s 就可以指定只展示静态文件,这个时候进度条又是有效的,ap.seek() 也一样