git.cweiske.de
/
playVideoOnDreamboxProxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5a9b600
)
Filter out chopped DASH segment streams
author
Christian Weiske
<cweiske@cweiske.de>
Thu, 7 Dec 2017 21:59:18 +0000
(22:59 +0100)
committer
Christian Weiske
<cweiske@cweiske.de>
Thu, 7 Dec 2017 21:59:18 +0000
(22:59 +0100)
www/play.php
patch
|
blob
|
history
diff --git
a/www/play.php
b/www/play.php
index ce221e01566964b75217c8e0973a0a2d5e3483eb..d9593a5ab1b97eaa7001dd52c01c4c1c04e0f838 100644
(file)
--- a/
www/play.php
+++ b/
www/play.php
@@
-9,7
+9,11
@@
if (file_exists($cfgFile)) {
$pageUrl = getPageUrl();
$videoUrl = extractVideoUrl($pageUrl, $youtubedlPath);
$pageUrl = getPageUrl();
$videoUrl = extractVideoUrl($pageUrl, $youtubedlPath);
-header('Video-URL: ' . $videoUrl);
+if (php_sapi_name() == 'cli') {
+ echo $videoUrl . "\n";
+} else {
+ header('Video-URL: ' . $videoUrl);
+}
playVideoOnDreambox($videoUrl, $dreamboxHost);
function getPageUrl()
playVideoOnDreambox($videoUrl, $dreamboxHost);
function getPageUrl()
@@
-64,8
+68,12
@@
function extractVideoUrl($pageUrl, $youtubedlPath)
$url = null;
foreach ($data->formats as $format) {
$url = null;
foreach ($data->formats as $format) {
- //dreambox 7080hd does not play hls files
if (strpos($format->format, 'hls') !== false) {
if (strpos($format->format, 'hls') !== false) {
+ //dreambox 7080hd does not play hls files
+ continue;
+ }
+ if ($format->protocol == 'http_dash_segments') {
+ //split up into multiple small files
continue;
}
$url = $format->url;
continue;
}
$url = $format->url;
@@
-127,7
+135,6
@@
function errorInput($msg)
header('HTTP/1.0 400 Bad Request');
header('Content-type: text/plain');
echo $msg . "\n";
header('HTTP/1.0 400 Bad Request');
header('Content-type: text/plain');
echo $msg . "\n";
- syslog(LOG_ERR, 'playVideoOnDreamboxProxy: ' . $httpStatus . ':' . $msg);
exit(1);
}
exit(1);
}