mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
fix action sheet
This commit is contained in:
parent
3153625e29
commit
dfe71b5f55
@ -2,7 +2,7 @@
|
||||
|
||||
function show(options) {
|
||||
|
||||
require(['paper-menu', 'paper-dialog', 'paper-dialog-scrollable', 'scale-up-animation', 'fade-out-animation'], function () {
|
||||
require(['paper-menu', 'paper-dialog', 'scale-up-animation', 'fade-out-animation'], function () {
|
||||
showInternal(options);
|
||||
});
|
||||
}
|
||||
@ -134,7 +134,10 @@
|
||||
}
|
||||
};
|
||||
|
||||
dlg.open();
|
||||
var delay = browserInfo.chrome ? 0 : 100;
|
||||
setTimeout(function () {
|
||||
dlg.open();
|
||||
}, delay);
|
||||
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
dlg.addEventListener('iron-overlay-closed', function () {
|
||||
@ -144,23 +147,39 @@
|
||||
// Seeing an issue in some non-chrome browsers where this is requiring a double click
|
||||
var eventName = browserInfo.chrome || browserInfo.safari ? 'click' : 'mousedown';
|
||||
|
||||
dlg.querySelector('.actionSheetMenuItem').addEventListener(eventName, function (e) {
|
||||
dlg.addEventListener(eventName, function (e) {
|
||||
|
||||
var selectedId = e.target.getAttribute('data-id');
|
||||
var target = parentWithClass(e.target, 'actionSheetMenuItem');
|
||||
if (target) {
|
||||
var selectedId = target.getAttribute('data-id');
|
||||
|
||||
// Add a delay here to allow the click animation to finish, for nice effect
|
||||
setTimeout(function () {
|
||||
// Add a delay here to allow the click animation to finish, for nice effect
|
||||
setTimeout(function () {
|
||||
|
||||
dlg.close();
|
||||
dlg.close();
|
||||
|
||||
if (options.callback) {
|
||||
options.callback(selectedId);
|
||||
}
|
||||
if (options.callback) {
|
||||
options.callback(selectedId);
|
||||
}
|
||||
|
||||
}, 100);
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function parentWithClass(elem, className) {
|
||||
|
||||
while (!elem.classList || !elem.classList.contains(className)) {
|
||||
elem = elem.parentNode;
|
||||
|
||||
if (!elem) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
window.ActionSheetElement = {
|
||||
show: show
|
||||
};
|
||||
|
@ -50,18 +50,16 @@
|
||||
var enableVlcVideo = true;
|
||||
var enableVlcAudio = true;
|
||||
|
||||
profile.CodecProfiles = [];
|
||||
|
||||
if (enableVlcVideo) {
|
||||
|
||||
var directPlayVideoContainers = AppInfo.directPlayVideoContainers;
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: "m4v,3gp,ts,mpegts,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,m2v,avi,mpg,mpeg,mp4,webm",
|
||||
Type: 'Video'
|
||||
});
|
||||
|
||||
if (directPlayVideoContainers && directPlayVideoContainers.length) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: directPlayVideoContainers.join(','),
|
||||
Type: 'Video'
|
||||
});
|
||||
}
|
||||
profile.CodecProfiles = profile.CodecProfiles.filter(function (i) {
|
||||
return i.Type == 'Audio';
|
||||
});
|
||||
|
||||
profile.SubtitleProfiles = [];
|
||||
profile.SubtitleProfiles.push({
|
||||
@ -157,14 +155,14 @@
|
||||
|
||||
if (enableVlcAudio) {
|
||||
|
||||
var directPlayAudioContainers = AppInfo.directPlayAudioContainers;
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus",
|
||||
Type: 'Audio'
|
||||
});
|
||||
|
||||
if (directPlayAudioContainers && directPlayAudioContainers.length) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: directPlayAudioContainers.join(','),
|
||||
Type: 'Audio'
|
||||
});
|
||||
}
|
||||
profile.CodecProfiles = profile.CodecProfiles.filter(function (i) {
|
||||
return i.Type != 'Audio';
|
||||
});
|
||||
|
||||
profile.CodecProfiles.push({
|
||||
Type: 'Audio',
|
||||
@ -179,33 +177,10 @@
|
||||
|
||||
function updateDeviceProfileForIOS(profile) {
|
||||
|
||||
var directPlayVideoContainers = AppInfo.directPlayVideoContainers;
|
||||
|
||||
if (directPlayVideoContainers && directPlayVideoContainers.length) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: directPlayVideoContainers.join(','),
|
||||
Type: 'Video'
|
||||
});
|
||||
}
|
||||
|
||||
var directPlayAudioContainers = AppInfo.directPlayAudioContainers;
|
||||
|
||||
if (directPlayAudioContainers && directPlayAudioContainers.length) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: directPlayAudioContainers.join(','),
|
||||
Type: 'Audio'
|
||||
});
|
||||
}
|
||||
|
||||
if (browserInfo.safari && !AppInfo.isNativeApp) {
|
||||
profile.TranscodingProfiles.unshift({
|
||||
Container: 'ts',
|
||||
Type: 'Audio',
|
||||
AudioCodec: 'aac',
|
||||
Context: 'Streaming',
|
||||
Protocol: 'hls'
|
||||
});
|
||||
}
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus,flac",
|
||||
Type: 'Audio'
|
||||
});
|
||||
}
|
||||
|
||||
self.getDeviceProfile = function (maxHeight) {
|
||||
|
@ -1630,9 +1630,6 @@ var AppInfo = {};
|
||||
AppInfo.supportsSyncPathSetting = isCordova && isAndroid;
|
||||
AppInfo.supportsUserDisplayLanguageSetting = Dashboard.isConnectMode() && !isCordova;
|
||||
|
||||
AppInfo.directPlayAudioContainers = [];
|
||||
AppInfo.directPlayVideoContainers = [];
|
||||
|
||||
if (isCordova && isIOS) {
|
||||
AppInfo.moreIcon = 'more-horiz';
|
||||
} else {
|
||||
@ -2139,14 +2136,6 @@ var AppInfo = {};
|
||||
}
|
||||
};
|
||||
|
||||
if (Dashboard.isRunningInCordova() && browserInfo.android) {
|
||||
AppInfo.directPlayVideoContainers = "m4v,3gp,ts,mpegts,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,m2v,avi,mpg,mpeg,mp4,webm".split(',');
|
||||
}
|
||||
else if (Dashboard.isRunningInCordova() && browserInfo.safari) {
|
||||
|
||||
AppInfo.directPlayAudioContainers = "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus,flac".split(',');
|
||||
}
|
||||
|
||||
var promises = [];
|
||||
deps = [];
|
||||
deps.push('scripts/mediaplayer');
|
||||
|
Loading…
Reference in New Issue
Block a user