Merge remote-tracking branch 'upstream/master' into fix-subtitle-line-spacing

Conflicts:
	src/components/subtitlesettings/subtitleappearancehelper.js
	src/plugins/htmlVideoPlayer/plugin.js
This commit is contained in:
Dmitry Lyzo 2020-07-30 17:49:07 +03:00
commit 48886918d3
278 changed files with 2125 additions and 5109 deletions

View file

@ -12,10 +12,7 @@ import 'emby-input';
let supportsValueSetOverride = false;
let enableWidthWithTransform;
if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
const descriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
// descriptor returning null in webos
if (descriptor && descriptor.configurable) {
@ -85,7 +82,6 @@ import 'emby-input';
* @param {boolean} [isValueSet] update by 'valueset' event or by timer
*/
function updateValues(isValueSet) {
// Do not update values by 'valueset' in case of soft-implemented dragging
if (!!isValueSet && (!!this.keyboardDragging || !!this.touched)) {
return;
@ -98,24 +94,18 @@ import 'emby-input';
// Keep only one per slider frame request
cancelAnimationFrame(range.updateValuesFrame);
range.updateValuesFrame = requestAnimationFrame(function () {
let backgroundLower = range.backgroundLower;
if (backgroundLower) {
let fraction = (value - range.min) / (range.max - range.min);
if (enableWidthWithTransform) {
backgroundLower.style.transform = 'scaleX(' + (fraction) + ')';
} else {
fraction *= 100;
backgroundLower.style.width = fraction + '%';
}
fraction *= 100;
backgroundLower.style.width = fraction + '%';
}
});
}
function updateBubble(range, value, bubble, bubbleText) {
requestAnimationFrame(function () {
const bubbleTrackRect = range.sliderBubbleTrack.getBoundingClientRect();
const bubbleRect = bubble.getBoundingClientRect();
@ -141,15 +131,10 @@ import 'emby-input';
}
EmbySliderPrototype.attachedCallback = function () {
if (this.getAttribute('data-embyslider') === 'true') {
return;
}
if (enableWidthWithTransform == null) {
//enableWidthWithTransform = browser.supportsCssAnimation();
}
this.setAttribute('data-embyslider', 'true');
this.classList.add('mdl-slider');
@ -187,11 +172,7 @@ import 'emby-input';
// the more of these, the more ranges we can display
htmlToInsert += '<div class="mdl-slider-background-upper"></div>';
if (enableWidthWithTransform) {
htmlToInsert += '<div class="mdl-slider-background-lower mdl-slider-background-lower-withtransform"></div>';
} else {
htmlToInsert += '<div class="mdl-slider-background-lower"></div>';
}
htmlToInsert += '<div class="mdl-slider-background-lower"></div>';
htmlToInsert += '</div>';
htmlToInsert += '</div>';
@ -235,14 +216,12 @@ import 'emby-input';
sliderBubble.classList.add('hide');
hasHideClass = true;
}, {
passive: true
});
/* eslint-disable-next-line compat/compat */
dom.addEventListener(this, (window.PointerEvent ? 'pointermove' : 'mousemove'), function (e) {
if (!this.dragging) {
const bubbleValue = mapClientToFraction(this, e.clientX) * 100;
@ -253,7 +232,6 @@ import 'emby-input';
hasHideClass = false;
}
}
}, {
passive: true
});
@ -432,7 +410,6 @@ import 'emby-input';
};
function setRange(elem, startPercent, endPercent) {
const style = elem.style;
style.left = Math.max(startPercent, 0) + '%';
@ -441,13 +418,11 @@ import 'emby-input';
}
function mapRangesFromRuntimeToPercent(ranges, runtime) {
if (!runtime) {
return [];
}
return ranges.map(function (r) {
return {
start: (r.start / runtime) * 100,
end: (r.end / runtime) * 100
@ -456,7 +431,6 @@ import 'emby-input';
}
EmbySliderPrototype.setBufferedRanges = function (ranges, runtime, position) {
const elem = this.backgroundUpper;
if (!elem) {
return;
@ -469,7 +443,6 @@ import 'emby-input';
}
for (const range in ranges) {
if (position != null) {
if (position >= range.end) {
continue;
@ -484,7 +457,6 @@ import 'emby-input';
};
EmbySliderPrototype.setIsClear = function (isClear) {
const backgroundLower = this.backgroundLower;
if (backgroundLower) {
if (isClear) {
@ -504,7 +476,6 @@ import 'emby-input';
}
EmbySliderPrototype.detachedCallback = function () {
const interval = this.interval;
if (interval) {
clearInterval(interval);