Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
converted music player to use custom control bar with soundmanager
- Loading branch information
Eric Matthys
committed
May 10, 2012
1 parent
8364021
commit 83a8e1d
Showing
28 changed files
with
6,391 additions
and
4,161 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
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 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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
// Declare global variable to let SoundManager know we are deferring init | |||
var SM2_DEFER = true; | |||
|
|||
define( | |||
[ | |||
// Globals | |||
'use!soundmanager' | |||
], | |||
|
|||
function () { | |||
soundManager = new SoundManager(); | |||
soundManager.url = 'swf/'; | |||
soundManager.flashVersion = 9; | |||
soundManager.beginDelayedInit(); | |||
} | |||
); |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,39 @@ | |||
define( | |||
[ | |||
// Globals | |||
'use!backbone' | |||
], | |||
|
|||
function () { | |||
var PlayerModel = Backbone.Model.extend({ | |||
defaults: { | |||
currentTime: 0, | |||
duration: 0, | |||
formattedTime: '0:00', | |||
formattedDuration: '0:00', | |||
volume: 0, | |||
paused: true, | |||
ended: false, | |||
buffering: false, | |||
startBuffer: 0, | |||
endBuffer: 0, | |||
fullscreen: false | |||
}, | |||
|
|||
reset: function () { | |||
this.set(this.defaults); | |||
}, | |||
|
|||
secondsToHms: function (seconds) { | |||
seconds = Number(seconds); | |||
var h = Math.floor(seconds / 3600); | |||
var m = Math.floor(seconds % 3600 / 60); | |||
var s = Math.floor(seconds % 3600 % 60); | |||
|
|||
return ((h > 0 ? h + ':' : '') + (m > 0 ? (h > 0 && m < 10 ? '0' : '') + m + ':' : '0:') + (s < 10 ? '0' : '') + s); | |||
} | |||
}); | |||
|
|||
return PlayerModel; | |||
} | |||
); |
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
Oops, something went wrong.