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

Playback is working in HTML5 mode and integrated with player bar
This commit is contained in:
drigato 2015-10-28 16:28:56 -04:00
parent 05f51a9a2d
commit 3065d56018
2 changed files with 53 additions and 11 deletions

View file

@ -57,18 +57,25 @@ document.getElementById(id).width= (newwidth) + "px";
<div id="tab-4" class="station_rss tab_content">
<script type="text/javascript">
$.each(<?php echo $this->episodes ?>, function(index, value){
console.log(value.track_metadata.track_title);
$("#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' data-streamurl='"+value.download_url+"' data-streamcodec='mp3' href='#'>Play</a></div>");
" <a id='rss-play-link' data-metaartist='"+value.track_metadata.artist_name+"' data-metatitle='"+value.track_metadata.track_title+"' 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 artist_name = $(this).attr("data-metaartist");
var track_title = $(this).attr("data-metatitle");
console.log(track_title);
var new_src='<?php echo $this->stationUrl ?>'+"embed/player?stream=file&file_url="+file_url+"&file_codec="+file_codec+"&style=premium";
//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);
document.getElementById("player_iframe").contentWindow.musesPlayer.playPodcastTrack(file_url, file_codec);
document.getElementById("player_iframe").contentWindow.detachStreamMetadataFromPlayer();
document.getElementById("player_iframe").contentWindow.attachFileMetadataToPlayer(artist_name, track_title);
//console.log(document.getElementById("player_iframe").contentWindow.musesPlayer);
});
</script>
</div>
@ -82,7 +89,6 @@ document.getElementById(id).width= (newwidth) + "px";
<script type="text/javascript">
$(document).ready(function(){
$("#player_iframe").load(function () {
// FIXME: Should we hide this somehow when the station is set to private?
$("#player_iframe").contents().find('.bottom_bar').append("<div class='station_rss_btn button' data-tab='tab-4'></div>");