作者Cayley (水色天蓝)
看板Ajax
标题[问题] 请问一下如何设定audio的终点
时间Mon Apr 11 13:13:28 2011
好像有两种方式可以设定audio的起点
一种是设定他的attribute
audio.currentTime
另一种是直接填到 audio.play( startTime ) 之中
不过我却找不到方法可以设定播放的终点
有Google到疑似解答的网站
http://www.w3.org/TR/html5/video.html#text-track-cue-start-time
但照着作的时候作不太出来
想请问各位大大,要如何设定audio的播放终点呢??
底下是我写的小程式
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<header>
<audio src='
http://www.theqi.com/buddhism/GL1/audio/024B.MP3' id="audio"
controls></audio>
<script>
var init = function(){
var audio = document.getElementById("audio");
audio.currentTime = 10
}
</script>
<p>
<button type="button" onclick="audio.play();">Play</button>
<button type="button" onclick="audio.pause();">Pause</button>
<button type="button" onclick="audio.currentTime = 0;"><<
Rewind</button>
</p>
</header>
<body onload="init();">
</body>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 203.73.55.214