VLC嵌入式PHP播放列表

vlc embedded php playlist

本文关键字:播放列表 PHP 嵌入式 VLC      更新时间:2023-09-26

我想为嵌入在网页上的VLC播放器创建php播放列表。我希望当我点击按钮改变歌曲或电影,而不刷新页面。我希望所有的电影和歌曲都在php文件内,因为歌曲和电影的url路径将从mysql基地直接检索。同样重要的是,频道列表不能对所有人都可见。在javascript中,所有歌曲的url路径链接都是可见的。

也可以加密VLC的目标名称,如果真实链接是http://xxx.xx.org/test/lista/u2-one.avi要加密在http%3A%2F%2Fxxx.xx.org%2Ftest%2Flista%2Fu2-one.avi

例子
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
width="300"
height="300"
name="tv"
target="<?php echo $movie ?>"
id="tv">
php播放列表

<?php
 $movie = 'http://xxx.xx.org/test/lista/u2-one.avi';
 $mp3='http://xxx.xx.org/test/lista/coldplay-yellow.mp3';
 $coldplay='http://xxx.xx.org/test/lista/coldplay-paradise.mp3';
?>

例子
<button onclick="vlc.playlist.playItem(0); ">Coldplay</button>

这里有很多解释,但我没有javascript的经验。

您的播放列表中只包含$movie。您需要填充播放列表vlc.playlist.add(mrl,name,options),然后您可以使用vlc.playlist.playItem(number)

JS:

var options = new Array();
var id1 = vlc.playlist.add('http://xxx.xx.org/test/lista/u2-one.avi', "Movie", options);
var id2 = vlc.playlist.add('http://xxx.xx.org/test/lista/coldplay-yellow.mp3', "Mp3", options);
var id3 = vlc.playlist.add('http://xxx.xx.org/test/lista/coldplay-paradise.mp3', "Coldplay", options);
HTML:

<button onclick="vlc.playlist.playItem(id3);">Coldplay</button>