Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<audio src="file.ogg" type="audio/ogg" controls="controls"></audio>
为什么这个 jQuery/JavaScript 有效:
var audio = $('audio').get(0); audio.play();
但这没有?:
var audio = $('audio').get(0); audio.currentTime = 20; audio.play();
jsFiddle
尝试
var audio = $('audio'); audio.bind('canplay', function() { this.currentTime = 20; }); audio.get(0).play();