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

update components

This commit is contained in:
Luke Pulverenti 2016-11-28 14:27:21 -05:00
parent e9974f5344
commit 30584bfef9
10 changed files with 48 additions and 40 deletions

View file

@ -14,12 +14,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.4.354", "version": "1.4.356",
"_release": "1.4.354", "_release": "1.4.356",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.4.354", "tag": "1.4.356",
"commit": "3d8a04970adc76c6197984d6c2e29967cfa6b25e" "commit": "2115cec7c7cfaaa4335d3dce66e0696f41889e6b"
}, },
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1", "_target": "^1.2.1",

View file

@ -40,7 +40,7 @@
backdropImage.style.backgroundImage = "url('" + url + "')"; backdropImage.style.backgroundImage = "url('" + url + "')";
backdropImage.setAttribute('data-url', url); backdropImage.setAttribute('data-url', url);
backdropImage.style.animation = 'backdrop-fadein ' + 800 + 'ms ease-in normal both'; backdropImage.classList.add('backdropImageFadeIn');
parent.appendChild(backdropImage); parent.appendChild(backdropImage);
if (!enableAnimation(backdropImage)) { if (!enableAnimation(backdropImage)) {
@ -75,7 +75,7 @@
function cancelAnimation() { function cancelAnimation() {
var elem = currentAnimatingElement; var elem = currentAnimatingElement;
if (elem) { if (elem) {
elem.style.animation = ''; elem.classList.remove('backdropImageFadeIn');
currentAnimatingElement = null; currentAnimatingElement = null;
} }
} }

View file

@ -15,6 +15,10 @@
contain: layout style; contain: layout style;
} }
.backdropImageFadeIn {
animation: backdrop-fadein 800ms ease-in normal both;
}
@keyframes backdrop-fadein { @keyframes backdrop-fadein {
from { from {
opacity: 0; opacity: 0;
@ -23,4 +27,4 @@
to { to {
opacity: 1; opacity: 1;
} }
} }

View file

@ -117,22 +117,29 @@
} }
var _supportsCssAnimation; var _supportsCssAnimation;
function supportsCssAnimation() { var _supportsCssAnimationWithPrefix;
function supportsCssAnimation(allowPrefix) {
if (_supportsCssAnimation === true || _supportsCssAnimation === false) { if (allowPrefix) {
return _supportsCssAnimation; if (_supportsCssAnimationWithPrefix === true || _supportsCssAnimationWithPrefix === false) {
return _supportsCssAnimationWithPrefix;
}
} else {
if (_supportsCssAnimation === true || _supportsCssAnimation === false) {
return _supportsCssAnimation;
}
} }
var animation = false, var animation = false,
animationstring = 'animation', animationstring = 'animation',
keyframeprefix = '', keyframeprefix = '',
domPrefixes = 'Webkit Moz O ms Khtml'.split(' '), domPrefixes = ['Webkit', 'O', 'Moz'],
pfx = '', pfx = '',
elm = document.createElement('div'); elm = document.createElement('div');
if (elm.style.animationName !== undefined) { animation = true; } if (elm.style.animationName !== undefined) { animation = true; }
if (animation === false) { if (animation === false && allowPrefix) {
for (var i = 0; i < domPrefixes.length; i++) { for (var i = 0; i < domPrefixes.length; i++) {
if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) { if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {
pfx = domPrefixes[i]; pfx = domPrefixes[i];
@ -144,8 +151,13 @@
} }
} }
_supportsCssAnimation = animation; if (allowPrefix) {
return _supportsCssAnimation; _supportsCssAnimationWithPrefix = animation;
return _supportsCssAnimationWithPrefix;
} else {
_supportsCssAnimation = animation;
return _supportsCssAnimation;
}
} }
var uaMatch = function (ua) { var uaMatch = function (ua) {
@ -228,6 +240,7 @@
if (userAgent.toLowerCase().indexOf("playstation 4") !== -1) { if (userAgent.toLowerCase().indexOf("playstation 4") !== -1) {
browser.ps4 = true; browser.ps4 = true;
browser.tv = true;
} }
if (isMobile(userAgent)) { if (isMobile(userAgent)) {
@ -258,5 +271,8 @@
browser.keyboard = hasKeyboard(browser); browser.keyboard = hasKeyboard(browser);
browser.supportsCssAnimation = supportsCssAnimation; browser.supportsCssAnimation = supportsCssAnimation;
browser.osx = userAgent.toLowerCase().indexOf('os x') !== -1;
browser.iOS = browser.ipad || browser.iphone || browser.ipod;
return browser; return browser;
}); });

View file

@ -267,7 +267,7 @@ define(['browser'], function (browser) {
// Only put mp3 first if mkv support is there // Only put mp3 first if mkv support is there
// Otherwise with HLS and mp3 audio we're seeing some browsers // Otherwise with HLS and mp3 audio we're seeing some browsers
// safari is lying // safari is lying
if ((videoTestElement.canPlayType('audio/mp4; codecs="ac-3"').replace(/no/, '') && !browser.safari) || browser.edgeUwp || browser.tizen || browser.web0s) { if ((videoTestElement.canPlayType('audio/mp4; codecs="ac-3"').replace(/no/, '') && !browser.osx && !browser.iOS) || browser.edgeUwp || browser.tizen || browser.web0s) {
videoAudioCodecs.push('ac3'); videoAudioCodecs.push('ac3');
// This works in edge desktop, but not mobile // This works in edge desktop, but not mobile
@ -440,7 +440,7 @@ define(['browser'], function (browser) {
Context: 'Streaming', Context: 'Streaming',
Protocol: 'hls', Protocol: 'hls',
MaxAudioChannels: physicalAudioChannels.toString(), MaxAudioChannels: physicalAudioChannels.toString(),
EnableSplittingOnNonKeyFrames: browser.safari ? true : false EnableSplittingOnNonKeyFrames: (browser.osx || browser.iOS) ? true : false
}); });
} }

View file

@ -5,24 +5,12 @@
function enableAnimation() { function enableAnimation() {
if (browser.animate) { // too slow
return true; if (browser.tv) {
}
if (browser.edge) {
return true;
}
if (!browser.supportsCssAnimation()) {
return false; return false;
} }
// An indication of an older browser return browser.supportsCssAnimation();
if (browser.noFlex) {
return false;
}
return true;
} }
function removeCenterFocus(dlg) { function removeCenterFocus(dlg) {
@ -269,6 +257,7 @@
if (enableAnimation()) { if (enableAnimation()) {
var animated = true; var animated = true;
switch (dlg.animationConfig.exit.name) { switch (dlg.animationConfig.exit.name) {
case 'fadeout': case 'fadeout':
@ -440,6 +429,7 @@
} }
if (enableAnimation()) { if (enableAnimation()) {
switch (dlg.animationConfig.entry.name) { switch (dlg.animationConfig.entry.name) {
case 'fadein': case 'fadein':

View file

@ -102,7 +102,7 @@ define([], function () {
} }
var t, var t,
el = document.createElement("fakeelement"); el = document.createElement("div");
var animations = { var animations = {
"animation": "animationend", "animation": "animationend",
"OAnimation": "oAnimationEnd", "OAnimation": "oAnimationEnd",
@ -127,7 +127,7 @@ define([], function () {
} }
var t, var t,
el = document.createElement("fakeelement"); el = document.createElement("div");
var transitions = { var transitions = {
"transition": "transitionend", "transition": "transitionend",
"OTransition": "oTransitionEnd", "OTransition": "oTransitionEnd",

View file

@ -73,7 +73,7 @@
this.classList.add('emby-button'); this.classList.add('emby-button');
if (browser.safari || browser.firefox) { if (browser.firefox) {
this.classList.add('emby-button-noflex'); this.classList.add('emby-button-noflex');
} }

View file

@ -9,14 +9,11 @@ define(['browser', 'dom', 'css!./viewcontainer-lite'], function (browser, dom) {
function enableAnimation() { function enableAnimation() {
// too slow
if (browser.tv) { if (browser.tv) {
return false; return false;
} }
if (browser.operaTv) {
return false;
}
return browser.supportsCssAnimation(); return browser.supportsCssAnimation();
} }
@ -119,7 +116,6 @@ define(['browser', 'dom', 'css!./viewcontainer-lite'], function (browser, dom) {
if (oldAnimatedPage) { if (oldAnimatedPage) {
if (isBack) { if (isBack) {
oldAnimatedPage.style.animation = 'view-slideright-r ' + duration + 'ms ease-out normal both';
setAnimation(oldAnimatedPage, 'view-slideright-r ' + duration + 'ms ease-out normal both'); setAnimation(oldAnimatedPage, 'view-slideright-r ' + duration + 'ms ease-out normal both');
} else { } else {
setAnimation(oldAnimatedPage, 'view-slideleft-r ' + duration + 'ms ease-out normal both'); setAnimation(oldAnimatedPage, 'view-slideleft-r ' + duration + 'ms ease-out normal both');

View file

@ -419,7 +419,9 @@
setTracks(elem, tracks); setTracks(elem, tracks);
requireHlsPlayer(function () { requireHlsPlayer(function () {
var hls = new Hls(); var hls = new Hls({
manifestLoadingTimeOut: 20000
});
hls.loadSource(val); hls.loadSource(val);
hls.attachMedia(elem); hls.attachMedia(elem);
hls.on(Hls.Events.MANIFEST_PARSED, function () { hls.on(Hls.Events.MANIFEST_PARSED, function () {