【发布时间】:2016-07-19 07:23:05
【问题描述】:
我正在尝试使用以下代码在我的 JPlayer 中设置 mp3 声音:
$("#jquery_jplayer_2").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
title: "welcome",
mp3: "C:\Users\test\Desktop\test.mp3"
});
},
cssSelectorAncestor: "#jp_container_2",
swfPath: "/js",
supplied: "mp3",
useStateClassSkin: true,
autoBlur: false,
smoothPlayBar: true,
keyEnabled: true,
remainingDuration: true,
toggleDuration: true,
error: function (event) {
if (event.jPlayer.error.type === $.jPlayer.error.URL) {
alert("Not found");
}
}
});
当我知道 mp3 位置正确时,它会在窗口中显示“未找到”。
【问题讨论】:
-
该位置似乎必须是相对路径。