Skip to content

Instantly share code, notes, and snippets.

@nhjm449
Created July 18, 2016 23:31
Show Gist options
  • Save nhjm449/09f9a907f5f01200caf92a7d708ba047 to your computer and use it in GitHub Desktop.
Save nhjm449/09f9a907f5f01200caf92a7d708ba047 to your computer and use it in GitHub Desktop.
hls.js demo page JavaScript proxy
<?php
if (isset($_GET['v']) && $_GET['v'] !== '') {
header('Content-Type: text/javascript');
if ($_GET['v'] === 'v0.5.41-custom') {
$script = file_get_contents('hls-v0.5.41-custom.js');
} else {
$script = file_get_contents('https://github.com/dailymotion/hls.js/raw/' . urlencode($_GET['v']) . '/dist/hls.js');
}
if (strlen($script) > 0) {
echo $script;
} else {
echo 'alert("Invalid version tag!");';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment