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

added new cabac value

This commit is contained in:
Luke Pulverenti 2014-10-23 00:26:01 -04:00
parent ab4fd843d3
commit f2358f0a65
15 changed files with 310 additions and 279 deletions

View file

@ -26,6 +26,15 @@
height: auto;
}
.videoCanvas {
background-color: #000;
position: fixed;
top: 200px;
bottom: 200px;
left: 200px;
right: 200px;
}
.videoControls {
padding: 0 .5em;
background-color: rgba(0, 0, 0, .8);

View file

@ -53,8 +53,68 @@
</form>
<br />
<form class="updatePasswordForm passwordSection" style="display:none;margin: 0 auto 2em;">
<div data-role="collapsible" data-collapsed="false">
<h2>${HeaderPassword}</h2>
<div>
<br />
<ul data-role="listview" class="ulForm">
<li id="fldCurrentPassword" style="display: none;">
<label for="txtCurrentPassword">${LabelCurrentPassword}</label>
<input type="password" id="txtCurrentPassword" name="txtCurrentPassword" />
</li>
<li>
<label for="txtNewPassword">${LabelNewPassword}</label>
<input type="password" id="txtNewPassword" name="txtNewPassword" />
</li>
<li>
<label for="txtNewPasswordConfirm">${LabelNewPasswordConfirm}</label>
<input type="password" id="txtNewPasswordConfirm" name="txtNewPasswordConfirm" />
</li>
<li>
<button type="submit" data-theme="b" data-icon="check">
${ButtonSave}
</button>
<div id="btnResetPassword" style="display: none;">
<button type="button" data-icon="lock" onclick="UpdatePasswordPage.resetPassword();">
${ButtonResetPassword}
</button>
</div>
</li>
</ul>
</div>
</div>
</form>
<form class="localAccessForm localAccessSection" style="margin: 0 auto;">
<div data-role="collapsible">
<h2>${HeaderLocalAccess}</h2>
<div>
<br />
<ul data-role="listview" class="ulForm">
<li>
<label for="chkEnableLocalAccessWithoutPassword">${LabelAllowLocalAccessWithoutPassword}</label>
<input type="checkbox" id="chkEnableLocalAccessWithoutPassword" />
<div class="fieldDescription">${LabelAllowLocalAccessWithoutPasswordHelp}</div>
</li>
<li>
<button type="submit" data-theme="b" data-icon="check">
${ButtonSave}
</button>
</li>
</ul>
</div>
</div>
</form>
<script type="text/javascript">
$('.newImageForm').off('submit', MyProfilePage.onImageSubmit).on('submit', MyProfilePage.onImageSubmit);
$('.updatePasswordForm').off('submit', UpdatePasswordPage.onSubmit).on('submit', UpdatePasswordPage.onSubmit);
$('.localAccessForm').off('submit', UpdatePasswordPage.onLocalAccessSubmit).on('submit', UpdatePasswordPage.onLocalAccessSubmit);
</script>
</div>
</body>

View file

@ -16,15 +16,29 @@
function connectToServerInstance(server) {
var url = server.Url;
connectToServerAtUrl(server, server.Url).fail(function () {
if (server.LocalAddress) {
connectToServerAtUrl(server, server.LocalAddress).fail(showServerConnectionFailure);
} else {
showServerConnectionFailure();
}
});
}
function showServerConnectionFailure() {
alert('Unable to communicate with your server.');
}
function connectToServerAtUrl(server, url) {
var exchangeToken = server.AccessKey;
url += "/mediabrowser/Connect/Exchange?format=json&ConnectUserId=" + ConnectionManager.connectUserId();
$.ajax({
return $.ajax({
type: "GET",
url: url,
url: url + "/mediabrowser/Connect/Exchange?format=json&ConnectUserId=" + ConnectionManager.connectUserId(),
dataType: "json",
error: function () {
@ -37,15 +51,11 @@
}).done(function (result) {
Dashboard.serverAddress(server.Url);
Dashboard.serverAddress(url);
Dashboard.setCurrentUser(result.LocalUserId, result.AccessToken);
window.location = 'index.html';
}).fail(function (result) {
alert('Error talking to MBS');
});
}

View file

@ -1282,6 +1282,10 @@
attributes.push(createAttribute(Globalize.translate('MediaInfoTimestamp'), version.Timestamp));
}
if (stream.IsCabac != null) {
attributes.push(createAttribute(Globalize.translate('CABAC'), (stream.IsCabac ? 'Yes' : 'No')));
}
html += attributes.join('<br/>');
html += '</div>';

View file

@ -151,11 +151,7 @@
var localTime = program.StartDateLocal.getTime();
if ((localTime >= cellStart || cellIndex == 0) && localTime < cellEnd && program.EndDateLocal > cellStart) {
return {
index: i,
program: program
};
return program;
}
}
@ -198,7 +194,6 @@
html += '<div class="channelPrograms">';
var programIndex = 0;
var cellIndex = 0;
while (date.getDate() == dateNumber) {
@ -206,12 +201,7 @@
// Add 30 mins
var cellEndDate = new Date(date.getTime() + cellDurationMs);
var program = findProgramStartingInCell(programs, programIndex, date, cellEndDate, cellIndex);
if (program) {
programIndex = program.index + 1;
program = program.program;
}
var program = findProgramStartingInCell(programs, 0, date, cellEndDate, cellIndex);
html += '<div class="timeslotCell">';

View file

@ -633,7 +633,7 @@
return currentStream.Type == "Audio";
});
var currentIndex = getParameterByName('AudioStreamIndex', self.currentMediaElement.currentSrc);
var currentIndex = getParameterByName('AudioStreamIndex', self.getCurrentSrc(self.currentMediaElement));
var html = '';
html += '<div class="videoPlayerPopupContent">';
@ -789,7 +789,7 @@
function getQualityFlyoutHtml() {
var currentSrc = self.currentMediaElement.currentSrc.toLowerCase();
var currentSrc = self.getCurrentSrc(self.currentMediaElement).toLowerCase();
var isStatic = currentSrc.indexOf('static=true') != -1;
var options = getVideoQualityOptions(self.currentMediaSource.MediaStreams);

View file

@ -44,6 +44,10 @@
canClientSeek = duration && !isNaN(duration) && duration != Number.POSITIVE_INFINITY && duration != Number.NEGATIVE_INFINITY;
};
self.getCurrentSrc = function (mediaElement) {
return mediaElement.currentSrc;
};
self.getCurrentTicks = function (mediaElement) {
var playerTime = Math.floor(10000000 * (mediaElement || self.currentMediaElement).currentTime);
@ -262,7 +266,7 @@
return false;
}
if (mediaSource.Protocol.toLowerCase() == "rtmp") {
if (mediaSource.Protocol.toLowerCase() == "rtmp" || mediaSource.Protocol.toLowerCase() == "rtsp") {
//console.log('Transcoding because the content is not a video file');
return false;
}
@ -289,6 +293,11 @@
return false;
}
if (videoStream.IsCabac != null && !videoStream.IsCabac) {
console.log('Video not CABAC');
return false;
}
if (!videoStream.Width) {
console.log('Transcoding because resolution is unknown');
return false;
@ -770,13 +779,17 @@
self.setVolume(self.getSavedVolume() * 100);
};
self.volume = function() {
return self.currentMediaElement.volume * 100;
};
self.toggleMute = function () {
if (self.currentMediaElement) {
console.log('MediaPlayer toggling mute');
if (self.currentMediaElement.volume) {
if (self.volume()) {
self.mute();
} else {
self.unMute();
@ -787,14 +800,14 @@
self.volumeDown = function () {
if (self.currentMediaElement) {
self.setVolume(Math.max(self.currentMediaElement.volume - .02, 0) * 100);
self.setVolume(Math.max(self.volume() - 2, 0));
}
};
self.volumeUp = function () {
if (self.currentMediaElement) {
self.setVolume(Math.min(self.currentMediaElement.volume + .02, 1) * 100);
self.setVolume(Math.min(self.volume() + 2, 100));
}
};

View file

@ -216,3 +216,165 @@
})(jQuery, window, document, window.FileReader);
(function ($, document, window) {
function loadUser(page) {
var userid = getParameterByName("userId");
ApiClient.getUser(userid).done(function (user) {
Dashboard.setPageTitle(user.Name);
if (user.ConnectLinkType == 'Guest') {
$('.localAccessSection', page).hide();
$('.passwordSection', page).hide();
}
else if (user.HasConfiguredPassword) {
$('#btnResetPassword', page).show();
$('#fldCurrentPassword', page).show();
$('.localAccessSection', page).show();
$('.passwordSection', page).show();
} else {
$('#btnResetPassword', page).hide();
$('#fldCurrentPassword', page).hide();
$('.localAccessSection', page).hide();
$('.passwordSection', page).show();
}
$('#chkEnableLocalAccessWithoutPassword', page).checked(user.Configuration.EnableLocalPassword).checkboxradio('refresh');
});
$('#txtCurrentPassword', page).val('');
$('#txtNewPassword', page).val('');
$('#txtNewPasswordConfirm', page).val('');
}
function save(page) {
var userId = getParameterByName("userId");
ApiClient.getUser(userId).done(function (user) {
user.Configuration.EnableLocalPassword = $('#chkEnableLocalAccessWithoutPassword', page).checked();
ApiClient.updateUser(user).done(function () {
Dashboard.hideLoadingMsg();
Dashboard.alert(Globalize.translate('MessageSettingsSaved'));
loadUser(page);
});
});
}
function savePassword(page) {
var userId = getParameterByName("userId");
var currentPassword = $('#txtCurrentPassword', page).val();
var newPassword = $('#txtNewPassword', page).val();
ApiClient.updateUserPassword(userId, currentPassword, newPassword).done(function () {
Dashboard.hideLoadingMsg();
Dashboard.alert(Globalize.translate('PasswordSaved'));
loadUser(page);
});
}
function updatePasswordPage() {
var self = this;
self.onSubmit = function () {
var page = $.mobile.activePage;
if ($('#txtNewPassword', page).val() != $('#txtNewPasswordConfirm', page).val()) {
Dashboard.showError(Globalize.translate('PasswordMatchError'));
return false;
}
Dashboard.showLoadingMsg();
savePassword(page);
// Disable default form submission
return false;
};
self.onLocalAccessSubmit = function () {
var page = $.mobile.activePage;
Dashboard.showLoadingMsg();
save(page);
// Disable default form submission
return false;
};
self.resetPassword = function () {
var msg = Globalize.translate('PasswordResetConfirmation');
var page = $.mobile.activePage;
Dashboard.confirm(msg, Globalize.translate('PasswordResetHeader'), function (result) {
if (result) {
var userId = getParameterByName("userId");
Dashboard.showLoadingMsg();
ApiClient.resetUserPassword(userId).done(function () {
Dashboard.hideLoadingMsg();
Dashboard.alert({
message: Globalize.translate('PasswordResetComplete'),
title: Globalize.translate('PasswordResetHeader')
});
loadUser(page);
});
}
});
};
}
window.UpdatePasswordPage = new updatePasswordPage();
$(document).on('pagebeforeshow', "#userImagePage", function () {
var page = this;
Dashboard.getCurrentUser().done(function (loggedInUser) {
if (loggedInUser.Configuration.IsAdministrator) {
$('#lnkParentalControl', page).show();
} else {
$('#lnkParentalControl', page).hide();
}
});
}).on('pageshow', "#userImagePage", function () {
var page = this;
loadUser(page);
});
})(jQuery, document, window);

View file

@ -1,163 +0,0 @@
(function ($, document, window) {
function loadUser(page) {
var userid = getParameterByName("userId");
ApiClient.getUser(userid).done(function (user) {
Dashboard.setPageTitle(user.Name);
if (user.ConnectLinkType == 'Guest') {
$('.localAccessSection', page).show().collapsible("option", "collapsed", false);
$('.passwordSection', page).hide();
}
else if (user.HasConfiguredPassword) {
$('#btnResetPassword', page).show();
$('#fldCurrentPassword', page).show();
$('.formheader', page).hide();
$('.localAccessSection', page).show();
$('.passwordSection', page).show();
} else {
$('#btnResetPassword', page).hide();
$('#fldCurrentPassword', page).hide();
$('.formheader', page).show();
$('.localAccessSection', page).hide();
$('.passwordSection', page).show();
}
$('#chkEnableLocalAccessWithoutPassword', page).checked(user.Configuration.EnableLocalPassword).checkboxradio('refresh');
});
$('#txtCurrentPassword', page).val('');
$('#txtNewPassword', page).val('');
$('#txtNewPasswordConfirm', page).val('');
}
function save(page) {
var userId = getParameterByName("userId");
ApiClient.getUser(userId).done(function (user) {
user.Configuration.EnableLocalPassword = $('#chkEnableLocalAccessWithoutPassword', page).checked();
ApiClient.updateUser(user).done(function() {
Dashboard.hideLoadingMsg();
Dashboard.alert(Globalize.translate('MessageSettingsSaved'));
loadUser(page);
});
});
}
function savePassword(page) {
var userId = getParameterByName("userId");
var currentPassword = $('#txtCurrentPassword', page).val();
var newPassword = $('#txtNewPassword', page).val();
ApiClient.updateUserPassword(userId, currentPassword, newPassword).done(function () {
Dashboard.hideLoadingMsg();
Dashboard.alert(Globalize.translate('PasswordSaved'));
loadUser(page);
});
}
function updatePasswordPage() {
var self = this;
self.onSubmit = function () {
var page = $.mobile.activePage;
if ($('#txtNewPassword', page).val() != $('#txtNewPasswordConfirm', page).val()) {
Dashboard.showError(Globalize.translate('PasswordMatchError'));
return false;
}
Dashboard.showLoadingMsg();
savePassword(page);
// Disable default form submission
return false;
};
self.onLocalAccessSubmit = function () {
var page = $.mobile.activePage;
Dashboard.showLoadingMsg();
save(page);
// Disable default form submission
return false;
};
self.resetPassword = function () {
var msg = Globalize.translate('PasswordResetConfirmation');
var page = $.mobile.activePage;
Dashboard.confirm(msg, Globalize.translate('PasswordResetHeader'), function (result) {
if (result) {
var userId = getParameterByName("userId");
Dashboard.showLoadingMsg();
ApiClient.resetUserPassword(userId).done(function () {
Dashboard.hideLoadingMsg();
Dashboard.alert({
message: Globalize.translate('PasswordResetComplete'),
title: Globalize.translate('PasswordResetHeader')
});
loadUser(page);
});
}
});
};
}
window.UpdatePasswordPage = new updatePasswordPage();
$(document).on('pagebeforeshow', "#updatePasswordPage", function () {
var page = this;
Dashboard.getCurrentUser().done(function (loggedInUser) {
if (loggedInUser.Configuration.IsAdministrator) {
$('#lnkParentalControl', page).show();
} else {
$('#lnkParentalControl', page).hide();
}
});
}).on('pageshow', "#updatePasswordPage", function () {
var page = this;
loadUser(page);
});
})(jQuery, document, window);

View file

@ -322,12 +322,42 @@
}).done(function (result) {
$('#popupInvite').popup('close');
loadData(page);
Dashboard.hideLoadingMsg();
showNewUserInviteMessage(page, result);
});
}
function showNewUserInviteMessage(page, result) {
if (!result.IsNewUserInvitation && !result.IsPending) {
// It was immediately approved
loadData(page);
return;
}
var message = result.IsNewUserInvitation ?
Globalize.translate('MessageInvitationSentToNewUser', result.GuestDisplayName) :
Globalize.translate('MessageInvitationSentToUser', result.GuestDisplayName);
// Need a timeout because jquery mobile will not show a popup while a previous one is in the act of closing
setTimeout(function () {
Dashboard.alert({
message: message,
title: Globalize.translate('HeaderInvitationSent'),
callback: function () {
loadData(page);
}
});
}, 300);
}
function showInvitePopup(page) {
$('#popupInvite', page).popup('open');

View file

@ -13,7 +13,6 @@
<a href="#" data-role="button" class="ui-btn-active">${TabProfile}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);" id="lnkParentalControl" style="display: none;">${TabLibraryAccess}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);">${TabParentalControl}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userpassword.html', true);">${TabPassword}</a>
</div>
<p class="lnkEditUserPreferencesContainer">
<a class="lnkEditUserPreferences" href="#" target="_blank">${ButtonEditOtherUserPreferences}</a>

View file

@ -12,7 +12,6 @@
<a href="#" data-role="button" onclick="Dashboard.navigate('useredit.html', true);">${TabProfile}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);" class="ui-btn-active">${TabLibraryAccess}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);">${TabParentalControl}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userpassword.html', true);">${TabPassword}</a>
</div>
<form class="userLibraryAccessForm">

View file

@ -12,7 +12,6 @@
<a href="#" data-role="button" onclick="Dashboard.navigate('useredit.html', true);">${TabProfile}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);">${TabLibraryAccess}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);" class="ui-btn-active">${TabParentalControl}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userpassword.html', true);">${TabPassword}</a>
</div>
<form class="userParentalControlForm">

View file

@ -1,81 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="updatePasswordPage" data-role="page" class="page type-interior userProfilesPage publicUserPage">
<div data-role="content">
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="#" onclick="Dashboard.navigate('useredit.html', true);" data-role="button">${TabProfile}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userlibraryaccess.html', true);" id="lnkParentalControl" style="display: none;">${TabLibraryAccess}</a>
<a href="#" data-role="button" onclick="Dashboard.navigate('userparentalcontrol.html', true);">${TabParentalControl}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabPassword}</a>
</div>
<div class="readOnlyContent">
<div data-role="collapsible" data-collapsed="false" class="passwordSection" style="display:none;margin-bottom: 2em;">
<h2>${HeaderPassword}</h2>
<div>
<br />
<h2 class="formheader" style="display: none;">${HeaderCreatePassword}</h2>
<form class="updatePasswordForm">
<ul data-role="listview" class="ulForm">
<li id="fldCurrentPassword" style="display: none;">
<label for="txtCurrentPassword">${LabelCurrentPassword}</label>
<input type="password" id="txtCurrentPassword" name="txtCurrentPassword" />
</li>
<li>
<label for="txtNewPassword">${LabelNewPassword}</label>
<input type="password" id="txtNewPassword" name="txtNewPassword" />
</li>
<li>
<label for="txtNewPasswordConfirm">${LabelNewPasswordConfirm}</label>
<input type="password" id="txtNewPasswordConfirm" name="txtNewPasswordConfirm" />
</li>
<li>
<button type="submit" data-theme="b" data-icon="check">
${ButtonSave}
</button>
<div id="btnResetPassword" style="display: none;">
<button type="button" data-icon="lock" onclick="UpdatePasswordPage.resetPassword();">
${ButtonResetPassword}
</button>
</div>
</li>
</ul>
</form>
</div>
</div>
<div data-role="collapsible" class="localAccessSection">
<h2>${HeaderLocalAccess}</h2>
<div>
<br />
<form class="localAccessForm">
<ul data-role="listview" class="ulForm">
<li>
<label for="chkEnableLocalAccessWithoutPassword">${LabelAllowLocalAccessWithoutPassword}</label>
<input type="checkbox" id="chkEnableLocalAccessWithoutPassword" />
<div class="fieldDescription">${LabelAllowLocalAccessWithoutPasswordHelp}</div>
</li>
<li>
<button type="submit" data-theme="b" data-icon="check">
${ButtonSave}
</button>
</li>
</ul>
</form>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$('.updatePasswordForm').off('submit', UpdatePasswordPage.onSubmit).on('submit', UpdatePasswordPage.onSubmit);
$('.localAccessForm').off('submit', UpdatePasswordPage.onLocalAccessSubmit).on('submit', UpdatePasswordPage.onLocalAccessSubmit);
</script>
</div>
</body>
</html>

View file

@ -52,10 +52,10 @@
<p style="margin:1em 0 1.25em;">${HeaderInviteUserHelp}</p>
<form class="addUserForm">
<div>
<label for="txtConnectUsername">${LabelConnectUserName}</label>
<label for="txtConnectUsername">${LabelConnectGuestUserName}</label>
<input type="text" id="txtConnectUsername" value="" placeholder="Username" required="required">
<div class="fieldDescription">
<div>${LabelConnectInviteUserHelp}</div>
<div>${LabelConnectGuestUserNameHelp}</div>
<div style="margin-top: .75em;"><a href="http://mediabrowser.tv/connect" target="_blank">${ButtonLearnMoreAboutMediaBrowserConnect}</a></div>
</div>