<?php
$youtubedlPath = '/usr/bin/youtube-dl';
-$dreamboxHost = 'dreambox';
+$dreamboxUrl = 'http://dreambox';
require_once __DIR__ . '/functions.php';
$cfgFile = __DIR__ . '/../data/config.php';
include $cfgFile;
}
+//for the firefox extension
+header('Access-Control-Allow-Origin: *');
+
+if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'GET') {
+ require __DIR__ . '/form.php';
+ exit();
+}
+
+set_error_handler('errorHandlerStore');
+
$pageUrl = getPageUrl();
$json = getYoutubeDlJson($pageUrl, $youtubedlPath);
$videoUrl = extractVideoUrlFromJson($json);
} else {
header('Video-URL: ' . $videoUrl);
}
-playVideoOnDreambox($videoUrl, $dreamboxHost);
+playVideoOnDreambox($videoUrl, $dreamboxUrl);
function errorInput($msg)