diff --git a/view/hls.php b/view/hls.php index c0a701763..d53318d55 100644 --- a/view/hls.php +++ b/view/hls.php @@ -1,99 +1,99 @@ isTokenValid($_GET['token'], $fname, $_GET['videoDirectory']); } } else if (!empty($_GET['globalToken'])) { $tokenIsValid = verifyToken($_GET['globalToken']); } $newContent = ""; // if is using a CDN I can not check if the user is logged if (isAVideoEncoderOnSameDomain() || $tokenIsValid || !empty($advancedCustom->videosCDN) || User::canWatchVideo($video['id']) || isCDN()) { if (!empty($_GET['download'])) { downloadHLS($_GET['file']); } else if (!empty($_GET['playHLSasMP4'])) { playHLSasMP4($_GET['file']); } else { $filename = pathToRemoteURL($filename); $content = file_get_contents($filename); $newContent = str_replace('{$pathToVideo}', "{$global['webSiteRootURL']}videos/{$_GET['videoDirectory']}/../", $content); if (!empty($_GET['token'])) { $newContent = str_replace('/index.m3u8', "/index.m3u8?token={$_GET['token']}", $newContent); } else if (!empty($_GET['globalToken'])) { $newContent = str_replace('/index.m3u8', "/index.m3u8?globalToken={$_GET['globalToken']}", $newContent); } } } else { $newContent = "HLS.php Can not see video [{$video['id']}] ({$_GET['videoDirectory']}) "; $newContent .= $tokenIsValid ? "" : " tokenInvalid"; $newContent .= User::canWatchVideo($video['id']) ? "" : " cannot watch ({$video['id']})"; $newContent .= " " . date("Y-m-d H:i:s"); } //header("Content-Type: text/plain"); header('Content-Type:'); echo $newContent;