Remove stream url js escaping and do it on server side instead

This commit is contained in:
drigato 2015-04-08 15:19:22 -04:00
parent 94a7643ebc
commit 78b2631980
2 changed files with 6 additions and 16 deletions

View file

@ -35,21 +35,20 @@
};
if (this.playerMode == "manual") {
this.settings.url = htmlEscape("<?php echo $this->streamURL ?>");
this.settings.url = "<?php echo $this->streamURL ?>";
this.settings.codec = "<?php echo $this->codec ?>";
} else if (this.playerMode == "auto") {
this.availableMobileStreamQueue = <?php echo $this->availableMobileStreams?>;
this.availableDesktopStreamQueue = <?php echo $this->availableDesktopStreams?>;
var stream = this.getNextAvailableStream();
this.settings.url = htmlEscape(stream["url"]);
this.settings.url = stream["url"];
this.settings.codec = stream["codec"];
}
// Create the Muses player object
MRP.insert(this.settings);
var station_name = htmlEscape("<?php echo $this->station_name?>");
$("p.station_name").html(station_name);
$("p.station_name").html("<?php echo $this->station_name?>");
attachStreamMetadataToPlayer();
@ -143,7 +142,7 @@
// connection limit reached or problem connecting to stream
if (value === "0") {
var stream = musesPlayer.getNextAvailableStream();
musesPlayer.setURL(htmlEscape(stream["url"]));
musesPlayer.setURL(stream["url"]);
musesPlayer.play();
}
}
@ -218,15 +217,6 @@
setTimeout(attachStreamMetadataToPlayer, time_to_next_track_starts);
}
function htmlEscape(str) {
return String(str)
.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
</script>
<style type="text/css">