I have created two seperate instance of sound manager 2 to play audio tracks in single application. one is for individual track and another is for playlist. while playing individual track, the another instance i.e. playlist instance should be paused and vice versa. its working fine when both tracks are different in individual and playlist. but while playing same track in both instance, its not getting paused. any idea ? thanks
In Playlist instance, If individual instance running, make it paused
$scope.lastSoundPlayer = tracksDetails.getLastSoundPlayer();
if ($scope.lastSoundPlayer != undefined) {
if ($scope.lastSoundPlayer.id == $scope.audioPlaylist.id) {
$scope.stopEvent($scope.lastSoundPlayer.id);
$scope.lastSoundPlayer.destruct();
} else {
$scope.lastSoundPlayer.pause();
}
}
Like wise in individual instance, If playlist instance running, make it paused
$scope.lastSoundPlaylist = tracksDetails.getLastSoundPlaylist();
if ($scope.lastSoundPlaylist != undefined && $scope.lastSoundPlaylist.paused == false) {
if ($scope.lastSoundPlaylist.id == $scope.audioDiv.id) {
$scope.stopEvent($scope.lastSoundPlaylist.id);
$scope.lastSoundPlaylist.destruct();
} else {
$scope.lastSoundPlaylist.pause();
}
}