Remove stream url js escaping and do it on server side instead
This commit is contained in:
parent
94a7643ebc
commit
78b2631980
2 changed files with 6 additions and 16 deletions
|
@ -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, '&')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue