SAAS-1156: Podcast episode playback and download from Radio Page

Playback works in HTML mode for mp3 files only right now.
Added a function that changes the player iframe's src attribute
so it plays individual tracks.
This commit is contained in:
drigato 2015-10-27 16:00:15 -04:00
parent 1211e8db7f
commit 09efacf4d5
3 changed files with 18 additions and 1 deletions

View File

@ -54,6 +54,10 @@ class EmbedController extends Zend_Controller_Action
array_push($availableDesktopStreams, $s);
}
}
} else if ($stream == "file") {
$this->view->playerMode = "file";
$this->view->streamURL = json_encode($request->getParam("file_url"));
$this->view->codec = $request->getParam("file_codec");
} elseif (!empty($stream)) {
$this->view->playerMode = "manual";
$selectedStreamData = $streamData[$stream];

View File

@ -40,6 +40,9 @@
if (this.playerMode == "manual") {
this.settings.url = <?php echo $this->streamURL ?>;
this.settings.codec = "<?php echo $this->codec ?>";
} else if (this.playerMode == "file") {
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?>;
@ -213,6 +216,7 @@
if (musesPlayer.playerMode == "auto") {
var stream = musesPlayer.getNextAvailableStream();
musesPlayer.deferredPlay(stream["url"], RETRY_DELAY_MSECS);
} else if (musesPlayer.playerMode == "file") {
} else {
// If in manual mode and there is a problem connecting to
// the stream display an error and stop play back.

View File

@ -57,7 +57,16 @@ document.getElementById(id).width= (newwidth) + "px";
$.each(<?php echo $this->episodes ?>, function(index, value){
$("#tab-4").append("<div>"+value.track_metadata.artist_name+" - "+value.track_metadata.track_title+
" <a id='rss-download-link' href='"+value.download_url+"'>Download</a>" +
" <a id='rss-play-link' href='#'>Play</a></div>");
" <a id='rss-play-link' data-streamurl='"+value.download_url+"' data-streamcodec='mp3' href='#'>Play</a></div>");
});
$("a#rss-play-link").click(function() {
var file_url = $(this).attr("data-streamurl");
var file_codec = $(this).attr("data-streamcodec");
var new_src='<?php echo $this->stationUrl ?>'+"embed/player?stream=file&file_url="+file_url+"&file_codec="+file_codec+"&style=premium";
$("#player_iframe").attr("src", new_src);
});
</script>
</div>