CC-2447:Preview keeps playing if you create a new playlist
- fixed - preview stops on clicking on any of new, delete, done editing button
This commit is contained in:
parent
cb72db4a31
commit
dcddec9536
2 changed files with 10 additions and 6 deletions
|
@ -141,19 +141,14 @@ function getFileExt(filename){
|
||||||
return filename.split('.').pop();
|
return filename.split('.').pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentAudioPreviewID = "";
|
|
||||||
|
|
||||||
function audioPreview(filename, elemID){
|
function audioPreview(filename, elemID){
|
||||||
|
|
||||||
var elems = $('.ui-icon.ui-icon-pause');
|
var elems = $('.ui-icon.ui-icon-pause');
|
||||||
elems.attr("class", "ui-icon ui-icon-play");
|
elems.attr("class", "ui-icon ui-icon-play");
|
||||||
|
|
||||||
if (currentAudioPreviewID == elemID){
|
if ($("#jquery_jplayer_1").data("jPlayer") && $("#jquery_jplayer_1").data("jPlayer").status.paused != true){
|
||||||
$('#jquery_jplayer_1').jPlayer('stop');
|
$('#jquery_jplayer_1').jPlayer('stop');
|
||||||
currentAudioPreviewID = "";
|
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
currentAudioPreviewID = elemID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var ext = getFileExt(filename);
|
var ext = getFileExt(filename);
|
||||||
|
|
|
@ -338,6 +338,9 @@ function noOpenPL(json) {
|
||||||
function closeSPL() {
|
function closeSPL() {
|
||||||
var url;
|
var url;
|
||||||
|
|
||||||
|
// stop playing any preview
|
||||||
|
$('#jquery_jplayer_1').jPlayer('stop');
|
||||||
|
|
||||||
url = '/Playlist/close/format/json';
|
url = '/Playlist/close/format/json';
|
||||||
|
|
||||||
$.post(url, noOpenPL);
|
$.post(url, noOpenPL);
|
||||||
|
@ -386,6 +389,9 @@ function createPlaylistMetaForm(json) {
|
||||||
function newSPL() {
|
function newSPL() {
|
||||||
var url;
|
var url;
|
||||||
|
|
||||||
|
// stop any preview playing
|
||||||
|
$('#jquery_jplayer_1').jPlayer('stop');
|
||||||
|
|
||||||
url = '/Playlist/new/format/json';
|
url = '/Playlist/new/format/json';
|
||||||
|
|
||||||
$.post(url, createPlaylistMetaForm);
|
$.post(url, createPlaylistMetaForm);
|
||||||
|
@ -394,6 +400,9 @@ function newSPL() {
|
||||||
function deleteSPL() {
|
function deleteSPL() {
|
||||||
var url;
|
var url;
|
||||||
|
|
||||||
|
// stop any preview playing
|
||||||
|
$('#jquery_jplayer_1').jPlayer('stop');
|
||||||
|
|
||||||
url = '/Playlist/delete-active/format/json';
|
url = '/Playlist/delete-active/format/json';
|
||||||
|
|
||||||
$.post(url, function(){
|
$.post(url, function(){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue