-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES6: Migrate "audio" with proper logging #925
+434
−350
Merged
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8c4182b
ES6: AudioRepository
bennycode aa3a02a
Fixed audio log message problem
bennycode 6c98bc0
Merge branch 'dev' into es6-audio
bennycode c498bcb
Merge branch 'dev' into es6-audio
bennycode 5ba53e1
Merge branch 'dev' into es6-audio
bennycode 95aefa1
brace-style
bennycode 2c8fe2b
Merge branch 'dev' into es6-audio
bennycode 5bbad37
Removed IIFE
bennycode 094e848
ES6 class
bennycode afbaad4
100% ES6
bennycode 63c0cb0
Merge branch 'dev' into es6-audio
bennycode 6dba056
Fixed braces style
bennycode 0c8ba47
Renamed Strings
bennycode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2016 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
(function() { | ||
function AudioError(type) { | ||
this.name = this.constructor.name; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cant we use es6 classes here? |
||
this.stack = (new Error()).stack; | ||
this.type = type || z.audio.AudioError.prototype.TYPE.UNKNOWN; | ||
switch (this.type) { | ||
case z.audio.AudioError.prototype.TYPE.ALREADY_PLAYING: | ||
this.message = 'Sound is already playing'; | ||
break; | ||
case z.audio.AudioError.prototype.TYPE.FAILED_TO_PLAY: | ||
this.message = 'Failed to play sound'; | ||
break; | ||
case z.audio.AudioError.prototype.TYPE.IGNORED_SOUND: | ||
this.message = 'Ignored request to play sound'; | ||
break; | ||
case z.audio.AudioError.prototype.TYPE.NOT_FOUND: | ||
this.message = 'AudioElement or ID not found'; | ||
break; | ||
default: | ||
this.message = 'Unknown AudioError'; | ||
} | ||
} | ||
|
||
AudioError.prototype = new Error(); | ||
|
||
AudioError.prototype.constructor = AudioError; | ||
|
||
AudioError.prototype.TYPE = { | ||
ALREADY_PLAYING: 'z.audio.AudioError::TYPE.ALREADY_PLAYING', | ||
FAILED_TO_PLAY: 'z.audio.AudioError::TYPE.FAILED_TO_PLAY', | ||
IGNORED_SOUND: 'z.audio.AudioError::TYPE.IGNORED_SOUND', | ||
NOT_FOUND: 'z.audio.AudioError::TYPE.NOT_FOUND', | ||
UNKNOWN: 'z.audio.AudioError::TYPE.UNKNOWN', | ||
}; | ||
|
||
window.z = window.z || {}; | ||
window.z.audio = z.audio || {}; | ||
window.z.audio.AudioError = AudioError; | ||
})(); | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2016 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
window.z = window.z || {}; | ||
window.z.audio = z.audio || {}; | ||
|
||
z.audio.AudioPlayingType = { | ||
NONE: [ | ||
z.audio.AudioType.CALL_DROP, | ||
z.audio.AudioType.NETWORK_INTERRUPTION, | ||
z.audio.AudioType.OUTGOING_CALL, | ||
z.audio.AudioType.READY_TO_TALK, | ||
z.audio.AudioType.TALK_LATER, | ||
], | ||
SOME: [ | ||
z.audio.AudioType.CALL_DROP, | ||
z.audio.AudioType.INCOMING_CALL, | ||
z.audio.AudioType.INCOMING_PING, | ||
z.audio.AudioType.NETWORK_INTERRUPTION, | ||
z.audio.AudioType.OUTGOING_CALL, | ||
z.audio.AudioType.OUTGOING_PING, | ||
z.audio.AudioType.READY_TO_TALK, | ||
z.audio.AudioType.TALK_LATER, | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2016 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
window.z = window.z || {}; | ||
window.z.audio = z.audio || {}; | ||
|
||
z.audio.AudioPreference = { | ||
ALL: 'all', | ||
NONE: 'none', | ||
SOME: 'some', | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍