< audio>标签倒带 [英] <audio> tags rewind

查看:76
本文介绍了< audio>标签倒带的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以成功地将音频标签嵌入我的网站并进行播放.不幸的是,将currentTime设置为零会在我尝试的每个Web浏览器中引发错误.

I can successfully embed the audio tag into my websites and play them. Unfortunately setting the currentTime to zero throws an error in every web browser I try.

如何将音频剪辑倒带到开头?

How do I rewind the audio clips to the beginning?

推荐答案

您的资源必须是可搜索的,否则,如果您尝试设置currentTime属性,它将引发异常.另外,您只想将currentTime设置为seekable属性指定的范围.范围从startTime开始,一直到持续时间.

Your resource has to be seekable or it will throw an exception if you try to set the currentTime attribute. Also, you only want to set currentTime to the range specified by the seekable attribute. The range starts at startTime and goes to duration.

这篇关于< audio>标签倒带的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆