javascript - 设置HTML5音频位置

标签 javascript google-chrome html5-audio

如何在 HTML5音频元素中跳到某些时间偏移?

他们说您可以简单地设置他们的 currentTime property(强调我的):

The currentTime attribute must, on getting, return the current playback position, expressed in seconds. On setting, if the media element has a current media controller, then it must throw an INVALID_STATE_ERR exception; otherwise, the user agent must seek to the new value (which might raise an exception).



las,它似乎不起作用(我需要在Chrome中使用它)。

有类似的问题,但是没有答案。

最佳答案

适用于my chrome ...

$('#audio').bind('canplay', function() {
  this.currentTime = 29; // jumps to 29th secs
});

关于javascript - 设置HTML5音频位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23713504/

相关文章:

javascript - 单击时添加/删除类,导航 li 项

javascript - 如何获取数组的键,其值等于True

javascript - Vue.js 在挂载和重新启动功能中运行代码

javascript - 按降序对多维数组进行排序

android - Chrome/Android Jingle-SDP ICE 连接失败

windows - Gwt 插件在 Chrome 42 中不起作用

javascript - 在 Chrome 中滚动网页时出现奇怪的问题

javascript - 如何在不需要播放的情况下对 chrome 中的音频文件进行 FFT 分析?

javascript - 加载 <audio> 源 - Firefox 进入就绪状态 2,Chrome 进入就绪状态 4

javascript - ReactJS 在第一次渲染后无法正确渲染 HTML 音频