report live stream in playback stop

This commit is contained in:
Luke Pulverenti 2015-03-29 14:38:18 -04:00
parent b6fc58c494
commit 8b505bb84d
2 changed files with 9 additions and 11 deletions

View File

@ -53,13 +53,17 @@
}).on('playbackstop.mediacontroller', function (e, state) {
ApiClient.reportPlaybackStopped({
var stopInfo = {
itemId: state.NowPlayingItem.Id,
mediaSourceId: state.PlayState.MediaSourceId,
positionTicks: state.PlayState.PositionTicks
};
});
if (state.PlayState.LiveStreamId) {
stopInfo.LiveStreamId = state.PlayState.LiveStreamId;
}
ApiClient.reportPlaybackStopped(stopInfo);
}).on('positionchange.mediacontroller', function (e, state) {

View File

@ -1390,6 +1390,8 @@
state.PlayState.PlayMethod = getParameterByName('static', currentSrc) == 'true' ?
'DirectStream' :
'Transcode';
state.PlayState.LiveStreamId = getParameterByName('LiveStreamId', currentSrc);
}
}
@ -1567,14 +1569,6 @@
info = $.extend(info, state.PlayState);
if (element) {
var currentSrc = element.currentSrc;
var liveStreamId = getParameterByName('LiveStreamId', currentSrc);
if (liveStreamId) {
info.LiveStreamId = liveStreamId;
}
}
ApiClient.reportPlaybackProgress(info);
}