Skip to content

Commit

Permalink
* code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JayGray committed Jul 30, 2014
1 parent 779fc79 commit da37eb9
Show file tree
Hide file tree
Showing 3 changed files with 551 additions and 548 deletions.
29 changes: 15 additions & 14 deletions app/js/components/lib_player.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
function PluginPlayerError(message) {
this.message = (message || '');
}

PluginPlayerError.prototype = new Error();

function Player() {
Expand All @@ -29,20 +30,20 @@
function onErrorCallbackAudioTag(event) {
var errorMsg = 'The file "' + _player.src + '" cannot be played. The possible reasons is: ';
switch (event.currentTarget.error.code) {
case 4:
errorMsg += 'The current media type "' + _player.type + '" is not supported.';
break;
case 1:
errorMsg += 'The user agent stopped fetching the media data.';
break;
case 2:
errorMsg += 'A network error stopped the user agent fetching the media data.';
break;
case 3:
errorMsg += 'Error on decoding the media data.';
break;
default:
errorMsg += 'Unknown error with code "' + event.currentTarget.error.code + '" happened.';
case 4:
errorMsg += 'The current media type "' + _player.type + '" is not supported.';
break;
case 1:
errorMsg += 'The user agent stopped fetching the media data.';
break;
case 2:
errorMsg += 'A network error stopped the user agent fetching the media data.';
break;
case 3:
errorMsg += 'Error on decoding the media data.';
break;
default:
errorMsg += 'Unknown error with code "' + event.currentTarget.error.code + '" happened.';
}
Audica.trigger('player:error');
Audica.trigger('ERROR', new PluginPlayerError(errorMsg));
Expand Down
Loading

0 comments on commit da37eb9

Please sign in to comment.