From a57f8e2554d966389abc2adac54152982a7a034c Mon Sep 17 00:00:00 2001 From: James Date: Mon, 9 Apr 2012 15:28:38 -0400 Subject: [PATCH] CC-3488: Update pop up window for jplayer so the size is exactly the same size as the player. - done --- .../public/js/airtime/common/common.js | 3 ++- .../public/js/jplayer/preview_jplayer.js | 23 ++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/public/js/airtime/common/common.js b/airtime_mvc/public/js/airtime/common/common.js index 334b2a2de..81af8b06d 100644 --- a/airtime_mvc/public/js/airtime/common/common.js +++ b/airtime_mvc/public/js/airtime/common/common.js @@ -75,8 +75,9 @@ 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=800'); + _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"); diff --git a/airtime_mvc/public/js/jplayer/preview_jplayer.js b/airtime_mvc/public/js/jplayer/preview_jplayer.js index 5eacef33f..6d4975f25 100644 --- a/airtime_mvc/public/js/jplayer/preview_jplayer.js +++ b/airtime_mvc/public/js/jplayer/preview_jplayer.js @@ -20,7 +20,16 @@ $(document).ready(function(){ height: "0px", cssClass: "jp-video-270p" }, - wmode: "window" + playlistOptions: { + autoPlay: false, + loopOnPrevious: false, + shuffleOnLoop: true, + enableRemoveControls: false, + displayTime: 0, + addTime: 0, + removeTime: 0, + shuffleTime: 0 + } }); @@ -32,6 +41,8 @@ $(document).ready(function(){ var showID = $('.showID').text(); var showIndex = $('.showIndex').text(); + var numOfItems = 0; + if (playlistID != "" && playlistID !== ""){ playAllPlaylist(playlistID, playlistIndex); }else if (audioFileID != "") { @@ -87,6 +98,7 @@ function buildplaylist(p_url, p_playIndex) { var myPlaylist = new Array(); var media; var index; + var total = 0; for(index in data){ if (data[index]['element_mp3'] != undefined){ @@ -103,11 +115,17 @@ function buildplaylist(p_url, p_playIndex) { myPlaylist[index] = media; _idToPostionLookUp[data[index]['element_id']] = data[index]['element_position']; + total++; } _playlist_jplayer.setPlaylist(myPlaylist); _playlist_jplayer.option("autoPlay", true); play(p_playIndex); + + var height = Math.min(80 + (23 * total), 400); + window.innerWidth = 500; + window.innerHeight = height; + window.scrollbars = true; }); } @@ -146,4 +164,7 @@ function playOne(p_audioFileID) { //_playlist_jplayer.setPlaylist(playlist); --if I use this the player will call _init on the setPlaylist and on the ready _playlist_jplayer._initPlaylist(playlist); _playlist_jplayer.play(0); + + window.innerWidth = 490; + window.innerHeight = 105; } \ No newline at end of file