Skip to content

Commit

Permalink
* minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
JayGray committed Jul 29, 2014
1 parent 344c014 commit 1474a61
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions app/js/components/lib_player.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*global Media, Audica*/
(function (Audica) {
(function (Audica, $) {
'use strict';

function PluginPlayerError(message) {
Expand Down Expand Up @@ -43,7 +43,7 @@
default:
errorMsg += 'Unknown error with code "' + event.currentTarget.error.code + '" happened.';
}
window.Audica.trigger('ERROR', new PluginPlayerError(errorMsg));
Audica.trigger('ERROR', new PluginPlayerError(errorMsg));
// TODO trigger here player ended to play next song
}

Expand All @@ -60,16 +60,12 @@
}

function onErrorCallbackMedia(error) {
window.Audica.trigger('ERROR', new PluginPlayerError('cordova media error code: ' + error.code));
Audica.trigger('ERROR', new PluginPlayerError('cordova media error code: ' + error.code));
// TODO trigger here player ended to play next song
}

function onStatusChangeCallbackMedia(status) {
if (Media.MEDIA_RUNNING === status) {
_self.paused = false;
} else {
_self.paused = true;
}
_self.paused = Media.MEDIA_RUNNING !== status;

if (Media.MEDIA_STOPPED === status) {
onEndedCallback();
Expand Down Expand Up @@ -178,4 +174,4 @@


Audica.extend('player', new Player());
}(Audica));
}(Audica, jQuery));

0 comments on commit 1474a61

Please sign in to comment.