1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

add correct media format profiles to res elements

This commit is contained in:
Luke Pulverenti 2014-04-22 20:50:47 -04:00
parent 408fae1db1
commit 87acab5434
2 changed files with 36 additions and 24 deletions

View file

@ -16,6 +16,36 @@
});
}
function monitorPlayer(player) {
$(player).on('playbackstart.mediacontroller', function (e, state) {
var info = {
QueueableMediaTypes: state.NowPlayingItem.MediaType,
ItemId: state.NowPlayingItem.Id,
NowPlayingItem: state.NowPlayingItem
};
info = $.extend(info, state.PlayState);
ApiClient.reportPlaybackStart(info);
}).on('playbackstop.mediacontroller', function (e, state) {
ApiClient.reportPlaybackStopped({
itemId: state.NowPlayingItem.Id,
mediaSourceId: state.PlayState.MediaSourceId,
positionTicks: state.PlayState.PositionTicks
});
}).on('positionchange.mediacontroller', function (e, state) {
});
}
function mediaController() {
var self = this;
@ -26,6 +56,10 @@
self.registerPlayer = function (player) {
players.push(player);
if (player.isLocalPlayer) {
monitorPlayer(player);
}
};
self.getPlayerInfo = function () {