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:
parent
05f51a9a2d
commit
3065d56018
2 changed files with 53 additions and 11 deletions
|
@ -175,9 +175,18 @@
|
|||
};
|
||||
|
||||
MusesPlayer.prototype.setURL = function(url) {
|
||||
MRP.setUrl(url);
|
||||
this.flashDetect ? MRP.setUrl(url) : musesHTMLSetURL(url);
|
||||
|
||||
// update musesPlayer object
|
||||
musesPlayer.settings.url = url;
|
||||
};
|
||||
|
||||
MusesPlayer.prototype.setCodec = function(codec) {
|
||||
console.log(codec);
|
||||
//this.flashDetect ? MRP.setCodec(codec) : musesHTMLSetCodec(codec);
|
||||
musesPlayer.settings.codec = codec;
|
||||
}
|
||||
|
||||
/** Retry playback after a few seconds (used to throttle attempts to reconnect/play). */
|
||||
MusesPlayer.prototype.deferredPlay = function(streamUrl, delayMSec) {
|
||||
if (!this.flashDetect) {
|
||||
|
@ -196,6 +205,15 @@
|
|||
}
|
||||
};
|
||||
|
||||
MusesPlayer.prototype.playPodcastTrack = function(url, codec) {
|
||||
this.setCodec(codec);
|
||||
this.setURL(url);
|
||||
musesPlayer.play();
|
||||
if ($('.play').hasClass("pause") === false) {
|
||||
$('.play').addClass("pause");
|
||||
}
|
||||
}
|
||||
|
||||
// detects errors in FLASH mode
|
||||
function musesCallback(event,value) {
|
||||
switch (event) {
|
||||
|
@ -233,12 +251,7 @@
|
|||
|
||||
// Triggers the play function on the Muses player object in HTML5 mode
|
||||
function musesHTMLPlayClick() {
|
||||
/*if (MRP.html === undefined) {
|
||||
console.log("inserting player");
|
||||
MRP.insert(musesPlayer.settings);
|
||||
}*/
|
||||
MRP.html.audio.src = MRP.html.src;
|
||||
|
||||
MRP.html.audio.src = musesPlayer.settings.url;
|
||||
MRP.html.audio.play();
|
||||
}
|
||||
|
||||
|
@ -250,6 +263,18 @@
|
|||
//delete MRP.html;
|
||||
}
|
||||
|
||||
function musesHTMLSetURL(url)
|
||||
{
|
||||
MRP.html.audio.src = url;
|
||||
|
||||
//MRP.html.audio.play();
|
||||
//musesPlayer.play();
|
||||
}
|
||||
|
||||
function musesHTMLSetCodec(codec) {
|
||||
MRP.html.audio.codec = codec;
|
||||
}
|
||||
|
||||
function togglePlayStopButton() {
|
||||
document.getElementById("play_button").classList.toggle("hide_button");
|
||||
document.getElementById("stop_button").classList.toggle("hide_button");
|
||||
|
@ -329,6 +354,17 @@
|
|||
|
||||
// Add 3 seconds to the timeout so Airtime has time to update the metadata before we fetch it
|
||||
metadataTimer = setTimeout(attachStreamMetadataToPlayer, time_to_next_track_starts+3000);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function detachStreamMetadataFromPlayer() {
|
||||
clearTimeout(metadataTimer);
|
||||
}
|
||||
|
||||
function attachFileMetadataToPlayer(artist, title) {
|
||||
//TODO escape strings
|
||||
$("p.now_playing").html(artist+"<span>"+title+"</span>");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue