2017-01-03 01:51:36 -05:00
|
|
|
|
define(['appSettings', 'events'], function (appSettings, events) {
|
2016-10-23 01:11:46 -04:00
|
|
|
|
'use strict';
|
2014-03-29 11:40:32 -04:00
|
|
|
|
|
|
|
|
|
function mediaController() {
|
|
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
var currentPlayer;
|
2014-04-09 21:12:04 -07:00
|
|
|
|
|
|
|
|
|
self.currentPlaylistIndex = function (i) {
|
2015-09-15 00:31:12 -04:00
|
|
|
|
|
|
|
|
|
if (i == null) {
|
2015-09-17 21:51:22 -04:00
|
|
|
|
// TODO: Get this implemented in all of the players
|
|
|
|
|
return currentPlayer.currentPlaylistIndex ? currentPlayer.currentPlaylistIndex() : -1;
|
2015-09-15 00:31:12 -04:00
|
|
|
|
}
|
|
|
|
|
|
2014-04-10 04:12:48 -07:00
|
|
|
|
currentPlayer.currentPlaylistIndex(i);
|
2014-04-09 21:12:04 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
self.removeFromPlaylist = function (i) {
|
2014-04-10 04:12:48 -07:00
|
|
|
|
currentPlayer.removeFromPlaylist(i);
|
|
|
|
|
};
|
|
|
|
|
|
2014-06-22 01:52:31 -04:00
|
|
|
|
self.playlist = function () {
|
2014-06-04 15:58:12 -07:00
|
|
|
|
return currentPlayer.playlist || [];
|
|
|
|
|
};
|
2014-03-29 11:40:32 -04:00
|
|
|
|
}
|
2016-03-07 14:13:58 -05:00
|
|
|
|
});
|