2015-10-27 124 views
1

之前,我問我的問題,我只想說,我是一個小白爲Javascript並在總體上的StackOverflow,所以我想,如果這個問題是太愚蠢提前道歉。song.currentTime返回undefined

不管怎麼說,我學習JavaScript和我現在正在與currentTime的嘗試,但由於某種原因song.currentTime被返回undefined,我也不能設置currentTime的。這裏是我的代碼:

​​

這是在行動(看控制檯輸出):http://dancingcats.azurewebsites.net/

+0

您正在使用哪種瀏覽器和瀏覽器版本? –

+0

@JayantiLal Chrome,但有人已經爲我解決了它。 – user1478676

回答

3

currentTime財產屬於audio elementMedia

你需要的是設置到音頻元素不到源元素

<audio autoplay id="awesomeness"> 
<source src="A.mp3" type="audio/mpeg"> 
Your browser does not support the audio element. 
</audio> 
+0

你是救生員。謝謝。 – user1478676