mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
fixes #683 - Support disabling playback per user
This commit is contained in:
parent
b6992659d1
commit
1fbbb143fe
@ -385,7 +385,7 @@ a.itemTag:hover {
|
||||
background-size: cover;
|
||||
background-position: center 15%;
|
||||
background-repeat: no-repeat;
|
||||
height: 580px;
|
||||
height: 600px;
|
||||
border-bottom: 1px solid #111;
|
||||
position: relative;
|
||||
}
|
||||
|
@ -79,14 +79,14 @@
|
||||
ApiClient.sendWebSocketMessage("Context", vals.join('|'));
|
||||
}
|
||||
|
||||
if (MediaPlayer.canPlay(item)) {
|
||||
$('#playButtonContainer', page).show();
|
||||
} else {
|
||||
$('#playButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
if (MediaPlayer.canPlay(item, user)) {
|
||||
$('#playButtonContainer', page).show();
|
||||
} else {
|
||||
$('#playButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
var editImagesHref = user.Configuration.IsAdministrator ? 'edititemimages.html' + window.location.search : null;
|
||||
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item, editImagesHref));
|
||||
|
||||
|
@ -35,6 +35,30 @@
|
||||
$('#editButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
if (MediaPlayer.canPlay(item, user) && item.LocationType !== "Offline" && item.LocationType !== "Virtual") {
|
||||
|
||||
var url = MediaPlayer.getPlayUrl(item);
|
||||
|
||||
if (url) {
|
||||
$('#playExternalButtonContainer', page).show();
|
||||
$('#playButtonContainer', page).hide();
|
||||
} else {
|
||||
$('#playButtonContainer', page).show();
|
||||
$('#playExternalButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
$('#btnPlayExternal', page).attr('href', url || '#');
|
||||
|
||||
} else {
|
||||
$('#playButtonContainer', page).hide();
|
||||
$('#playExternalButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
if (item.LocalTrailerCount && item.LocationType !== "Offline" && user.Configuration.EnableMediaPlayback) {
|
||||
$('#trailerButtonContainer', page).show();
|
||||
} else {
|
||||
$('#trailerButtonContainer', page).hide();
|
||||
}
|
||||
});
|
||||
|
||||
if (item.LocationType == "Offline") {
|
||||
@ -65,31 +89,6 @@
|
||||
$('#missingIndicator', page).hide();
|
||||
}
|
||||
|
||||
if (MediaPlayer.canPlay(item) && item.LocationType !== "Offline" && item.LocationType !== "Virtual") {
|
||||
|
||||
var url = MediaPlayer.getPlayUrl(item);
|
||||
|
||||
if (url) {
|
||||
$('#playExternalButtonContainer', page).show();
|
||||
$('#playButtonContainer', page).hide();
|
||||
} else {
|
||||
$('#playButtonContainer', page).show();
|
||||
$('#playExternalButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
$('#btnPlayExternal', page).attr('href', url || '#');
|
||||
|
||||
} else {
|
||||
$('#playButtonContainer', page).hide();
|
||||
$('#playExternalButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
if (item.LocalTrailerCount && item.LocationType !== "Offline") {
|
||||
$('#trailerButtonContainer', page).show();
|
||||
} else {
|
||||
$('#trailerButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
$(".autoNumeric").autoNumeric('init');
|
||||
|
||||
setPeopleHeader(page, item);
|
||||
|
@ -2527,7 +2527,7 @@
|
||||
|
||||
var buttonCount = 0;
|
||||
|
||||
if (MediaPlayer.canPlay(item)) {
|
||||
if (MediaPlayer.canPlay(item, currentUser)) {
|
||||
|
||||
var resumePosition = (item.UserData || {}).PlaybackPositionTicks || 0;
|
||||
var onPlayClick = 'LibraryBrowser.showPlayMenu(this, \'' + item.Id + '\', \'' + item.Type + '\', \'' + item.MediaType + '\', ' + resumePosition + ');return false;';
|
||||
@ -2541,7 +2541,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (item.LocalTrailerCount) {
|
||||
if (item.LocalTrailerCount && currentUser.Configuration.EnableMediaPlayback) {
|
||||
html += '<button type="button" data-mini="true" data-inline="true" data-icon="video" data-iconpos="notext" class="btnPlayTrailer" data-itemid="' + item.Id + '" title="Play Trailer" style="' + buttonMargin + '">Play Trailer</button>';
|
||||
buttonCount++;
|
||||
}
|
||||
|
@ -144,14 +144,14 @@
|
||||
ApiClient.sendWebSocketMessage("Context", vals.join('|'));
|
||||
}
|
||||
|
||||
if (MediaPlayer.canPlay(item)) {
|
||||
$('#playButtonContainer', page).show();
|
||||
} else {
|
||||
$('#playButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
if (MediaPlayer.canPlay(item, user)) {
|
||||
$('#playButtonContainer', page).show();
|
||||
} else {
|
||||
$('#playButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
if (user.Configuration.IsAdministrator && item.LocationType !== "Offline") {
|
||||
$('#editButtonContainer', page).show();
|
||||
} else {
|
||||
|
@ -64,16 +64,16 @@
|
||||
ApiClient.sendWebSocketMessage("Context", vals.join('|'));
|
||||
}
|
||||
|
||||
if (MediaPlayer.canPlay(item)) {
|
||||
$('#playButtonContainer', page).show();
|
||||
} else {
|
||||
$('#playButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
$('.status', page).html('Status: ' + item.Status);
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
if (MediaPlayer.canPlay(item, user)) {
|
||||
$('#playButtonContainer', page).show();
|
||||
} else {
|
||||
$('#playButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
if (user.Configuration.IsAdministrator && item.LocationType !== "Offline") {
|
||||
$('#deleteButtonContainer', page).show();
|
||||
} else {
|
||||
|
@ -999,8 +999,12 @@
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
self.canPlay = function (item) {
|
||||
self.canPlay = function (item, user) {
|
||||
|
||||
if (!user.Configuration.EnableMediaPlayback) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item.LocationType == "Virtual") {
|
||||
return false;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
$('#chkDisabled', page).checked(user.Configuration.IsDisabled || false).checkboxradio("refresh");
|
||||
$('#chkIsHidden', page).checked(user.Configuration.IsHidden || false).checkboxradio("refresh");
|
||||
$('#chkEnableRemoteControlOtherUsers', page).checked(user.Configuration.EnableRemoteControlOfOtherUsers || false).checkboxradio("refresh");
|
||||
$('#chkEnableMediaPlayback', page).checked(user.Configuration.EnableMediaPlayback || false).checkboxradio("refresh");
|
||||
|
||||
$('#chkManageLiveTv', page).checked(user.Configuration.EnableLiveTvManagement || false).checkboxradio("refresh");
|
||||
|
||||
@ -55,6 +56,7 @@
|
||||
user.Configuration.IsDisabled = $('#chkDisabled', page).checked();
|
||||
user.Configuration.EnableRemoteControlOfOtherUsers = $('#chkEnableRemoteControlOtherUsers', page).checked();
|
||||
user.Configuration.EnableLiveTvManagement = $('#chkManageLiveTv', page).checked();
|
||||
user.Configuration.EnableMediaPlayback = $('#chkEnableMediaPlayback', page).checked();
|
||||
|
||||
var userId = getParameterByName("userId");
|
||||
|
||||
|
@ -29,24 +29,28 @@
|
||||
<div id="featureAccessFields">
|
||||
<h2>Feature Access</h2>
|
||||
<div>
|
||||
<input type="checkbox" id="chkEnableRemoteControlOtherUsers" name="chkEnableRemoteControlOtherUsers" />
|
||||
<input type="checkbox" id="chkEnableMediaPlayback" name="chkEnableMediaPlayback" data-mini="true" />
|
||||
<label for="chkEnableMediaPlayback">Allow media playback</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="chkEnableRemoteControlOtherUsers" name="chkEnableRemoteControlOtherUsers" data-mini="true" />
|
||||
<label for="chkEnableRemoteControlOtherUsers">Allow this user to remote control other users</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="chkManageLiveTv" name="chkManageLiveTv" />
|
||||
<label for="chkManageLiveTv">Manage live tv recordings</label>
|
||||
<input type="checkbox" id="chkManageLiveTv" name="chkManageLiveTv" data-mini="true" />
|
||||
<label for="chkManageLiveTv">Allow this user to schedule tv recordings</label>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
<div id="accessControlDiv" style="display: none" data-role="collapsible">
|
||||
<h2>Advanced Control</h2>
|
||||
<div id="fldIsEnabled" style="margin: 1em 0 2em;">
|
||||
<input type="checkbox" id="chkDisabled" name="chkDisabled" />
|
||||
<input type="checkbox" id="chkDisabled" name="chkDisabled" data-mini="true" />
|
||||
<label for="chkDisabled">Disable this user</label>
|
||||
<div class="fieldDescription">If disabled the server will not allow any connections from this user. Existing connections will be abruptly terminated.</div>
|
||||
</div>
|
||||
<p id="fldIsHidden">
|
||||
<input type="checkbox" id="chkIsHidden" name="chkIsHidden" />
|
||||
<input type="checkbox" id="chkIsHidden" name="chkIsHidden" data-mini="true" />
|
||||
<label for="chkIsHidden">Hide this user from login screens</label>
|
||||
|
||||
</p>
|
||||
@ -54,10 +58,10 @@
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||
Save
|
||||
</button>
|
||||
<button type="button" onclick="history.back();" data-icon="delete">
|
||||
<button type="button" onclick="history.back();" data-icon="delete" data-mini="true">
|
||||
Cancel
|
||||
</button>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user