我希望在我试图放在我的博客(博客平台)上的这个自定义 jplayer mp3 上获得一些帮助。在编码方面,我基本上对这个词的所有含义都很熟悉。我从这里开始按照本教程进行操作,并做了所有事情,但我仍然无法让播放器工作。这是代码。任何帮助将不胜感激,因为我几天来一直在做这件事。
$(文档).ready(函数() {
// 使用 jQuery 对象,而不是 $
var mediaPlayer = jQuery('#mediaContainer');
mediaPlayer.jPlayer({
// Tells JPlayer where to find the SWF file.
swfPath: 'https://sites.google.com/site/maestromuzic/Jplayer.swf',
// Fix for some older Andriod phones.
solution: "flash, html",
// Tells the player that the track is available in:
// mp3, Ogg Vorbis and Wave formats.
supplied : 'mp3',
// Assigns the CSS selectors which will control the player,
// creating buttons.
cssSelector: {
play: '#playButton',
pause: '#pauseButton',
stop: '#stopButton'
},
// Assigns the files for each format, once the player is loaded.
ready: function() {jQuery(this).jPlayer("setMedia", {
mp3: 'http://files.mboxdrive.com/1296462407/Lutan Fyah - Badmind.mp3',
});}
});
$('#playButton').click(function() {
$('#mediaContainer').jPlayer('play');
});
$('#pauseButton').click(function() {
$('#mediaContainer').jPlayer('pause');
});
$('#stopButton').click(function() {
$('#mediaContainer').jPlayer('stop');
});
});
</script>
<div id="mediaPlayer">
<div id="mediaContainer">
</div>
<div id="playButton">
Play</div>
<div id="pauseButton">
Pause</div>
<div id="stopButton">
Stop</div>
</div><code>