I changed some code to get this fixed:
netjukebox version 6.03.2 and VLC 2.1.5
config.php
Code: Select all
function initialize() {
configform.name.focus();
<?php
if ($cfg['player_type'] == NJB_MPD) {
echo "\tconfigform.player_pass.className = 'short readonly';\n";
echo "\tconfigform.media_share.className = 'short readonly';\n";
echo "\tconfigform.player_pass.disabled = true;\n";
echo "\tconfigform.media_share.disabled = true;\n";
}
//if ($cfg['player_type'] == NJB_VLC){ -----------> VLC > 2.1.0 needs a password for the http interface
// echo "\tconfigform.player_pass.className = 'short readonly';\n";
// echo "\tconfigform.player_pass.disabled = true;\n";
//}
?>
}
Code: Select all
function vlcDefault() {
configform.name.value = 'VideoLAN';
configform.player_port.value = '8080';
configform.player_pass.value = '';
configform.player_pass.className = 'short readonly';
configform.media_share.className = 'short';
configform.player_pass.disabled = false;
configform.media_share.disabled = false;
serverDefault();
}
Code: Select all
function savePlayerProfile() {
global $cfg, $db;
authenticate('access_admin', false, true, true);
$player_id = @$_POST['player_id'];
$player_name = @$_POST['name'];
$player_type = @$_POST['player_type'];
$player_host = @$_POST['player_host'];
$player_port = @$_POST['player_port'];
$player_pass = @$_POST['player_pass'];
$media_share = @$_POST['media_share'];
$media_share = urlSyntaxFix($media_share);
//if ($player_type == NJB_VLC) {
// $player_pass = '';
//}
if ($player_type == NJB_MPD) {
$player_pass = '';
$media_share = '';
}
config.inc.php
Code: Select all
// +------------------------------------------------------------------------+
// | videoLAN |
// +------------------------------------------------------------------------+
function vlc($command) { // -----------> VLC > 2.1.0 needs a password for the http interface
global $cfg;
$request = 'GET /requests/status.xml?command=' . $command . ' HTTP/1.1' . "\r\n";
$request .= 'Host: ' . $cfg['player_host'] . ':' . $cfg['player_port'] . "\r\n";
$request .= 'Connection: Close' . "\r\n";
$request .= 'Authorization: Basic ' . base64_encode(':' . $cfg['player_pass']) . "\r\n\r\n";
$soket = @fsockopen($cfg['player_host'], $cfg['player_port'], $error_no, $error_string, 1) or message(__FILE__, __LINE__, 'error', '[b]videoLAN error[/b][br]Failed to connect to: ' . $cfg['player_host'] . ':' . $cfg['player_port'] . '[br]' . $error_string . '[br][url=config.php?action=playerProfile][img]small_vlc.png[/img]Player profile[/url]');
@fwrite($soket, $request) or message(__FILE__, __LINE__, 'error', '[b]videoLAN error[/b][br]Failed to write to: ' . $cfg['player_host'] . ':' . $cfg['player_port']);
$content = stream_get_contents($soket);
fclose($soket);
$temp = explode("\r\n\r\n", $content, 2);
if (isset($temp[1])) {
$header = $temp[0];
$content = $temp[1];
}
return $content;
}
Fe-X