Skip to content

Commit

Permalink
FREEPBX-7812 stop playing message when playing another message
Browse files Browse the repository at this point in the history
  • Loading branch information
tm1000 committed Aug 26, 2014
1 parent b2cc9cb commit acd3f64
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions assets/js/cdr.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
function cdr_play(row_num, link, title) {
$("#jquery_jplayer_"+(row_num - 1)).jPlayer({
ready: function () {
var playing = null;
function cdr_play(rowNum, link, title) {
var playerId = (rowNum - 1);
if (playing !== null && playing != playerId) {
$("#jquery_jplayer_" + playing).jPlayer("stop", 0);
playing = playerId;
} else if (playing === null) {
playing = playerId;
}
$("#jquery_jplayer_" + playerId).jPlayer({
ready: function() {
$(this).jPlayer("setMedia", {
title: title,
wav: link,
wav: link
});
},
swfPath: "/js",
supplied: "wav",
cssSelectorAncestor: "#jp_container_"+(row_num - 1)
cssSelectorAncestor: "#jp_container_" + playerId
});
$('.playback').hide('fast');
$('#playback-'+(row_num - 1)).slideDown('fast', function(event){
$("#jquery_jplayer_"+(row_num - 1)).jPlayer("play",0);
$(".playback").hide("fast");
$("#playback-" + playerId).slideDown("fast", function(event) {
$("#jquery_jplayer_" + playerId).jPlayer("play", 0);
});
}

0 comments on commit acd3f64

Please sign in to comment.