5
function intilizePlayer(){
$("#jquery_jplayer_1").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", {
oga:song
});
songDuration = $(this).jPlayer.status.duration;
},
ended: function (event) {
$(this).jPlayer("play");
},
swfPath: "swf",
supplied: "oga"
}).bind($.jPlayer.event.play, function() {
$(this).jPlayer("pauseOthers");
});
}
在這裏,我嘗試獲取歌曲的持續時間。但它說「未定義」。除此之外,我試圖在調用上述函數後使用以下內容。如何在JPlayer中獲得歌曲的持續時間
var duration = $("#jquery_jplayer_1").data("jPlayer").status.duration;
然後持續時間變爲0.如何獲得真實持續時間?