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