diff options
-rw-r--r-- | contrib/site/index.html | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/contrib/site/index.html b/contrib/site/index.html index c03d1fa..9245c1d 100644 --- a/contrib/site/index.html +++ b/contrib/site/index.html @@ -88,6 +88,7 @@ <script type="text/javascript" src="js/flowplayer/flowplayer-3.2.6.min.js"></script> <script type="text/javascript" src="js/player.js"></script> <script type="text/javascript" src="js/parseLocationHref.js"></script> + <!-- todo: change back to relatie path --> <script type="text/javascript" src="https://stream.elevate.at/js/config.js"></script> <script> var Model = function(config, uri) { @@ -176,31 +177,35 @@ return this.baseUrl + '/' + this.path + '?' + parametersTmp.join('&'); }; - Model.prototype.getStreamUrl = function (thing) { - var url = this.config.streamBaseUrl + '/'; - switch(thing) { - case 'webm': - url += this.parameters.src + '-webm-' + - this.parameters.profile + '.webm'; - break; - case 'hls': - url += 'hls/' + this.parameters.src + '-' + - this.parameters.profile + '/index.m3u8'; - break; - case 'flash': - url += this.parameters.src + '-flash-' + - this.parameters.profile + '.flv'; - break; - case 'ogg': - url += this.parameters.src + '-ogg-' + - this.parameters.profile + '.ogg'; - break; - case 'mp3': - url += this.parameters.src + '-mp3-' + - this.parameters.profile + '.mp3'; - break; - } - return url + '?nocache=' + Date.now(); + Model.prototype.getStreamUrl = function (thing, cache) { + cache = cache || false; + var url = this.config.streamBaseUrl + '/'; + switch(thing) { + case 'webm': + url += this.parameters.src + '-webm-' + + this.parameters.profile + '.webm'; + break; + case 'hls': + url += 'hls/' + this.parameters.src + '-' + + this.parameters.profile + '/index.m3u8'; + break; + case 'flash': + url += this.parameters.src + '-flash-' + + this.parameters.profile + '.flv'; + break; + case 'ogg': + url += this.parameters.src + '-ogg-' + + this.parameters.profile + '.ogg'; + break; + case 'mp3': + url += this.parameters.src + '-mp3-' + + this.parameters.profile + '.mp3'; + break; + } + if (!cache) { + url += '?nocache=' + Date.now(); + } + return url; }; function setResolutions(res) { @@ -287,11 +292,11 @@ function setDirectLinks(model) { $('#footer .direct-links') - .append('<a href="' + model.getStreamUrl('webm') + '">' + model.getStreamUrl('webm') + '</a><br />') - .append('<a href="' + model.getStreamUrl('hls') + '">' + model.getStreamUrl('hls') + '</a><br />') - .append('<a href="' + model.getStreamUrl('flash') + '">' + model.getStreamUrl('flash') + '</a><br />') - .append('<a href="' + model.getStreamUrl('ogg') + '">' + model.getStreamUrl('ogg') + '</a><br />') - .append('<a href="' + model.getStreamUrl('mp3') + '">' + model.getStreamUrl('mp3') + '</a><br />'); + .append('<a href="' + model.getStreamUrl('webm', true) + '">' + model.getStreamUrl('webm', true) + '</a><br />') + .append('<a href="' + model.getStreamUrl('hls', true) + '">' + model.getStreamUrl('hls', true) + '</a><br />') + .append('<a href="' + model.getStreamUrl('flash', true) + '">' + model.getStreamUrl('flash', true) + '</a><br />') + .append('<a href="' + model.getStreamUrl('ogg', true) + '">' + model.getStreamUrl('ogg', true) + '</a><br />') + .append('<a href="' + model.getStreamUrl('mp3', true) + '">' + model.getStreamUrl('mp3', true) + '</a><br />'); } var uri = parseLocationHref(); |