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

update access denied exceptions

This commit is contained in:
Luke Pulverenti 2015-09-25 22:31:13 -04:00
parent 294281602e
commit ad38cf4783
17 changed files with 154 additions and 138 deletions

View file

@ -249,9 +249,13 @@
}
Events.on(player, 'playbackstop', onPlaybackStop);
Events.on(player, 'playbackstart', onPlaybackStart);
Events.on(player, 'beforeplaybackstart', onBeforePlaybackStart);
};
function onBeforePlaybackStart(e, state) {
$(self).trigger('beforeplaybackstart', [state, this]);
}
function onPlaybackStart(e, state) {
$(self).trigger('playbackstart', [state, this]);
}
@ -450,7 +454,12 @@
return deferred.promise();
};
function doWithPlaybackValidation(fn) {
function doWithPlaybackValidation(player, fn) {
if (!player.isLocalPlayer) {
fn();
return;
}
requirejs(["scripts/registrationservices"], function () {
RegistrationServices.validateFeature('playback').done(fn);
@ -479,7 +488,7 @@
self.play = function (options) {
doWithPlaybackValidation(function () {
doWithPlaybackValidation(currentPlayer, function () {
if (typeof (options) === 'string') {
options = { ids: [options] };
}
@ -490,13 +499,13 @@
self.shuffle = function (id) {
doWithPlaybackValidation(function () {
doWithPlaybackValidation(currentPlayer, function () {
currentPlayer.shuffle(id);
});
};
self.instantMix = function (id) {
doWithPlaybackValidation(function () {
doWithPlaybackValidation(currentPlayer, function () {
currentPlayer.instantMix(id);
});
};