mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update live tv scrolling
This commit is contained in:
parent
4a0f78149a
commit
3920d73045
39 changed files with 404 additions and 415 deletions
|
@ -940,7 +940,7 @@
|
|||
profile.UserId = $('#selectUser', page).val();
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#dlnaProfilePage", function () {
|
||||
$(document).on('pageinitdepends', "#dlnaProfilePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -1056,19 +1056,24 @@
|
|||
editSubtitleProfile(page);
|
||||
});
|
||||
|
||||
}).on('pageshow', "#dlnaProfilePage", function () {
|
||||
$('.dlnaProfileForm').off('submit', DlnaProfilePage.onSubmit).on('submit', DlnaProfilePage.onSubmit);
|
||||
$('.editDirectPlayProfileForm').off('submit', DlnaProfilePage.onDirectPlayFormSubmit).on('submit', DlnaProfilePage.onDirectPlayFormSubmit);
|
||||
$('.transcodingProfileForm').off('submit', DlnaProfilePage.onTranscodingProfileFormSubmit).on('submit', DlnaProfilePage.onTranscodingProfileFormSubmit);
|
||||
$('.containerProfileForm').off('submit', DlnaProfilePage.onContainerProfileFormSubmit).on('submit', DlnaProfilePage.onContainerProfileFormSubmit);
|
||||
$('.codecProfileForm').off('submit', DlnaProfilePage.onCodecProfileFormSubmit).on('submit', DlnaProfilePage.onCodecProfileFormSubmit);
|
||||
$('.editResponseProfileForm').off('submit', DlnaProfilePage.onResponseProfileFormSubmit).on('submit', DlnaProfilePage.onResponseProfileFormSubmit);
|
||||
$('.identificationHeaderForm').off('submit', DlnaProfilePage.onIdentificationHeaderFormSubmit).on('submit', DlnaProfilePage.onIdentificationHeaderFormSubmit);
|
||||
$('.xmlAttributeForm').off('submit', DlnaProfilePage.onXmlAttributeFormSubmit).on('submit', DlnaProfilePage.onXmlAttributeFormSubmit);
|
||||
$('.subtitleProfileForm').off('submit', DlnaProfilePage.onSubtitleProfileFormSubmit).on('submit', DlnaProfilePage.onSubtitleProfileFormSubmit);
|
||||
|
||||
var page = this;
|
||||
|
||||
loadProfile(page);
|
||||
|
||||
}).on('pagebeforeshow', "#dlnaProfilePage", function () {
|
||||
}).on('pageshowready', "#dlnaProfilePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.radioTabButton', page).checked(false).checkboxradio('refresh');
|
||||
$('#radioInfo', page).checked(true).checkboxradio('refresh').trigger('change');
|
||||
|
||||
loadProfile(page);
|
||||
});
|
||||
|
||||
window.DlnaProfilePage = {
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#dlnaProfilesPage", function () {
|
||||
$(document).on('pageshowready', "#dlnaProfilesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
|
|
@ -17,23 +17,6 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#dlnaServerSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
var promise1 = ApiClient.getNamedConfiguration("dlna");
|
||||
var promise2 = ApiClient.getUsers();
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
|
||||
loadPage(page, response1[0], response2[0]);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function onSubmit() {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
@ -56,8 +39,25 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
window.DlnaServerSettingsPage = {
|
||||
onSubmit: onSubmit
|
||||
};
|
||||
$(document).on('pageinitpdepends', "#dlnaServerSettingsPage", function () {
|
||||
|
||||
$('.dlnaServerSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
}).on('pageshowready', "#dlnaServerSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
var promise1 = ApiClient.getNamedConfiguration("dlna");
|
||||
var promise2 = ApiClient.getUsers();
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
|
||||
loadPage(page, response1[0], response2[0]);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
|
|
@ -9,22 +9,8 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#dlnaSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getNamedConfiguration("dlna").done(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function onSubmit() {
|
||||
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
@ -42,8 +28,22 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
window.DlnaSettingsPage = {
|
||||
onSubmit: onSubmit
|
||||
};
|
||||
$(document).on('pageinitdepends', "#dlnaSettingsPage", function () {
|
||||
|
||||
$('.dlnaSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
}).on('pageshowready', "#dlnaSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getNamedConfiguration("dlna").done(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
|
|
@ -5,19 +5,39 @@
|
|||
$('#chkEnableDebugEncodingLogging', page).checked(config.EnableDebugLogging).checkboxradio('refresh');
|
||||
$('#chkEnableThrottle', page).checked(config.EnableThrottling).checkboxradio('refresh');
|
||||
|
||||
$('.radioEncodingQuality', page).each(function() {
|
||||
$('.radioEncodingQuality', page).each(function () {
|
||||
|
||||
this.checked = config.EncodingQuality == this.value;
|
||||
|
||||
}).checkboxradio('refresh');
|
||||
|
||||
|
||||
$('#txtDownMixAudioBoost', page).val(config.DownMixAudioBoost);
|
||||
$('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || '');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#encodingSettingsPage", function () {
|
||||
function onSubmit() {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getNamedConfiguration("encoding").done(function (config) {
|
||||
|
||||
config.EnableDebugLogging = $('#chkEnableDebugEncodingLogging', form).checked();
|
||||
config.EncodingQuality = $('.radioEncodingQuality:checked', form).val();
|
||||
config.DownMixAudioBoost = $('#txtDownMixAudioBoost', form).val();
|
||||
config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val();
|
||||
config.EnableThrottling = $('#chkEnableThrottle', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("encoding", config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#encodingSettingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -41,7 +61,10 @@
|
|||
});
|
||||
});
|
||||
|
||||
}).on('pageshow', "#encodingSettingsPage", function () {
|
||||
$('.encodingSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
|
||||
}).on('pageshowready', "#encodingSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -54,28 +77,4 @@
|
|||
});
|
||||
});
|
||||
|
||||
window.EncodingSettingsPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getNamedConfiguration("encoding").done(function (config) {
|
||||
|
||||
config.EnableDebugLogging = $('#chkEnableDebugEncodingLogging', form).checked();
|
||||
config.EncodingQuality = $('.radioEncodingQuality:checked', form).val();
|
||||
config.DownMixAudioBoost = $('#txtDownMixAudioBoost', form).val();
|
||||
config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val();
|
||||
config.EnableThrottling = $('#chkEnableThrottle', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("encoding", config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
|
|
@ -520,6 +520,12 @@
|
|||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
||||
|
||||
if (items.length == 1) {
|
||||
|
||||
Dashboard.navigate(LibraryBrowser.getHref(items[0], context));
|
||||
return;
|
||||
}
|
||||
|
||||
var ids = items.map(function (i) {
|
||||
return i.Id;
|
||||
});
|
||||
|
|
|
@ -20,7 +20,30 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#librarySettingsPage", function () {
|
||||
function onSubmit() {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.ItemsByNamePath = $('#txtItemsByNamePath', form).val();
|
||||
|
||||
config.SeasonZeroDisplayName = $('#txtSeasonZeroName', form).val();
|
||||
|
||||
config.EnableRealtimeMonitor = $('#chkEnableRealtimeMonitor', form).checked();
|
||||
|
||||
config.EnableAudioArchiveFiles = $('#chkEnableAudioArchiveFiles', form).checked();
|
||||
config.EnableVideoArchiveFiles = $('#chkEnableVideoArchiveFiles', form).checked();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageshowready', "#librarySettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -32,7 +55,7 @@
|
|||
|
||||
});
|
||||
|
||||
}).on('pageinit', "#librarySettingsPage", function () {
|
||||
}).on('pageinitdepends', "#librarySettingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -55,36 +78,8 @@
|
|||
instruction: Globalize.translate('HeaderSelectImagesByNamePathHelp')
|
||||
});
|
||||
});
|
||||
|
||||
$('.librarySettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
});
|
||||
|
||||
function librarySettingsPage() {
|
||||
|
||||
var self = this;
|
||||
|
||||
self.onSubmit = function () {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.ItemsByNamePath = $('#txtItemsByNamePath', form).val();
|
||||
|
||||
config.SeasonZeroDisplayName = $('#txtSeasonZeroName', form).val();
|
||||
|
||||
config.EnableRealtimeMonitor = $('#chkEnableRealtimeMonitor', form).checked();
|
||||
|
||||
config.EnableAudioArchiveFiles = $('#chkEnableAudioArchiveFiles', form).checked();
|
||||
config.EnableVideoArchiveFiles = $('#chkEnableVideoArchiveFiles', form).checked();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
window.LibrarySettingsPage = new librarySettingsPage();
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
|
|
@ -186,7 +186,7 @@
|
|||
|
||||
if (canPlayAac && $.browser.safari) {
|
||||
profile.TranscodingProfiles.push({
|
||||
Container: 'aac',
|
||||
Container: 'ts',
|
||||
Type: 'Audio',
|
||||
AudioCodec: 'aac',
|
||||
Context: 'Streaming',
|
||||
|
@ -448,6 +448,15 @@
|
|||
|
||||
self.canPlayNativeHls = function () {
|
||||
|
||||
// Don't use HLS on android 4.4, regardless of what the browser reports
|
||||
if ($.browser.android) {
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if (agent.indexOf('android 4.4') != -1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var media = document.createElement('video');
|
||||
|
||||
// safari
|
||||
|
@ -1597,9 +1606,9 @@
|
|||
self._canPlayWebm = null;
|
||||
self.canPlayWebm = function () {
|
||||
|
||||
if (self._canPlayWebm == null) {
|
||||
self._canPlayWebm = document.createElement('video').canPlayType('video/webm').replace(/no/, '');
|
||||
}
|
||||
if (self._canPlayWebm == null) {
|
||||
self._canPlayWebm = document.createElement('video').canPlayType('video/webm').replace(/no/, '');
|
||||
}
|
||||
return self._canPlayWebm;
|
||||
};
|
||||
|
||||
|
@ -1699,111 +1708,111 @@
|
|||
|
||||
})(document, setTimeout, clearTimeout, screen, window.appStorage, $, setInterval, window);
|
||||
|
||||
(function(){
|
||||
(function () {
|
||||
|
||||
function htmlMediaRenderer(type) {
|
||||
function htmlMediaRenderer(type) {
|
||||
|
||||
var mediaElement;
|
||||
var self = this;
|
||||
var mediaElement;
|
||||
var self = this;
|
||||
|
||||
function onEnded() {
|
||||
$(self).trigger('ended');
|
||||
}
|
||||
function onEnded() {
|
||||
$(self).trigger('ended');
|
||||
}
|
||||
|
||||
function onTimeUpdate() {
|
||||
$(self).trigger('timeupdate');
|
||||
}
|
||||
function onTimeUpdate() {
|
||||
$(self).trigger('timeupdate');
|
||||
}
|
||||
|
||||
function onVolumeChange() {
|
||||
$(self).trigger('volumechange');
|
||||
}
|
||||
function onVolumeChange() {
|
||||
$(self).trigger('volumechange');
|
||||
}
|
||||
|
||||
function onOneAudioPlaying() {
|
||||
$('.mediaPlayerAudioContainer').hide();
|
||||
}
|
||||
function onOneAudioPlaying() {
|
||||
$('.mediaPlayerAudioContainer').hide();
|
||||
}
|
||||
|
||||
function onPlaying() {
|
||||
$(self).trigger('playing');
|
||||
}
|
||||
function onPlaying() {
|
||||
$(self).trigger('playing');
|
||||
}
|
||||
|
||||
function onPlay() {
|
||||
$(self).trigger('play');
|
||||
}
|
||||
function onPlay() {
|
||||
$(self).trigger('play');
|
||||
}
|
||||
|
||||
function onPause() {
|
||||
$(self).trigger('pause');
|
||||
}
|
||||
function onPause() {
|
||||
$(self).trigger('pause');
|
||||
}
|
||||
|
||||
function onClick() {
|
||||
$(self).trigger('click');
|
||||
}
|
||||
function onClick() {
|
||||
$(self).trigger('click');
|
||||
}
|
||||
|
||||
function onDblClick() {
|
||||
$(self).trigger('dblclick');
|
||||
}
|
||||
function onDblClick() {
|
||||
$(self).trigger('dblclick');
|
||||
}
|
||||
|
||||
function onError() {
|
||||
function onError() {
|
||||
|
||||
var errorCode = this.error ? this.error.code : '';
|
||||
var errorCode = this.error ? this.error.code : '';
|
||||
console.log('Media element error code: ' + errorCode);
|
||||
|
||||
$(self).trigger('error');
|
||||
}
|
||||
}
|
||||
|
||||
function onLoadedMetadata() {
|
||||
function onLoadedMetadata() {
|
||||
|
||||
// The IE video player won't autoplay without this
|
||||
if ($.browser.msie) {
|
||||
this.play();
|
||||
}
|
||||
}
|
||||
// The IE video player won't autoplay without this
|
||||
if ($.browser.msie) {
|
||||
this.play();
|
||||
}
|
||||
}
|
||||
|
||||
function onOneVideoPlaying() {
|
||||
function onOneVideoPlaying() {
|
||||
|
||||
var currentSrc = (this.currentSrc || '').toLowerCase();
|
||||
var currentSrc = (this.currentSrc || '').toLowerCase();
|
||||
|
||||
var parts = currentSrc.split('#');
|
||||
var parts = currentSrc.split('#');
|
||||
|
||||
if (parts.length > 1) {
|
||||
if (parts.length > 1) {
|
||||
|
||||
var parts = parts[parts.length -1].split('=');
|
||||
var parts = parts[parts.length - 1].split('=');
|
||||
|
||||
if (parts.length == 2) {
|
||||
if (parts.length == 2) {
|
||||
|
||||
var startPositionInSeekParam = parseFloat(parts[1]);
|
||||
var startPositionInSeekParam = parseFloat(parts[1]);
|
||||
|
||||
// Appending #t=xxx to the query string doesn't seem to work with HLS
|
||||
if (startPositionInSeekParam && currentSrc.indexOf('.m3u8') != -1) {
|
||||
var element = this;
|
||||
setTimeout(function () {
|
||||
element.currentTime = startPositionInSeekParam;
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Appending #t=xxx to the query string doesn't seem to work with HLS
|
||||
if (startPositionInSeekParam && currentSrc.indexOf('.m3u8') != -1) {
|
||||
var element = this;
|
||||
setTimeout(function () {
|
||||
element.currentTime = startPositionInSeekParam;
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createAudioElement() {
|
||||
function createAudioElement() {
|
||||
|
||||
var elem = $('.mediaPlayerAudio');
|
||||
var elem = $('.mediaPlayerAudio');
|
||||
|
||||
if (!elem.length) {
|
||||
var html = '';
|
||||
var html = '';
|
||||
|
||||
var requiresControls = !MediaPlayer.canAutoPlayAudio();
|
||||
var requiresControls = !MediaPlayer.canAutoPlayAudio();
|
||||
|
||||
if (requiresControls) {
|
||||
html += '<div class="mediaPlayerAudioContainer"><div class="mediaPlayerAudioContainerInner">';;
|
||||
} else {
|
||||
html += '<div class="mediaPlayerAudioContainer" style="display:none;"><div class="mediaPlayerAudioContainerInner">';;
|
||||
}
|
||||
if (requiresControls) {
|
||||
html += '<div class="mediaPlayerAudioContainer"><div class="mediaPlayerAudioContainerInner">';;
|
||||
} else {
|
||||
html += '<div class="mediaPlayerAudioContainer" style="display:none;"><div class="mediaPlayerAudioContainerInner">';;
|
||||
}
|
||||
|
||||
html += '<audio class="mediaPlayerAudio" crossorigin="anonymous" controls>';
|
||||
html += '</audio></div></div>';
|
||||
html += '<audio class="mediaPlayerAudio" crossorigin="anonymous" controls>';
|
||||
html += '</audio></div></div>';
|
||||
|
||||
$(document.body).append(html);
|
||||
$(document.body).append(html);
|
||||
|
||||
elem = $('.mediaPlayerAudio');
|
||||
elem = $('.mediaPlayerAudio');
|
||||
}
|
||||
|
||||
return $(elem)
|
||||
|
@ -1815,11 +1824,11 @@
|
|||
.on('pause', onPause)
|
||||
.on('playing', onPlaying)
|
||||
.on('error', onError)[0];
|
||||
}
|
||||
}
|
||||
|
||||
function createVideoElement() {
|
||||
function createVideoElement() {
|
||||
|
||||
var elem = $('.itemVideo');
|
||||
var elem = $('.itemVideo');
|
||||
|
||||
return $(elem)
|
||||
.one('.loadedmetadata')
|
||||
|
@ -1831,62 +1840,62 @@
|
|||
.on('pause', onPause)
|
||||
.on('playing', onPlaying)
|
||||
.on('error', onError)[0];
|
||||
}
|
||||
}
|
||||
|
||||
self.currentTime = function(val) {
|
||||
self.currentTime = function (val) {
|
||||
|
||||
if (mediaElement) {
|
||||
if (val != null) {
|
||||
mediaElement.currentTime = val;
|
||||
return;
|
||||
}
|
||||
if (mediaElement) {
|
||||
if (val != null) {
|
||||
mediaElement.currentTime = val;
|
||||
return;
|
||||
}
|
||||
|
||||
return mediaElement.currentTime;
|
||||
}
|
||||
};
|
||||
return mediaElement.currentTime;
|
||||
}
|
||||
};
|
||||
|
||||
self.duration = function(val) {
|
||||
self.duration = function (val) {
|
||||
|
||||
if (mediaElement) {
|
||||
return mediaElement.duration;
|
||||
}
|
||||
if (mediaElement) {
|
||||
return mediaElement.duration;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
return null;
|
||||
};
|
||||
|
||||
self.pause = function() {
|
||||
if (mediaElement) {
|
||||
mediaElement.pause();
|
||||
}
|
||||
};
|
||||
self.pause = function () {
|
||||
if (mediaElement) {
|
||||
mediaElement.pause();
|
||||
}
|
||||
};
|
||||
|
||||
self.unpause = function() {
|
||||
if (mediaElement) {
|
||||
mediaElement.play();
|
||||
}
|
||||
};
|
||||
self.unpause = function () {
|
||||
if (mediaElement) {
|
||||
mediaElement.play();
|
||||
}
|
||||
};
|
||||
|
||||
self.volume = function(val) {
|
||||
if (mediaElement) {
|
||||
if (val != null) {
|
||||
mediaElement.volume = val;
|
||||
return;
|
||||
}
|
||||
self.volume = function (val) {
|
||||
if (mediaElement) {
|
||||
if (val != null) {
|
||||
mediaElement.volume = val;
|
||||
return;
|
||||
}
|
||||
|
||||
return mediaElement.volume;
|
||||
}
|
||||
};
|
||||
return mediaElement.volume;
|
||||
}
|
||||
};
|
||||
|
||||
self.setCurrentSrc = function(val) {
|
||||
self.setCurrentSrc = function (val) {
|
||||
|
||||
var elem = mediaElement;
|
||||
var elem = mediaElement;
|
||||
|
||||
if (!elem) {
|
||||
return;
|
||||
}
|
||||
if (!elem) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!val) {
|
||||
elem.src = null;
|
||||
if (!val) {
|
||||
elem.src = null;
|
||||
elem.src = "";
|
||||
|
||||
// When the browser regains focus it may start auto-playing the last video
|
||||
|
@ -1895,67 +1904,67 @@
|
|||
elem.play();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
elem.src = val;
|
||||
elem.src = val;
|
||||
|
||||
if (elem.tagName.toLowerCase() == 'audio') {
|
||||
elem.play();
|
||||
}
|
||||
else {
|
||||
if (elem.tagName.toLowerCase() == 'audio') {
|
||||
elem.play();
|
||||
}
|
||||
else {
|
||||
|
||||
$(elem).one("loadedmetadata.mediaplayerevent", onLoadedMetadata);
|
||||
}
|
||||
};
|
||||
$(elem).one("loadedmetadata.mediaplayerevent", onLoadedMetadata);
|
||||
}
|
||||
};
|
||||
|
||||
self.currentSrc = function() {
|
||||
if (mediaElement) {
|
||||
return mediaElement.currentSrc;
|
||||
}
|
||||
};
|
||||
self.currentSrc = function () {
|
||||
if (mediaElement) {
|
||||
return mediaElement.currentSrc;
|
||||
}
|
||||
};
|
||||
|
||||
self.paused = function() {
|
||||
self.paused = function () {
|
||||
|
||||
if (mediaElement) {
|
||||
return mediaElement.paused;
|
||||
}
|
||||
if (mediaElement) {
|
||||
return mediaElement.paused;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
return false;
|
||||
};
|
||||
|
||||
self.destroy = function() {
|
||||
self.destroy = function () {
|
||||
|
||||
self.setCurrentSrc(null);
|
||||
self.setCurrentSrc(null);
|
||||
|
||||
var elem = mediaElement;
|
||||
var elem = mediaElement;
|
||||
|
||||
if (elem) {
|
||||
if (elem) {
|
||||
|
||||
$(elem).off();
|
||||
$(elem).off();
|
||||
|
||||
if (elem.tagName.toLowerCase() != 'audio') {
|
||||
$(elem).remove();
|
||||
if (elem.tagName.toLowerCase() != 'audio') {
|
||||
$(elem).remove();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
self.setPoster = function(url) {
|
||||
var elem = mediaElement;
|
||||
self.setPoster = function (url) {
|
||||
var elem = mediaElement;
|
||||
|
||||
if (elem) {
|
||||
elem.poster = url;
|
||||
}
|
||||
};
|
||||
if (elem) {
|
||||
elem.poster = url;
|
||||
}
|
||||
};
|
||||
|
||||
if (type == 'audio') {
|
||||
mediaElement = createAudioElement();
|
||||
}
|
||||
else {
|
||||
mediaElement = createVideoElement();
|
||||
}
|
||||
}
|
||||
if (type == 'audio') {
|
||||
mediaElement = createAudioElement();
|
||||
}
|
||||
else {
|
||||
mediaElement = createVideoElement();
|
||||
}
|
||||
}
|
||||
|
||||
window.HtmlMediaRenderer = htmlMediaRenderer;
|
||||
window.HtmlMediaRenderer = htmlMediaRenderer;
|
||||
|
||||
})();
|
|
@ -1,7 +1,7 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
var metadataKey = "xbmcmetadata";
|
||||
|
||||
|
||||
function loadPage(page, config, users) {
|
||||
|
||||
var html = '<option value="" selected="selected"></option>';
|
||||
|
@ -19,7 +19,31 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#metadataNfoPage", function () {
|
||||
function onSubmit() {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getNamedConfiguration(metadataKey).done(function (config) {
|
||||
|
||||
config.UserId = $('#selectUser', form).val() || null;
|
||||
config.ReleaseDateFormat = $('#selectReleaseDateFormat', form).val();
|
||||
config.SaveImagePathsInNfo = $('#chkSaveImagePaths', form).checked();
|
||||
config.EnablePathSubstitution = $('#chkEnablePathSubstitution', form).checked();
|
||||
config.EnableExtraThumbsDuplication = $('#chkEnableExtraThumbs', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration(metadataKey, config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#metadataNfoPage", function () {
|
||||
|
||||
$('.metadataNfoForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
}).on('pageshowready', "#metadataNfoPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -34,28 +58,4 @@
|
|||
});
|
||||
});
|
||||
|
||||
window.NfoMetadataPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getNamedConfiguration(metadataKey).done(function (config) {
|
||||
|
||||
config.UserId = $('#selectUser', form).val() || null;
|
||||
config.ReleaseDateFormat = $('#selectReleaseDateFormat', form).val();
|
||||
config.SaveImagePathsInNfo = $('#chkSaveImagePaths', form).checked();
|
||||
config.EnablePathSubstitution = $('#chkEnablePathSubstitution', form).checked();
|
||||
config.EnableExtraThumbsDuplication = $('#chkEnableExtraThumbs', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration(metadataKey, config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
var ScheduledTaskPage = {
|
||||
|
||||
onPageShow: function () {
|
||||
|
||||
ScheduledTaskPage.refreshScheduledTask();
|
||||
},
|
||||
|
||||
refreshScheduledTask: function () {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -154,7 +149,7 @@
|
|||
|
||||
$('#selectTriggerType', page).val('DailyTrigger').trigger('change').selectmenu('refresh');
|
||||
|
||||
$('#popupAddTrigger', page).on("popupafteropen",function() {
|
||||
$('#popupAddTrigger', page).on("popupafteropen", function () {
|
||||
$('#addTriggerForm input:first', this).focus();
|
||||
}).popup("open").on("popupafterclose", function () {
|
||||
|
||||
|
@ -162,35 +157,6 @@
|
|||
$(this).off("popupafterclose");
|
||||
});
|
||||
},
|
||||
|
||||
onSubmit: function() {
|
||||
|
||||
ScheduledTaskPage.addTrigger();
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
addTrigger: function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var id = getParameterByName('id');
|
||||
|
||||
ApiClient.getScheduledTask(id).done(function (task) {
|
||||
|
||||
task.Triggers.push(ScheduledTaskPage.getTriggerToAdd());
|
||||
|
||||
ApiClient.updateScheduledTaskTriggers(task.Id, task.Triggers).done(function () {
|
||||
|
||||
$('#popupAddTrigger').popup('close');
|
||||
|
||||
ScheduledTaskPage.refreshScheduledTask();
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
confirmDeleteTrigger: function (index) {
|
||||
|
||||
|
@ -319,4 +285,39 @@
|
|||
}
|
||||
};
|
||||
|
||||
$(document).on('pageshow', "#scheduledTaskPage", ScheduledTaskPage.onPageShow);
|
||||
(function () {
|
||||
|
||||
function onSubmit() {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var id = getParameterByName('id');
|
||||
|
||||
ApiClient.getScheduledTask(id).done(function (task) {
|
||||
|
||||
task.Triggers.push(ScheduledTaskPage.getTriggerToAdd());
|
||||
|
||||
ApiClient.updateScheduledTaskTriggers(task.Id, task.Triggers).done(function () {
|
||||
|
||||
$('#popupAddTrigger').popup('close');
|
||||
|
||||
ScheduledTaskPage.refreshScheduledTask();
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#scheduledTaskPage", function () {
|
||||
|
||||
$('.addTriggerForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
}).on('pageshowready', "#scheduledTaskPage", function () {
|
||||
|
||||
ScheduledTaskPage.refreshScheduledTask();
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
|
|
|
@ -179,17 +179,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#scheduledTasksPage", function () {
|
||||
$(document).on('pageinitdepends', "#scheduledTasksPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
startInterval();
|
||||
reloadList(page);
|
||||
|
||||
$(ApiClient).on("websocketmessage", onWebSocketMessage).on("websocketopen", onWebSocketConnectionOpen);
|
||||
|
||||
$('#divScheduledTasks', page).on('click', '.btnStartTask', function () {
|
||||
|
||||
var button = this;
|
||||
|
@ -211,6 +204,17 @@
|
|||
});
|
||||
});
|
||||
|
||||
}).on('pageshowready', "#scheduledTasksPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
startInterval();
|
||||
reloadList(page);
|
||||
|
||||
$(ApiClient).on("websocketmessage", onWebSocketMessage).on("websocketopen", onWebSocketConnectionOpen);
|
||||
|
||||
}).on('pagehide', "#scheduledTasksPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
|
||||
if (createIfNeeded && !elem.length) {
|
||||
|
||||
var html = '<div class="searchResultsOverlay ui-page-theme-b">';
|
||||
var html = '<div class="searchResultsOverlay ui-page-theme-b smoothScrollY">';
|
||||
|
||||
html += '<div class="searchResultsContainer"><div class="itemsContainer"></div></div></div>';
|
||||
|
||||
|
|
|
@ -1331,7 +1331,7 @@ var Dashboard = {
|
|||
PlayableMediaTypes: ['Audio', 'Video'],
|
||||
|
||||
SupportedCommands: Dashboard.getSupportedRemoteCommands(),
|
||||
SupportsPersistentIdentifier: AppInfo.isNativeApp,
|
||||
SupportsPersistentIdentifier: AppInfo.isNativeApp === true,
|
||||
SupportsMediaControl: true,
|
||||
SupportedLiveMediaTypes: ['Audio', 'Video']
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue