mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
hls updates
This commit is contained in:
parent
3beaf88745
commit
9e470c9f94
21 changed files with 315 additions and 164 deletions
|
@ -12,8 +12,8 @@
|
|||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="support.html" data-role="button">${TabGeneral}</a>
|
||||
<a href="log.html" data-role="button">${TabLogs}</a>
|
||||
<a href="supporter.html" data-role="button">${TabDonate}</a>
|
||||
<a href="supporterkey.html" data-role="button">${TabSupporterKey}</a>
|
||||
<a href="supporter.html" data-role="button" class="tabSupporterMembership">${TabDonate}</a>
|
||||
<a href="supporterkey.html" data-role="button" class="tabSupporterMembership">${TabSupporterKey}</a>
|
||||
<a href="about.html" data-role="button" class="ui-btn-active">${TabAbout}</a>
|
||||
</div>
|
||||
<div style="font-size:24px;">
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<input type="checkbox" id="chkUpcomingStreamingTrailers" />
|
||||
</fieldset>
|
||||
<div class="fieldDescription">${LabelTheseFeaturesRequireSupporterHelpAndTrailers}</div>
|
||||
<div class="fieldDescription"><a href="supporter.html">${ButtonLearnMore}</a></div>
|
||||
<div class="fieldDescription"><a class="lnkSupporterLearnMore" href="supporter.html" style="display:none;">${ButtonLearnMore}</a></div>
|
||||
</li>
|
||||
<li>
|
||||
<label for="chkMyMovieTrailers">${OptionTrailersFromMyMovies}</label>
|
||||
|
|
|
@ -142,6 +142,11 @@ h1 a:hover {
|
|||
position: fixed;
|
||||
}
|
||||
|
||||
/* Show over now playing bar */
|
||||
.ui-panel-display-overlay {
|
||||
z-index: 1098;
|
||||
}
|
||||
|
||||
.ui-panel-inner {
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
|
@ -192,10 +197,10 @@ h1 a:hover {
|
|||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.hiddenScrollY::-webkit-scrollbar {
|
||||
.hiddenScrollY::-webkit-scrollbar {
|
||||
width: 0 !important;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: I have omitted any vendor-prefixes for clarity.
|
||||
|
@ -1193,3 +1198,7 @@ h1 + .accentButton {
|
|||
-ms-user-select: auto !important;
|
||||
user-select: auto !important;
|
||||
}
|
||||
|
||||
.supporterMembershipDisabled .tabSupporterMembership {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="support.html" data-role="button">${TabGeneral}</a>
|
||||
<a href="log.html" data-role="button" class="ui-btn-active">${TabLogs}</a>
|
||||
<a href="supporter.html" data-role="button">${TabDonate}</a>
|
||||
<a href="supporterkey.html" data-role="button">${TabSupporterKey}</a>
|
||||
<a href="supporter.html" data-role="button" class="tabSupporterMembership">${TabDonate}</a>
|
||||
<a href="supporterkey.html" data-role="button" class="tabSupporterMembership">${TabSupporterKey}</a>
|
||||
<a href="about.html" data-role="button">${TabAbout}</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
|
||||
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
|
||||
|
||||
if (pluginSecurityInfo.IsMBSupporter || context != 'sync') {
|
||||
if (pluginSecurityInfo.IsMBSupporter || context != 'sync' || !AppInfo.enableSupporterMembership) {
|
||||
$('.syncPromotion', page).hide();
|
||||
} else {
|
||||
$('.syncPromotion', page).show();
|
||||
|
|
|
@ -54,6 +54,11 @@
|
|||
|
||||
});
|
||||
|
||||
if (AppInfo.enableSupporterMembership) {
|
||||
$('.lnkSupporterLearnMore', page).show();
|
||||
} else {
|
||||
$('.lnkSupporterLearnMore', page).hide();
|
||||
}
|
||||
});
|
||||
|
||||
function cinemaModeConfigurationPage() {
|
||||
|
|
|
@ -818,7 +818,10 @@
|
|||
|
||||
var imgUrl, text;
|
||||
|
||||
if (pluginSecurityInfo.IsMBSupporter) {
|
||||
if (!AppInfo.enableSupporterMembership) {
|
||||
$('.supporterIconContainer', page).remove();
|
||||
}
|
||||
else if (pluginSecurityInfo.IsMBSupporter) {
|
||||
|
||||
imgUrl = "css/images/supporter/supporterbadge.png";
|
||||
text = Globalize.translate('MessageThankYouForSupporting');
|
||||
|
@ -1395,7 +1398,7 @@ $(document).on('pagebeforeshowready', "#dashboardPage", DashboardPage.onPageShow
|
|||
if (!$('.staticSupporterPromotion', page).length) {
|
||||
$('.supporterPromotion', page).remove();
|
||||
|
||||
if (!pluginSecurityInfo.IsMBSupporter) {
|
||||
if (!pluginSecurityInfo.IsMBSupporter && AppInfo.enableSupporterMembership) {
|
||||
$('.content-primary', page).append('<div class="supporterPromotion"><a class="btn btnActionAccent" href="supporter.html" style="font-size:14px;"><div>' + Globalize.translate('HeaderSupportTheTeam') + '</div><div style="font-weight:normal;font-size:90%;margin-top:5px;">' + Globalize.translate('TextEnjoyBonusFeatures') + '</div></a></div>');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,10 +119,25 @@ if (!Array.prototype.filter) {
|
|||
};
|
||||
}
|
||||
|
||||
// TODO: There should be notification services, where each defines what it supports and the best service is chosen based on params
|
||||
var WebNotifications = {
|
||||
|
||||
show: function (data) {
|
||||
if (window.Notification) {
|
||||
|
||||
if (window.cordova && window.cordova.plugins && window.cordova.plugins.notification) {
|
||||
|
||||
window.cordova.plugins.notification.local.schedule({
|
||||
id: new Date().getTime(),
|
||||
title: data.title,
|
||||
text: data.body,
|
||||
//firstAt: monday_9_am,
|
||||
//every: "week",
|
||||
//sound: "file://sounds/reminder.mp3",
|
||||
//data: { meetingId: "123#fg8" },
|
||||
icon: data.icon
|
||||
});
|
||||
}
|
||||
else if (window.Notification) {
|
||||
|
||||
var level = Notification.permissionLevel ? Notification.permissionLevel() : Notification.permission;
|
||||
|
||||
|
@ -196,10 +211,6 @@ var WebNotifications = {
|
|||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
supported: function () {
|
||||
return window.Notification || window.webkitNotifications;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -72,9 +72,29 @@
|
|||
}
|
||||
}
|
||||
|
||||
self.showChaptersFlyout = function () {
|
||||
|
||||
var html = getChaptersFlyoutHtml();
|
||||
|
||||
var elem = $('.videoChaptersPopup').html(html)
|
||||
.trigger('create')
|
||||
.popup("option", "positionTo", $('.videoChaptersButton'))
|
||||
.off('popupafterclose', onFlyoutClose)
|
||||
.on('popupafterclose', onFlyoutClose);
|
||||
|
||||
onPopupOpen(elem);
|
||||
};
|
||||
|
||||
self.showSubtitleMenu = function () {
|
||||
|
||||
var elem = $('.videoSubtitlePopup').html(getSubtitleTracksHtml())
|
||||
var html = getSubtitleTracksHtml();
|
||||
|
||||
if (!supportsContentOverVideoPlayer()) {
|
||||
showPopupUsingSelect(html, 'subtitles');
|
||||
return;
|
||||
}
|
||||
|
||||
var elem = $('.videoSubtitlePopup').html(html)
|
||||
.trigger('create')
|
||||
.popup("option", "positionTo", $('.videoSubtitleButton'))
|
||||
.off('popupafterclose', onFlyoutClose)
|
||||
|
@ -85,7 +105,14 @@
|
|||
|
||||
self.showQualityFlyout = function () {
|
||||
|
||||
var elem = $('.videoQualityPopup').html(getQualityFlyoutHtml())
|
||||
var html = getQualityFlyoutHtml();
|
||||
|
||||
if (!supportsContentOverVideoPlayer()) {
|
||||
showPopupUsingSelect(html, 'quality');
|
||||
return;
|
||||
}
|
||||
|
||||
var elem = $('.videoQualityPopup').html(html)
|
||||
.trigger('create')
|
||||
.popup("option", "positionTo", $('.videoQualityButton'))
|
||||
.off('popupafterclose', onFlyoutClose)
|
||||
|
@ -94,20 +121,16 @@
|
|||
onPopupOpen(elem);
|
||||
};
|
||||
|
||||
self.showChaptersFlyout = function () {
|
||||
|
||||
var elem = $('.videoChaptersPopup').html(getChaptersFlyoutHtml())
|
||||
.trigger('create')
|
||||
.popup("option", "positionTo", $('.videoChaptersButton'))
|
||||
.off('popupafterclose', onFlyoutClose)
|
||||
.on('popupafterclose', onFlyoutClose);
|
||||
|
||||
onPopupOpen(elem);
|
||||
};
|
||||
|
||||
self.showAudioTracksFlyout = function () {
|
||||
|
||||
var elem = $('.videoAudioPopup').html(getAudioTracksHtml())
|
||||
var html = getAudioTracksHtml();
|
||||
|
||||
if (!supportsContentOverVideoPlayer()) {
|
||||
showPopupUsingSelect(html, 'audio');
|
||||
return;
|
||||
}
|
||||
|
||||
var elem = $('.videoAudioPopup').html(html)
|
||||
.trigger('create')
|
||||
.popup("option", "positionTo", $('.videoAudioButton'))
|
||||
.off('popupafterclose', onFlyoutClose)
|
||||
|
@ -116,6 +139,55 @@
|
|||
onPopupOpen(elem);
|
||||
};
|
||||
|
||||
function openSelect(selector) {
|
||||
var element = $(selector)[0], worked = false;
|
||||
if (document.createEvent) { // all browsers
|
||||
var e = document.createEvent("MouseEvents");
|
||||
e.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
worked = element.dispatchEvent(e);
|
||||
} else if (element.fireEvent) { // ie
|
||||
worked = element.fireEvent("onmousedown");
|
||||
}
|
||||
if (!worked) { // unknown browser / error
|
||||
}
|
||||
}
|
||||
|
||||
function showPopupUsingSelect(html, type) {
|
||||
|
||||
var re = new RegExp('<br/>', 'g');
|
||||
|
||||
html = html.replace(re, ' • ');
|
||||
|
||||
var options = $('.mediaPopupOption', $(html)).get().map(function (e) {
|
||||
|
||||
var selected = $(e).hasClass('selectedMediaPopupOption') ? ' selected="selected"' : '';
|
||||
return '<option' + selected + ' value="' + e.getAttribute('data-value') + '">' + $(e).text() + '</option>';
|
||||
});
|
||||
|
||||
html = '<select style="position:absolute;z-index:9999999;top:10px;right:5px;">' + options.join('') + '</select>';
|
||||
|
||||
var select = $(html).appendTo(document.body).on('change', function () {
|
||||
|
||||
var value = this.value;
|
||||
$(this).remove();
|
||||
|
||||
if (type == 'audio') {
|
||||
onAudioOptionSelected(value);
|
||||
}
|
||||
else if (type == 'subtitles') {
|
||||
onSubtitleOptionSelected(value);
|
||||
}
|
||||
else if (type == 'quality') {
|
||||
onQualityOptionSelected(value);
|
||||
}
|
||||
|
||||
}).on('blur', function () {
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
openSelect(select);
|
||||
}
|
||||
|
||||
self.setAudioStreamIndex = function (index) {
|
||||
self.changeStream(self.getCurrentTicks(), { AudioStreamIndex: index });
|
||||
};
|
||||
|
@ -499,6 +571,29 @@
|
|||
self.changeStream(Math.floor(newPositionTicks));
|
||||
}
|
||||
|
||||
function onAudioOptionSelected(value) {
|
||||
var index = parseInt(value);
|
||||
|
||||
self.setAudioStreamIndex(index);
|
||||
}
|
||||
|
||||
function onSubtitleOptionSelected(value) {
|
||||
var index = parseInt(value);
|
||||
|
||||
self.setSubtitleStreamIndex(index);
|
||||
}
|
||||
|
||||
function onQualityOptionSelected(value) {
|
||||
var bitrate = parseInt(value);
|
||||
|
||||
AppSettings.maxStreamingBitrate(bitrate);
|
||||
|
||||
self.changeStream(self.getCurrentTicks(), {
|
||||
|
||||
Bitrate: bitrate
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
|
||||
var parent = $("#mediaPlayer");
|
||||
|
@ -532,9 +627,7 @@
|
|||
$('.videoAudioPopup').on('click', '.mediaPopupOption', function () {
|
||||
|
||||
if (!$(this).hasClass('selectedMediaPopupOption')) {
|
||||
var index = parseInt(this.getAttribute('data-index'));
|
||||
|
||||
self.setAudioStreamIndex(index);
|
||||
onAudioOptionSelected(this.getAttribute('data-value'));
|
||||
}
|
||||
|
||||
$('.videoAudioPopup').popup('close');
|
||||
|
@ -546,9 +639,7 @@
|
|||
|
||||
if (!$(this).hasClass('selectedMediaPopupOption')) {
|
||||
|
||||
var index = parseInt(this.getAttribute('data-index'));
|
||||
|
||||
self.setSubtitleStreamIndex(index);
|
||||
onSubtitleOptionSelected(this.getAttribute('data-value'));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -556,14 +647,7 @@
|
|||
|
||||
if (!$(this).hasClass('selectedMediaPopupOption')) {
|
||||
|
||||
var bitrate = parseInt(this.getAttribute('data-bitrate'));
|
||||
|
||||
AppSettings.maxStreamingBitrate(bitrate);
|
||||
|
||||
self.changeStream(self.getCurrentTicks(), {
|
||||
|
||||
Bitrate: bitrate
|
||||
});
|
||||
onQualityOptionSelected(this.getAttribute('data-value'));
|
||||
}
|
||||
|
||||
$('.videoQualityPopup').popup('close');
|
||||
|
@ -597,26 +681,6 @@
|
|||
|
||||
tooltip.remove();
|
||||
});
|
||||
|
||||
$('.videoSubtitleButton').on('click', function () {
|
||||
|
||||
self.showSubtitleMenu();
|
||||
});
|
||||
|
||||
$('.videoQualityButton').on('click', function () {
|
||||
|
||||
self.showQualityFlyout();
|
||||
});
|
||||
|
||||
$('.videoAudioButton').on('click', function () {
|
||||
|
||||
self.showAudioTracksFlyout();
|
||||
});
|
||||
|
||||
$('.videoChaptersButton').on('click', function () {
|
||||
|
||||
self.showChaptersFlyout();
|
||||
});
|
||||
});
|
||||
|
||||
function idleHandler() {
|
||||
|
@ -777,7 +841,7 @@
|
|||
cssClass += ' selectedMediaPopupOption';
|
||||
}
|
||||
|
||||
var optionHtml = '<li><a data-index="' + stream.Index + '" class="' + cssClass + '" href="#">';
|
||||
var optionHtml = '<li><a data-value="' + stream.Index + '" class="' + cssClass + '" href="#">';
|
||||
|
||||
optionHtml += '<p style="margin:0;">';
|
||||
|
||||
|
@ -862,7 +926,7 @@
|
|||
cssClass += ' selectedMediaPopupOption';
|
||||
}
|
||||
|
||||
var optionHtml = '<li><a data-index="' + stream.Index + '" class="' + cssClass + '" href="#">';
|
||||
var optionHtml = '<li><a data-value="' + stream.Index + '" class="' + cssClass + '" href="#">';
|
||||
|
||||
optionHtml += '<p style="margin:0;">';
|
||||
|
||||
|
@ -944,7 +1008,7 @@
|
|||
cssClass += ' selectedMediaPopupOption';
|
||||
}
|
||||
|
||||
var optionHtml = '<li><a data-bitrate="' + option.bitrate + '" class="' + cssClass + '" href="#">';
|
||||
var optionHtml = '<li><a data-valued="' + option.bitrate + '" class="' + cssClass + '" href="#">';
|
||||
|
||||
optionHtml += '<p style="margin:0;">';
|
||||
|
||||
|
@ -1071,6 +1135,10 @@
|
|||
|
||||
};
|
||||
|
||||
function supportsContentOverVideoPlayer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
self.playVideoInternal = function (item, mediaSource, startPosition, streamInfo) {
|
||||
|
||||
var videoUrl = streamInfo.url;
|
||||
|
@ -1150,7 +1218,7 @@
|
|||
$('.videoSubtitleButton').hide();
|
||||
}
|
||||
|
||||
if (item.Chapters && item.Chapters.length) {
|
||||
if (item.Chapters && item.Chapters.length && supportsContentOverVideoPlayer()) {
|
||||
$('.videoChaptersButton').show();
|
||||
} else {
|
||||
$('.videoChaptersButton').hide();
|
||||
|
@ -1162,7 +1230,7 @@
|
|||
$('#video-fullscreenButton', videoControls).show();
|
||||
}
|
||||
|
||||
if ($.browser.mobile) {
|
||||
if (AppInfo.hasPhysicalVolumeButtons) {
|
||||
$('.volumeSliderContainer', videoControls).addClass('hide');
|
||||
$('.muteButton', videoControls).addClass('hide');
|
||||
$('.unmuteButton', videoControls).addClass('hide');
|
||||
|
|
|
@ -943,6 +943,11 @@
|
|||
|
||||
self.getPosterUrl = function (item) {
|
||||
|
||||
// Safari often shows the poster under the video, which doesn't look good
|
||||
if ($.browser.safari) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var screenWidth = Math.max(screen.height, screen.width);
|
||||
|
||||
if (item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||
|
@ -1717,7 +1722,17 @@
|
|||
|
||||
}).on("timeupdate.mediaplayerevent", function () {
|
||||
|
||||
self.setCurrentTime(self.getCurrentTicks(this));
|
||||
var currentTicks = self.getCurrentTicks(this);
|
||||
// Seeing transcoded audio looping in safari, going past the runtime but restarting the audio
|
||||
if ($.browser.safari && self.currentDurationTicks && (currentTicks > self.currentDurationTicks)) {
|
||||
if (currentPlaylistIndex < self.playlist.length - 1) {
|
||||
self.nextTrack();
|
||||
} else {
|
||||
self.stop();
|
||||
}
|
||||
} else {
|
||||
self.setCurrentTime(currentTicks);
|
||||
}
|
||||
|
||||
})[0];
|
||||
};
|
||||
|
@ -1734,7 +1749,7 @@
|
|||
|
||||
window.MediaPlayer = new mediaPlayer();
|
||||
|
||||
Dashboard.ready(function() {
|
||||
Dashboard.ready(function () {
|
||||
window.MediaController.registerPlayer(window.MediaPlayer);
|
||||
window.MediaController.setActivePlayer(window.MediaPlayer, window.MediaPlayer.getTargets()[0]);
|
||||
});
|
||||
|
|
|
@ -45,11 +45,16 @@
|
|||
|
||||
self.showNotificationsFlyout = function () {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
var html = '<div data-role="panel" data-position="right" data-display="overlay" class="notificationsFlyout" data-position-fixed="true" data-theme="a">';
|
||||
|
||||
html += '<h1 style="margin: .25em 0;">';
|
||||
html += '<span style="vertical-align:middle;">' + Globalize.translate('HeaderNotifications') + '</span>';
|
||||
|
||||
if (user.Policy.IsAdministrator) {
|
||||
html += '<a data-role="button" data-inline="true" data-icon="arrow-r" href="notificationlist.html" data-iconpos="notext" style="vertical-align:middle;margin-left:.5em;">' + Globalize.translate('ButtonViewNotifications') + '</a>';
|
||||
}
|
||||
|
||||
html += '</h1>';
|
||||
|
||||
html += '<div>';
|
||||
|
@ -76,10 +81,11 @@
|
|||
var limit = 5;
|
||||
var elem = $('.notificationsFlyoutlist');
|
||||
|
||||
refreshNotifications(startIndex, limit, elem, null, false).done(function() {
|
||||
refreshNotifications(startIndex, limit, elem, null, false).done(function () {
|
||||
|
||||
self.markNotificationsRead([]);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
self.markNotificationsRead = function (ids, callback) {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
var unmuteButton;
|
||||
var muteButton;
|
||||
var volumeSlider;
|
||||
var volumeSliderContainer;
|
||||
var isVolumeSliderActive;
|
||||
var unpauseButton;
|
||||
var pauseButton;
|
||||
|
@ -128,6 +129,8 @@
|
|||
}
|
||||
});
|
||||
|
||||
volumeSliderContainer = $('.volumeSliderContainer', elem);
|
||||
|
||||
positionSlider = $('.positionSlider', elem).on('slidestart', function () {
|
||||
|
||||
isPositionSliderActive = true;
|
||||
|
@ -186,26 +189,6 @@
|
|||
|
||||
var playerInfo = MediaController.getPlayerInfo();
|
||||
|
||||
var supportedCommands = playerInfo.supportedCommands;
|
||||
|
||||
if (supportedCommands.indexOf('SetVolume') == -1) {
|
||||
volumeSlider.prop('disabled', 'disabled');
|
||||
} else {
|
||||
volumeSlider.prop('disabled', '');
|
||||
}
|
||||
|
||||
if (supportedCommands.indexOf('Mute') == -1) {
|
||||
muteButton.prop('disabled', 'disabled');
|
||||
} else {
|
||||
muteButton.prop('disabled', '');
|
||||
}
|
||||
|
||||
if (supportedCommands.indexOf('Unmute') == -1) {
|
||||
unmuteButton.prop('disabled', 'disabled');
|
||||
} else {
|
||||
unmuteButton.prop('disabled', '');
|
||||
}
|
||||
|
||||
var playState = state.PlayState || {};
|
||||
|
||||
if (playState.IsPaused) {
|
||||
|
@ -219,7 +202,7 @@
|
|||
hideButton(unpauseButton);
|
||||
}
|
||||
|
||||
updatePlayerVolumeState(state);
|
||||
updatePlayerVolumeState(state, playerInfo);
|
||||
|
||||
var nowPlayingItem = state.NowPlayingItem || {};
|
||||
if (!isPositionSliderActive) {
|
||||
|
@ -258,25 +241,71 @@
|
|||
updateNowPlayingInfo(state);
|
||||
}
|
||||
|
||||
function updatePlayerVolumeState(state) {
|
||||
function updatePlayerVolumeState(state, playerInfo) {
|
||||
|
||||
playerInfo = playerInfo || MediaController.getPlayerInfo();
|
||||
|
||||
if (!muteButton) {
|
||||
getNowPlayingBar();
|
||||
}
|
||||
|
||||
var playState = state.PlayState || {};
|
||||
var supportedCommands = playerInfo.supportedCommands;
|
||||
|
||||
var showMuteButton = true;
|
||||
var showUnmuteButton = true;
|
||||
var showVolumeSlider = true;
|
||||
|
||||
//if (supportedCommands.indexOf('SetVolume') == -1) {
|
||||
// volumeSlider.prop('disabled', 'disabled');
|
||||
//} else {
|
||||
// volumeSlider.prop('disabled', '');
|
||||
//}
|
||||
|
||||
if (supportedCommands.indexOf('Mute') == -1) {
|
||||
showMuteButton = false;
|
||||
}
|
||||
|
||||
if (supportedCommands.indexOf('Unmute') == -1) {
|
||||
showUnmuteButton = false;
|
||||
}
|
||||
|
||||
if (playState.IsMuted) {
|
||||
|
||||
hideButton(muteButton);
|
||||
showButton(unmuteButton);
|
||||
|
||||
showMuteButton = false;
|
||||
} else {
|
||||
|
||||
showUnmuteButton = false;
|
||||
}
|
||||
|
||||
if (supportedCommands.indexOf('SetVolume') == -1) {
|
||||
showVolumeSlider = false;
|
||||
}
|
||||
|
||||
if (playerInfo.isLocalPlayer && AppInfo.hasPhysicalVolumeButtons) {
|
||||
showMuteButton = false;
|
||||
showUnmuteButton = false;
|
||||
showVolumeSlider = false;
|
||||
}
|
||||
|
||||
if (showMuteButton) {
|
||||
showButton(muteButton);
|
||||
} else {
|
||||
hideButton(muteButton);
|
||||
}
|
||||
|
||||
if (showUnmuteButton) {
|
||||
showButton(unmuteButton);
|
||||
} else {
|
||||
hideButton(unmuteButton);
|
||||
}
|
||||
|
||||
if (showVolumeSlider) {
|
||||
volumeSliderContainer.show();
|
||||
} else {
|
||||
volumeSliderContainer.hide();
|
||||
}
|
||||
|
||||
if (!isVolumeSliderActive) {
|
||||
volumeSlider.val(playState.VolumeLevel || 0);
|
||||
}
|
||||
|
|
|
@ -20,13 +20,8 @@
|
|||
break;
|
||||
case MediaBrowser.ConnectionState.ServerSignIn:
|
||||
{
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
|
||||
Dashboard.onServerChanged(null, null, apiClient);
|
||||
Dashboard.navigate('login.html?serverid=' + result.Servers[0].Id);
|
||||
} else {
|
||||
showServerConnectionFailure();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -179,7 +179,7 @@ var Dashboard = {
|
|||
Dashboard.getUserPromise = null;
|
||||
},
|
||||
|
||||
logout: function (logoutWithServer, forceReload) {
|
||||
logout: function (logoutWithServer) {
|
||||
|
||||
function onLogoutDone() {
|
||||
|
||||
|
@ -192,12 +192,8 @@ var Dashboard = {
|
|||
loginPage = 'login.html';
|
||||
}
|
||||
|
||||
if (forceReload) {
|
||||
window.location.href = loginPage;
|
||||
} else {
|
||||
Dashboard.navigate(loginPage);
|
||||
}
|
||||
}
|
||||
|
||||
if (logoutWithServer === false) {
|
||||
onLogoutDone();
|
||||
|
@ -576,7 +572,7 @@ var Dashboard = {
|
|||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
if (apiClient.accessToken()) {
|
||||
if (apiClient && apiClient.accessToken()) {
|
||||
if (apiClient.enableFooterNotifications) {
|
||||
apiClient.getSystemInfo().done(function (info) {
|
||||
|
||||
|
@ -968,17 +964,11 @@ var Dashboard = {
|
|||
{
|
||||
var args = cmd.Arguments;
|
||||
|
||||
if (args.TimeoutMs && WebNotifications.supported()) {
|
||||
var notification = {
|
||||
title: args.Header,
|
||||
body: args.Text,
|
||||
timeout: args.TimeoutMs
|
||||
};
|
||||
|
||||
WebNotifications.show(notification);
|
||||
if (args.TimeoutMs) {
|
||||
Dashboard.showFooterNotification({ html: "<div><b>" + args.Header + "</b></div>" + args.Text, timeout: args.TimeoutMs });
|
||||
}
|
||||
else {
|
||||
Dashboard.showFooterNotification({ html: "<div><b>" + args.Header + "</b></div>" + args.Text, timeout: args.TimeoutMs });
|
||||
Dashboard.alert({ title: args.Header, message: args.Text });
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1554,9 +1544,11 @@ var AppInfo = {};
|
|||
|
||||
if (!isCordova) {
|
||||
AppInfo.enableFooterNotifications = true;
|
||||
AppInfo.enableSupporterMembership = true;
|
||||
}
|
||||
|
||||
AppInfo.enableUserImage = true;
|
||||
AppInfo.hasPhysicalVolumeButtons = isCordova || $.browser.mobile;
|
||||
}
|
||||
|
||||
function initializeApiClient(apiClient) {
|
||||
|
@ -1678,6 +1670,10 @@ var AppInfo = {};
|
|||
$(document.body).addClass('bottomSecondaryNav');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableSupporterMembership) {
|
||||
$(document.body).addClass('supporterMembershipDisabled');
|
||||
}
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
$(document).addClass('nativeApp');
|
||||
}
|
||||
|
@ -1699,16 +1695,17 @@ var AppInfo = {};
|
|||
videoPlayerHtml += '<button class="mediaButton videoTrackControl previousTrackButton imageButton" title="Previous video" type="button" onclick="MediaPlayer.previousTrack();" data-role="none"><i class="fa fa-step-backward"></i></button>';
|
||||
videoPlayerHtml += '<button class="mediaButton videoTrackControl nextTrackButton imageButton" title="Next video" type="button" onclick="MediaPlayer.nextTrack();" data-role="none"><i class="fa fa-step-forward"></i></button>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoAudioButton imageButton" title="Audio tracks" type="button" data-role="none"><i class="fa fa-music"></i></button>';
|
||||
// Embedding onclicks due to issues not firing in cordova safari
|
||||
videoPlayerHtml += '<button class="mediaButton videoAudioButton imageButton" title="Audio tracks" type="button" data-role="none" onclick="MediaPlayer.showAudioTracksFlyout();"><i class="fa fa-music"></i></button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoAudioPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoSubtitleButton imageButton" title="Subtitles" type="button" data-role="none"><i class="fa fa-text-width"></i></button>';
|
||||
videoPlayerHtml += '<button class="mediaButton videoSubtitleButton imageButton" title="Subtitles" type="button" data-role="none" onclick="MediaPlayer.showSubtitleMenu();"><i class="fa fa-text-width"></i></button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoSubtitlePopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoChaptersButton imageButton" title="Scenes" type="button" data-role="none"><i class="fa fa-video-camera"></i></button>';
|
||||
videoPlayerHtml += '<button class="mediaButton videoChaptersButton imageButton" title="Scenes" type="button" data-role="none" onclick="MediaPlayer.showChaptersFlyout();"><i class="fa fa-video-camera"></i></button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoChaptersPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton videoQualityButton imageButton" title="Quality" type="button" data-role="none"><i class="fa fa-gear"></i></button>';
|
||||
videoPlayerHtml += '<button class="mediaButton videoQualityButton imageButton" title="Quality" type="button" data-role="none" onclick="MediaPlayer.showQualityFlyout();"><i class="fa fa-gear"></i></button>';
|
||||
videoPlayerHtml += '<div data-role="popup" class="videoQualityPopup videoPlayerPopup" data-history="false" data-theme="b"></div>';
|
||||
|
||||
videoPlayerHtml += '<button class="mediaButton imageButton" title="Stop" type="button" onclick="MediaPlayer.stop();" data-role="none"><i class="fa fa-close"></i></button>';
|
||||
|
@ -1961,7 +1958,7 @@ $(document).on('pagecreate', ".page", function () {
|
|||
var isSettingsPage = page.hasClass('type-interior');
|
||||
|
||||
if (!user.Policy.IsAdministrator && isSettingsPage) {
|
||||
window.location.replace("index.html");
|
||||
Dashboard.logout();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1981,7 +1978,7 @@ $(document).on('pagecreate', ".page", function () {
|
|||
if (isConnectMode) {
|
||||
|
||||
if (!Dashboard.isServerlessPage()) {
|
||||
Dashboard.logout(true, true);
|
||||
Dashboard.logout(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1989,7 +1986,7 @@ $(document).on('pagecreate', ".page", function () {
|
|||
if (!isConnectMode && this.id !== "loginPage" && !page.hasClass('forgotPasswordPage') && !page.hasClass('wizardPage')) {
|
||||
|
||||
console.log('Not logged into server. Redirecting to login.');
|
||||
Dashboard.logout(true, true);
|
||||
Dashboard.logout(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -346,6 +346,10 @@
|
|||
|
||||
function isAvailable(item, user) {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return item.SupportsSync;
|
||||
}
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@
|
|||
|
||||
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
|
||||
|
||||
if (pluginSecurityInfo.IsMBSupporter) {
|
||||
if (pluginSecurityInfo.IsMBSupporter || !AppInfo.enableSupporterMembership) {
|
||||
$('.syncPromotion', page).hide();
|
||||
} else {
|
||||
$('.syncPromotion', page).show();
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="support.html" data-role="button" class="ui-btn-active">${TabGeneral}</a>
|
||||
<a href="log.html" data-role="button">${TabLogs}</a>
|
||||
<a href="supporter.html" data-role="button">${TabDonate}</a>
|
||||
<a href="supporterkey.html" data-role="button">${TabSupporterKey}</a>
|
||||
<a href="supporter.html" data-role="button" class="tabSupporterMembership">${TabDonate}</a>
|
||||
<a href="supporterkey.html" data-role="button" class="tabSupporterMembership">${TabSupporterKey}</a>
|
||||
<a href="about.html" data-role="button">${TabAbout}</a>
|
||||
</div>
|
||||
<p>${ProjectHasCommunity}</p>
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="support.html" data-role="button">${TabGeneral}</a>
|
||||
<a href="log.html" data-role="button">${TabLogs}</a>
|
||||
<a href="supporter.html" data-role="button" class="ui-btn-active">${TabDonate}</a>
|
||||
<a href="supporterkey.html" data-role="button">${TabSupporterKey}</a>
|
||||
<a href="supporter.html" data-role="button" class="ui-btn-active tabSupporterMembership">${TabDonate}</a>
|
||||
<a href="supporterkey.html" data-role="button" class="tabSupporterMembership">${TabSupporterKey}</a>
|
||||
<a href="about.html" data-role="button">${TabAbout}</a>
|
||||
</div>
|
||||
|
||||
|
@ -55,6 +55,7 @@
|
|||
</fieldset>
|
||||
<div class="fieldDescription recurringSubscriptionCancellationHelp"></div>
|
||||
|
||||
<!--CORDOVA_EXCLUDE_START-->
|
||||
<fieldset data-role="controlgroup" style="margin-top:1.5em;">
|
||||
<input type="radio" class="radioDonationType" name="radioDonationType" id="radioOneTimeDonation" value="once">
|
||||
<label for="radioOneTimeDonation">
|
||||
|
@ -83,7 +84,6 @@
|
|||
|
||||
<br />
|
||||
|
||||
<!--CORDOVA_EXCLUDE_START-->
|
||||
<input type="hidden" name="cmd" id="ppCmd" value="_xclick">
|
||||
<input type="hidden" name="business" value="donation@mediabrowser.tv">
|
||||
<input type="hidden" name="currency_code" value="USD">
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="support.html" data-role="button">${TabGeneral}</a>
|
||||
<a href="log.html" data-role="button">${TabLogs}</a>
|
||||
<a href="supporter.html" data-role="button">${TabDonate}</a>
|
||||
<a href="supporterkey.html" data-role="button" class="ui-btn-active">${TabSupporterKey}</a>
|
||||
<a href="supporter.html" data-role="button" class="tabSupporterMembership">${TabDonate}</a>
|
||||
<a href="supporterkey.html" data-role="button" class="ui-btn-active tabSupporterMembership">${TabSupporterKey}</a>
|
||||
<a href="about.html" data-role="button">${TabAbout}</a>
|
||||
</div>
|
||||
|
||||
|
|
6
dashboard-ui/thirdparty/apiclient/ajax.js
vendored
6
dashboard-ui/thirdparty/apiclient/ajax.js
vendored
|
@ -8,7 +8,13 @@
|
|||
|
||||
ajax: function(request) {
|
||||
|
||||
try {
|
||||
return jQuery.ajax(request);
|
||||
} catch (err) {
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
deferred.reject();
|
||||
return deferred.promise();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
|
19
dashboard-ui/thirdparty/cordova/chromecast.js
vendored
19
dashboard-ui/thirdparty/cordova/chromecast.js
vendored
|
@ -491,23 +491,26 @@
|
|||
}
|
||||
|
||||
function launchWebApp(device) {
|
||||
device.getWebAppLauncher().launchWebApp(ApplicationID).success(function (session) {
|
||||
|
||||
console.log('launchWebApp success. calling onSessionConnected');
|
||||
onSessionConnected(device, session);
|
||||
|
||||
}).error(function (err) {
|
||||
|
||||
console.log('launchWebApp error: ' + JSON.stringify(err) + '. calling joinWebApp');
|
||||
// First try to join existing session. If it fails, launch a new one
|
||||
|
||||
device.getWebAppLauncher().joinWebApp(ApplicationID).success(function (session) {
|
||||
|
||||
console.log('joinWebApp success. calling onSessionConnected');
|
||||
onSessionConnected(device, session);
|
||||
|
||||
}).error(function (err) {
|
||||
|
||||
console.log('joinWebApp error: ' + JSON.stringify(err) + '. calling joinWebApp');
|
||||
|
||||
device.getWebAppLauncher().launchWebApp(ApplicationID).success(function (session) {
|
||||
|
||||
console.log('launchWebApp success. calling onSessionConnected');
|
||||
onSessionConnected(device, session);
|
||||
|
||||
}).error(function (err1) {
|
||||
|
||||
console.log('joinWebApp error:' + JSON.stringify(err1));
|
||||
console.log('launchWebApp error:' + JSON.stringify(err1));
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue