CC-1665: Scheduled stream rebroadcasting and recording
-ability to preview webstreams
This commit is contained in:
parent
c69dac7ab6
commit
b53bc36f4f
6 changed files with 47 additions and 23 deletions
|
@ -35,7 +35,8 @@ $(document).ready(function(){
|
|||
|
||||
$.jPlayer.timeFormat.showHour = true;
|
||||
|
||||
var audioFileID = $('.audioFileID').text();
|
||||
var audioUri = $('.audioUri').text();
|
||||
//var audioFileID = $('.audioFileID').text();
|
||||
var playlistID = $('.playlistID').text();
|
||||
var playlistIndex = $('.playlistIndex').text();
|
||||
var showID = $('.showID').text();
|
||||
|
@ -47,8 +48,8 @@ $(document).ready(function(){
|
|||
|
||||
if (playlistID != "" && playlistID !== ""){
|
||||
playAllPlaylist(playlistID, playlistIndex);
|
||||
}else if (audioFileID != "") {
|
||||
playOne(audioFileID);
|
||||
}else if (audioUri != "") {
|
||||
playOne(audioUri);
|
||||
}else if (showID != "") {
|
||||
playAllShow(showID, showIndex);
|
||||
}else if(blockId != "" && blockIndex != ""){
|
||||
|
@ -179,18 +180,18 @@ function play(p_playlistIndex){
|
|||
* Playing one audio track occurs from the library. This function will create the media, setup
|
||||
* jplayer and play the track.
|
||||
*/
|
||||
function playOne(p_audioFileID) {
|
||||
function playOne(uri) {
|
||||
var playlist = new Array();
|
||||
var fileExtension = p_audioFileID.split('.').pop();
|
||||
var fileExtension = uri.split('.').pop();
|
||||
if (fileExtension.toLowerCase() === 'mp3') {
|
||||
media = {title: $('.audioFileTitle').text() !== 'null' ?$('.audioFileTitle').text():"",
|
||||
artist: $('.audioFileArtist').text() !== 'null' ?$('.audioFileArtist').text():"",
|
||||
mp3:"/api/get-media/file/"+p_audioFileID
|
||||
mp3:uri
|
||||
};
|
||||
}else if (fileExtension.toLowerCase() === 'ogg' ) {
|
||||
} else if (fileExtension.toLowerCase() === 'ogg' ) {
|
||||
media = {title: $('.audioFileTitle').text() != 'null' ?$('.audioFileTitle').text():"",
|
||||
artist: $('.audioFileArtist').text() != 'null' ?$('.audioFileArtist').text():"",
|
||||
oga:"/api/get-media/file/"+p_audioFileID
|
||||
oga:uri
|
||||
};
|
||||
}
|
||||
_playlist_jplayer.option("autoPlay", true);
|
||||
|
|
|
@ -43,15 +43,18 @@ function openAudioPreview(p_event) {
|
|||
}
|
||||
}
|
||||
|
||||
function open_audio_preview(audioFileID, audioFileTitle, audioFileArtist) {
|
||||
function open_audio_preview(type, id, audioFileTitle, audioFileArtist) {
|
||||
// we need to remove soundcloud icon from audioFileTitle
|
||||
var index = audioFileTitle.indexOf("<span class=");
|
||||
if(index != -1){
|
||||
audioFileTitle = audioFileTitle.substring(0,index);
|
||||
}
|
||||
openPreviewWindow('audiopreview/audio-preview/audioFileID/'+audioFileID+'/audioFileArtist/'+audioFileArtist+'/audioFileTitle/'+audioFileTitle);
|
||||
|
||||
openPreviewWindow('audiopreview/audio-preview/audioFileID/'+id+'/audioFileArtist/'+audioFileArtist+'/audioFileTitle/'+audioFileTitle+'/type/'+type);
|
||||
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
*Opens a jPlayer window for the specified info, for either an audio file or playlist.
|
||||
*If audioFile, audioFileTitle, audioFileArtist is supplied the jplayer opens for one file
|
||||
|
@ -96,12 +99,7 @@ function open_show_preview(p_showID, p_showIndex) {
|
|||
}
|
||||
|
||||
function openPreviewWindow(url) {
|
||||
|
||||
//$.post(baseUri+'Playlist/audio-preview-player', {fileName: fileName, cueIn: cueIn, cueOut: cueOut, fadeIn: fadeIn, fadeInFileName: fadeInFileName, fadeOut: fadeOut, fadeOutFileName: fadeOutFileName})
|
||||
_preview_window = window.open(url, 'Audio Player', 'width=450,height=100,scrollbars=yes');
|
||||
//Set the play button to pause.
|
||||
//var elemID = "spl_"+elemIndexString;
|
||||
//$('#'+elemID+' div.list-item-container a span').attr("class", "ui-icon ui-icon-pause");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -423,7 +423,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
playlistIndex = $(this).parent().attr('id').substring(3); //remove the pl_
|
||||
open_playlist_preview(playlistIndex, 0);
|
||||
} else if (aData.ftype === 'audioclip') {
|
||||
open_audio_preview(aData.audioFile, aData.track_title, aData.artist_name);
|
||||
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
|
||||
} else if (aData.ftype == 'stream') {
|
||||
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
@ -637,7 +639,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
playlistIndex = $(this).parent().attr('id').substring(3); //remove the pl_
|
||||
open_playlist_preview(playlistIndex, 0);
|
||||
} else if (data.ftype === 'audioclip') {
|
||||
open_audio_preview(data.audioFile, data.track_title, data.artist_name);
|
||||
open_audio_preview(data.ftype, data.audioFile, data.track_title, data.artist_name);
|
||||
} else if (data.ftype === 'block') {
|
||||
blockIndex = $(this).parent().attr('id').substring(3); //remove the pl_
|
||||
open_block_preview(blockIndex, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue