我正在使用这个JS代码
https://kolber.github.io/audiojs/docs/我想知道我是否可以加载并跳转到音轨的特定点。
是否有任何其他方法可以使用html5播放器完成此操作
发布于 2015-08-30 01:30:45
我的方法是在特定的时间点使用jQuery以编程的方式添加音频标签,如下所示:
jQuery('#audio_wrapper').append(
jQuery('<audio/>')
.attr('src','url_of_your_audio_file')
.attr('id','audio')
);然后,按照库文档中的说明编写init代码:
audiojs.events.ready(function() {
var as = audiojs.createAll();
});要跳到特定时间,您可以像操作典型的html5音频一样使用jQuery或javascript:
$('#audio').bind('canplay', function() {
this.currentTime = 29; // jumps to 29th secs
});或者javascript:
document.getElementById('audio').currentTime=(226);https://stackoverflow.com/questions/32288733
复制相似问题