Setting the currentTime of an <audio> tag not working?

前端 未结 6 662
生来不讨喜
生来不讨喜 2020-12-31 07:41

I have this audio tag playing in the background, and I\'m able to store the progress in seconds to a cookie. But in no way I\'m able to start the audio from that cookie. (fo

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-31 08:13

    You can set the start time by adding t= to the URL, as documented here: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video#Specifying_playback_range

    E.g.

提交回复
热议问题