Insert values into JWPlayer setup 'file' 来自数据库的源
Insert values into JWPlayer setup 'file' source from database
另一个JWPlayer问题;是否可以使用 SQL 数据库中的 URL 数组而不是硬编码 JWPlayer 的 URL 源代码?
jwplayer("mainplayer").setup({
playlist: [{
file: "https://www.youtube.com/watch?v=uO7kCUjUaUE"
}],
primary:"flash",
autostart: true,
});
以上脚本显示了 URL 实现的硬编码。
<?php
$conn=mysql_connect("localhost", "USER", "PASSWORD")
or die ("Cannot Connect to MYSQL");
mysql_select_db("DATABASENAME", $conn)
or die ("Cannot Connect to the Database");
$id = $_GET['song_id'];
$data = mysql_fetch_array(mysql_query("SELECT * FROM music WHERE id='$id'"));
?>
jwplayer("mainplayer").setup({
playlist: [{
file: "<?php echo $data['URL'] ?>"
}],
primary:"flash",
autostart: true,
});
JWPlayer 是否支持将URL 的数组以这种方式聚集在一起用于单个播放器并连续播放?谢谢大家
变化:
file: "<?php echo $data['URL'] ?>"
收件人:
file: "<?php echo $data['URL'] ?>",
type: "mp4"
所以完整的事情是:
jwplayer("mainplayer").setup({
playlist: [{
file: "<?php echo $data['URL'] ?>",
type: "mp4"
}],
primary:"flash",
autostart: true
});
另一个JWPlayer问题;是否可以使用 SQL 数据库中的 URL 数组而不是硬编码 JWPlayer 的 URL 源代码?
jwplayer("mainplayer").setup({
playlist: [{
file: "https://www.youtube.com/watch?v=uO7kCUjUaUE"
}],
primary:"flash",
autostart: true,
});
以上脚本显示了 URL 实现的硬编码。
<?php
$conn=mysql_connect("localhost", "USER", "PASSWORD")
or die ("Cannot Connect to MYSQL");
mysql_select_db("DATABASENAME", $conn)
or die ("Cannot Connect to the Database");
$id = $_GET['song_id'];
$data = mysql_fetch_array(mysql_query("SELECT * FROM music WHERE id='$id'"));
?>
jwplayer("mainplayer").setup({
playlist: [{
file: "<?php echo $data['URL'] ?>"
}],
primary:"flash",
autostart: true,
});
JWPlayer 是否支持将URL 的数组以这种方式聚集在一起用于单个播放器并连续播放?谢谢大家
变化:
file: "<?php echo $data['URL'] ?>"
收件人:
file: "<?php echo $data['URL'] ?>",
type: "mp4"
所以完整的事情是:
jwplayer("mainplayer").setup({
playlist: [{
file: "<?php echo $data['URL'] ?>",
type: "mp4"
}],
primary:"flash",
autostart: true
});