gpt4 book ai didi

javascript - Jplayer 播放列表未定义

转载 作者:行者123 更新时间:2023-11-29 11:33:15 26 4
gpt4 key购买 nike

您好,感谢您提供的任何帮助。我是网络开发的新手。我意识到这看起来非常糟糕,但是我试图在设计它之前获得功能。 PHP 一直是一场又一场的噩梦。

我正在从 mysql 数据库中提取歌曲列表,这些歌曲应该放入 jplayer 播放列表中。我一生都不明白为什么我不断收到此错误:jplayer.php: Uncaught ReferenceError :jPlayerPlaylist 未定义。我需要帮助调试这个,请记住我是全新的......我知道我是一个糟糕的程序员。

    <?
$localhost='127.0.0.1';
$username='root';
$password='';
$database='radio';
$link = mysqli_connect($localhost, $username, $password, $database);
?>
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="UTF-8" />
<title>Radio Station </title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"> </script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.jplayer.min.js"></script>
<script type="text/javascript" src="js/jquery.jplayer.js"></script>

<link type="text/css" href="skin/pink.flag/css/jplayer.pink.flag.min.css" rel="stylesheet" />
</head>
<body>
<header>
<ul>
<li><a href="#.php">Noonish Nineties</a></li>
<li><a href="#.php">Late Afternoon Indie</a></li>
<li><a href="#.php">Late With Nocturnal</a></li>
</ul>
</header>

<section id="container">
<style>

#container
{
position: relative;
width: 95%;
padding-top: 150px;
padding-left: 100px;
padding-right: 10px;
margin: 15 auto;
font-family: Sans-Serif;
font-size: 120%;
border: 5px solid gray;
background-color: white;

}
</style>

<?php
$localhost='127.0.0.1';
$username='root';
$password='';
$database='radio';
$link = mysqli_connect($localhost, $username, $password, $database);
$baseurl = "music/";
$sql2 = "SELECT GROUP_CONCAT(url) as path FROM track WHERE trackid IN
(SELECT pt.trackid from playlisttrack pt, track t, playlist p WHERE t.trackid = pt.trackid
AND pt.playlistid = p.playlistid AND p.playlistid = 60002)";
if($s2_query = mysqli_query($link,$sql2))
{

while ($row = $s2_query->fetch_assoc())
{
$playlist = "[" . "'" . $row['path'] . "'" . "]";
}

}
?>
<script type="text/javascript">
$(document).ready(function(){
var playlist = <?php echo $playlist;?>;
var myPlaylist = new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_N",
cssSelectorAncestor: "#jp_container_N"
}, playlist, {
playlistOptions: {
enableRemoveControls: true
},
swfPath: "/js",
supplied: "ogv, m4v, oga, mp3",
smoothPlayBar: true,
keyEnabled: true,
audioFullScreen: false // Allows the audio poster to go full screen via keyboard
});
//var cssSelector = { jPlayer: "#playlist_1", cssSelectorAncestor: "#playlist_container" };

//var options = { swfPath: "/js", supplied: "mp3", smoothPlayBar: true, autoPlay: true, keyEnabled: true, shuffleOnLoop: true, wmode: "window" };
//var myPlaylist = new jPlayerPlaylist(cssSelector, playlist, options);
});
</script>
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div id="jp_container_1" class="jp-audio" role="application" aria- label="media player">
<div class="jp-type-single">
<div class="jp-gui jp-interface">
<div class="jp-volume-controls">
<button class="jp-mute" role="button" tabindex="0">mute</button>
<button class="jp-volume-max" role="button" tabindex="0">max volume</button>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
</div>
<div class="jp-controls-holder">
<div class="jp-controls">
<button class="jp-play" role="button" tabindex="0">play</button>
<button class="jp-stop" role="button" tabindex="0">stop</button>
</div>
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-current-time" role="timer" aria- label="time">&nbsp;</div>
<div class="jp-duration" role="timer" aria- label="duration">&nbsp;</div>
<div class="jp-toggles">
<button class="jp-repeat" role="button" tabindex="0">repeat</button>
</div>
</div>
</div>
<div class="jp-details">
<div class="jp-title" aria-label="title">&nbsp;</div>
</div>
<div class="jp-no-solution">
<span>Update Required</span>
To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
</div>
</div>
</div>

<br>
<br>
<br>
<br>
<br>
</section>
<?php
mysqli_close($link);
?>
</body>

谢谢。

最佳答案

jPlayerPlaylist是jplayer的附加组件,默认情况下不包含它,所以你必须先包含它,你可以在dist/add-on文件夹中找到它

关于javascript - Jplayer 播放列表未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37046433/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com