HTML5音频currentTime的不工作 [英] html5 audio currentTime doesn't work

查看:148
本文介绍了HTML5音频currentTime的不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道为什么,但它不工作。
我有这样的:

I don't know why but it doesn't work. I have this:

function stop()
{
  audio.pause();
  audio.currentTime = 0;
}

当我currentTime的值更改为0,没有什么变化......也就是说,currentTime的继续具有previous值。

When I change the value of currentTime to 0, nothing changes...that is, currentTime continues having the previous value.

推荐答案

我解决它:

audio.pause();
audio.src = audio.src;

它重新加载音频标签,并设置currentTime的0

It reload the audio tag, and set currentTime to 0

这篇关于HTML5音频currentTime的不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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