HTML audio can't set currentTime

后端 未结 8 969
予麋鹿
予麋鹿 2020-11-30 05:22

I am using Chrome. In my dev tools console, I tried the following:

Everything works as expected except last line. Why can\'t I set currentTime

8条回答
  •  臣服心动
    2020-11-30 06:07

    I ran into this problem after I'd started to use the PHP Server extension to VS Code to serve my HTML/PHP local testing. The problem was resolved for me by going back to my old Abysswebserver setup.

    So, it's not simply that "you can't manipulate .currentTime on locally served files" but rather that "you need to pick a server that gives you the right headers". The Status entry for my file from AbyssWebserver, for example, read "Status Code: 206 Partial Content" while the one from PHP Server read "Status Code: 200 OK".

    There are other differences though so there may be more to this than just the Status entry. See https://github.com/brapifra/vscode-phpserver/issues/85, for a full header comparison.

提交回复
热议问题