mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
render ssa/ass subs in browser
This commit is contained in:
parent
3c2d0cd3a1
commit
cc2c794ad0
26 changed files with 10493 additions and 138 deletions
|
@ -16,12 +16,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.2.1",
|
||||
"_release": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"_release": "1.2.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.2.1",
|
||||
"commit": "44c0d907dc06ccc317c008d78b06ae365358560a"
|
||||
"tag": "1.2.2",
|
||||
"commit": "090c43863857847e33055ba1d7ab278b17f76203"
|
||||
},
|
||||
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.0",
|
||||
|
|
|
@ -289,7 +289,7 @@ define(['browser'], function (browser) {
|
|||
});
|
||||
|
||||
// Can't use mkv on mobile because we have to use the native player controls and they won't be able to seek it
|
||||
if (canPlayMkv && options.supportsAutoPlay) {
|
||||
if (canPlayMkv && options.supportsCustomSeeking) {
|
||||
profile.TranscodingProfiles.push({
|
||||
Container: 'mkv',
|
||||
Type: 'Video',
|
||||
|
@ -320,7 +320,7 @@ define(['browser'], function (browser) {
|
|||
Context: 'Streaming',
|
||||
Protocol: 'hls',
|
||||
// Can't use this when autoplay is not supported
|
||||
ForceLiveStream: options.supportsAutoPlay ? true : false
|
||||
ForceLiveStream: options.supportsCustomSeeking ? true : false
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-demo-helpers",
|
||||
"version": "1.2.2",
|
||||
"version": "1.2.3",
|
||||
"description": "Utility classes to make building demo pages easier",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -30,7 +30,7 @@
|
|||
"marked-element": "polymerelements/marked-element#^1.0.0",
|
||||
"prism-element": "PolymerElements/prism-element#^1.0.0",
|
||||
"iron-location": "PolymerElements/iron-location#^0.8.0",
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.3.1"
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
|
@ -41,11 +41,11 @@
|
|||
"paper-styles": "PolymerElements/paper-styles#^1.1.0",
|
||||
"paper-checkbox": "PolymerElements/paper-checkbox#^1.0.0"
|
||||
},
|
||||
"_release": "1.2.2",
|
||||
"_release": "1.2.3",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.2.2",
|
||||
"commit": "2fc1d6901a555f76e1c12b17dedaa555d8d4d9a5"
|
||||
"tag": "v1.2.3",
|
||||
"commit": "8d2c2e6f49b3c414f2998e14330727e5195f2f3b"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-demo-helpers.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-demo-helpers",
|
||||
"version": "1.2.2",
|
||||
"version": "1.2.3",
|
||||
"description": "Utility classes to make building demo pages easier",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -30,7 +30,7 @@
|
|||
"marked-element": "polymerelements/marked-element#^1.0.0",
|
||||
"prism-element": "PolymerElements/prism-element#^1.0.0",
|
||||
"iron-location": "PolymerElements/iron-location#^0.8.0",
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.3.1"
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
|
|
|
@ -14,7 +14,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>paper-tooltip</title>
|
||||
<title>iron-demo-helpers</title>
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-location/iron-location.html">
|
||||
<link rel="import" href="../iron-flex-layout/iron-flex-layout-classes.html">
|
||||
|
|
|
@ -32,14 +32,14 @@
|
|||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-icon",
|
||||
"homepage": "https://github.com/polymerelements/iron-icon",
|
||||
"_release": "1.0.8",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.8",
|
||||
"commit": "f36b38928849ef3853db727faa8c9ef104d611eb"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-icon.git",
|
||||
"_source": "git://github.com/polymerelements/iron-icon.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-icon"
|
||||
"_originalSource": "polymerelements/iron-icon"
|
||||
}
|
|
@ -41,7 +41,7 @@
|
|||
"tag": "v1.1.3",
|
||||
"commit": "c13869b57a9464dfc3a1f26e89858f8be37e7441"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-icons.git",
|
||||
"_source": "git://github.com/polymerelements/iron-icons.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-icons"
|
||||
"_originalSource": "polymerelements/iron-icons"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-overlay-behavior",
|
||||
"version": "1.6.1",
|
||||
"version": "1.6.2",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for making an element an overlay",
|
||||
"private": true,
|
||||
|
@ -35,11 +35,11 @@
|
|||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/polymerelements/iron-overlay-behavior",
|
||||
"_release": "1.6.1",
|
||||
"_release": "1.6.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.6.1",
|
||||
"commit": "34f2ed86b2e46f2827dd09594ae99acff0f28029"
|
||||
"tag": "v1.6.2",
|
||||
"commit": "be4e703b6894af6d4013a8a9f514a384ee91e2db"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-overlay-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-overlay-behavior",
|
||||
"version": "1.6.1",
|
||||
"version": "1.6.2",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for making an element an overlay",
|
||||
"private": true,
|
||||
|
|
|
@ -15,6 +15,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<link rel="import" href="iron-overlay-manager.html">
|
||||
|
||||
<script>
|
||||
// IIFE to help scripts concatenation.
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
Use `Polymer.IronOverlayBehavior` to implement an element that can be hidden or shown, and displays
|
||||
|
@ -233,6 +236,10 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
this.__shouldRemoveTabIndex = false;
|
||||
// Used for wrapping the focus on TAB / Shift+TAB.
|
||||
this.__firstFocusableNode = this.__lastFocusableNode = null;
|
||||
// Used for requestAnimationFrame when opened changes.
|
||||
this.__openChangedAsync = null;
|
||||
// Used for requestAnimationFrame when iron-resize is fired.
|
||||
this.__onIronResizeAsync = null;
|
||||
this._ensureSetup();
|
||||
},
|
||||
|
||||
|
@ -317,26 +324,22 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
|
||||
this.__isAnimating = true;
|
||||
|
||||
// requestAnimationFrame for non-blocking rendering
|
||||
if (this.__openChangedAsync) {
|
||||
cancelAnimationFrame(this.__openChangedAsync);
|
||||
}
|
||||
if (this.opened) {
|
||||
this._prepareRenderOpened();
|
||||
}
|
||||
if (this._openChangedAsync) {
|
||||
this.cancelAsync(this._openChangedAsync);
|
||||
}
|
||||
// Async here to allow overlay layer to become visible.
|
||||
this._openChangedAsync = this.async(function() {
|
||||
// overlay becomes visible here
|
||||
this.style.display = '';
|
||||
// Force layout to ensure transition will go. Set offsetWidth to itself
|
||||
// so that compilers won't remove it.
|
||||
this.offsetWidth = this.offsetWidth;
|
||||
if (this.opened) {
|
||||
this._renderOpened();
|
||||
} else {
|
||||
this._renderClosed();
|
||||
if (this.withBackdrop) {
|
||||
this.backdropElement.prepare();
|
||||
}
|
||||
this._openChangedAsync = null;
|
||||
});
|
||||
this.__openChangedAsync = requestAnimationFrame(function() {
|
||||
this.__openChangedAsync = null;
|
||||
this._prepareRenderOpened();
|
||||
this._renderOpened();
|
||||
}.bind(this));
|
||||
} else {
|
||||
this._renderClosed();
|
||||
}
|
||||
},
|
||||
|
||||
_canceledChanged: function() {
|
||||
|
@ -379,10 +382,6 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
this.refit();
|
||||
this._finishPositioning();
|
||||
|
||||
if (this.withBackdrop) {
|
||||
this.backdropElement.prepare();
|
||||
}
|
||||
|
||||
// Safari will apply the focus to the autofocus element when displayed for the first time,
|
||||
// so we blur it. Later, _applyFocus will set the focus if necessary.
|
||||
if (this.noAutoFocus && document.activeElement === this._focusNode) {
|
||||
|
@ -432,6 +431,8 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
_finishRenderClosed: function() {
|
||||
// Hide the overlay and remove the backdrop.
|
||||
this.style.display = 'none';
|
||||
// Reset z-index only at the end of the animation.
|
||||
this.style.zIndex = '';
|
||||
|
||||
this._applyFocus();
|
||||
|
||||
|
@ -447,12 +448,18 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
},
|
||||
|
||||
_finishPositioning: function() {
|
||||
// First, make it invisible & reactivate animations.
|
||||
this.style.display = 'none';
|
||||
this.style.transform = this.style.webkitTransform = '';
|
||||
// Force layout layout to avoid application of transform.
|
||||
// Set offsetWidth to itself so that compilers won't remove it.
|
||||
this.offsetWidth = this.offsetWidth;
|
||||
// Force reflow before re-enabling animations so that they don't start.
|
||||
// Set scrollTop to itself so that Closure Compiler doesn't remove this.
|
||||
this.scrollTop = this.scrollTop;
|
||||
this.style.transition = this.style.webkitTransition = '';
|
||||
this.style.transform = this.style.webkitTransform = '';
|
||||
// Now that animations are enabled, make it visible again
|
||||
this.style.display = '';
|
||||
// Force reflow, so that following animations are properly started.
|
||||
// Set scrollTop to itself so that Closure Compiler doesn't remove this.
|
||||
this.scrollTop = this.scrollTop;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -535,12 +542,15 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
* @protected
|
||||
*/
|
||||
_onIronResize: function() {
|
||||
if (this.__isAnimating) {
|
||||
return;
|
||||
if (this.__onIronResizeAsync) {
|
||||
cancelAnimationFrame(this.__onIronResizeAsync);
|
||||
this.__onIronResizeAsync = null;
|
||||
}
|
||||
|
||||
if (this.opened) {
|
||||
this.refit();
|
||||
if (this.opened && !this.__isAnimating) {
|
||||
this.__onIronResizeAsync = requestAnimationFrame(function() {
|
||||
this.__onIronResizeAsync = null;
|
||||
this.refit();
|
||||
}.bind(this));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -583,4 +593,5 @@ context. You should place this element as a child of `<body>` whenever possible.
|
|||
* @param {{canceled: (boolean|undefined)}} closingReason Contains `canceled` (whether the overlay was canceled).
|
||||
*/
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
|
|
@ -38,11 +38,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
*/
|
||||
this._backdropElement = null;
|
||||
|
||||
// Enable document-wide tap recognizer.
|
||||
Polymer.Gestures.add(document, 'tap', null);
|
||||
// We should be using only 'tap', but this would be a breaking change.
|
||||
var tapEvent = ('ontouchstart' in window) ? 'tap' : 'click';
|
||||
document.addEventListener(tapEvent, this._onCaptureClick.bind(this), true);
|
||||
// Listen to mousedown or touchstart to be sure to be the first to capture
|
||||
// clicks outside the overlay.
|
||||
var clickEvent = ('ontouchstart' in window) ? 'touchstart' : 'mousedown';
|
||||
document.addEventListener(clickEvent, this._onCaptureClick.bind(this), true);
|
||||
document.addEventListener('focus', this._onCaptureFocus.bind(this), true);
|
||||
document.addEventListener('keydown', this._onCaptureKeyDown.bind(this), true);
|
||||
};
|
||||
|
@ -167,7 +166,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
return;
|
||||
}
|
||||
this._overlays.splice(i, 1);
|
||||
this._setZ(overlay, '');
|
||||
|
||||
var node = overlay.restoreFocusOnClose ? overlay.restoreFocusNode : null;
|
||||
overlay.restoreFocusNode = null;
|
||||
|
@ -267,7 +265,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
_getZ: function(overlay) {
|
||||
var z = this._minimumZ;
|
||||
if (overlay) {
|
||||
var z1 = Number(window.getComputedStyle(overlay).zIndex);
|
||||
var z1 = Number(overlay.style.zIndex || window.getComputedStyle(overlay).zIndex);
|
||||
// Check if is a number
|
||||
// Number.isNaN not supported in IE 10+
|
||||
if (z1 === z1) {
|
||||
|
|
|
@ -127,10 +127,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<input id="focusInput" placeholder="focus input">
|
||||
|
||||
<script>
|
||||
|
||||
HTMLImports.whenReady(function() {
|
||||
// Enable document-wide tap recognizer.
|
||||
Polymer.Gestures.add(document, 'tap', null);
|
||||
});
|
||||
|
||||
function runAfterOpen(overlay, callback) {
|
||||
overlay.addEventListener('iron-overlay-opened', function() {
|
||||
Polymer.Base.async(callback, 1);
|
||||
});
|
||||
overlay.addEventListener('iron-overlay-opened', callback);
|
||||
overlay.open();
|
||||
}
|
||||
|
||||
|
@ -168,10 +172,34 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
overlay.opened = true;
|
||||
});
|
||||
|
||||
test('closed overlay does not refit on iron-resize', function() {
|
||||
test('open() refits overlay only once', function(done) {
|
||||
var spy = sinon.spy(overlay, 'refit');
|
||||
runAfterOpen(overlay, function() {
|
||||
assert.equal(spy.callCount, 1, 'overlay did refit only once');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('open overlay refits on iron-resize', function(done) {
|
||||
runAfterOpen(overlay, function() {
|
||||
var spy = sinon.spy(overlay, 'refit');
|
||||
overlay.fire('iron-resize');
|
||||
Polymer.dom.flush();
|
||||
requestAnimationFrame(function() {
|
||||
assert.isTrue(spy.called, 'overlay did refit');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('closed overlay does not refit on iron-resize', function(done) {
|
||||
var spy = sinon.spy(overlay, 'refit');
|
||||
overlay.fire('iron-resize');
|
||||
assert.isFalse(spy.called, 'overlay should not refit');
|
||||
Polymer.dom.flush();
|
||||
requestAnimationFrame(function() {
|
||||
assert.isFalse(spy.called, 'overlay should not refit');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('open() triggers iron-resize', function(done) {
|
||||
|
@ -242,6 +270,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
});
|
||||
|
||||
test('open overlay on mousedown does not close it', function(done) {
|
||||
var btn = document.createElement('button');
|
||||
btn.addEventListener('mousedown', overlay.open.bind(overlay));
|
||||
document.body.appendChild(btn);
|
||||
// It triggers mousedown, mouseup, and click.
|
||||
MockInteractions.tap(btn);
|
||||
document.body.removeChild(btn);
|
||||
|
||||
assert.isTrue(overlay.opened, 'overlay opened');
|
||||
overlay.async(function() {
|
||||
assert.isTrue(overlay.opened, 'overlay is still open');
|
||||
done();
|
||||
}, 10);
|
||||
});
|
||||
|
||||
test('clicking outside fires iron-overlay-canceled', function(done) {
|
||||
runAfterOpen(overlay, function() {
|
||||
overlay.addEventListener('iron-overlay-canceled', function(event) {
|
||||
|
@ -396,18 +439,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('open overlay refits on iron-resize', function(done) {
|
||||
var spy = sinon.spy(overlay, 'refit');
|
||||
// At this point, overlay is still opening.
|
||||
overlay.fire('iron-resize');
|
||||
assert.isFalse(spy.called, 'overlay did not refit while animating');
|
||||
overlay.addEventListener('iron-overlay-opened', function() {
|
||||
overlay.fire('iron-resize');
|
||||
assert.isTrue(spy.called, 'overlay did refit');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
suite('focus handling', function() {
|
||||
|
@ -504,17 +535,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
overlay.withBackdrop = true;
|
||||
var focusableNodes = overlay._focusableNodes;
|
||||
runAfterOpen(overlay, function() {
|
||||
// Go to last element.
|
||||
MockInteractions.focus(focusableNodes[focusableNodes.length-1]);
|
||||
// Simulate TAB & focus out of overlay.
|
||||
MockInteractions.pressAndReleaseKeyOn(document, 9);
|
||||
MockInteractions.focus(document.body);
|
||||
assert.equal(focusableNodes[0], document.activeElement, 'focus wrapped to first focusable');
|
||||
// Simulate Shift+TAB & focus out of overlay.
|
||||
MockInteractions.pressAndReleaseKeyOn(document, 9, ['shift']);
|
||||
MockInteractions.focus(document.body);
|
||||
assert.equal(focusableNodes[focusableNodes.length-1], document.activeElement, 'focus wrapped to last focusable');
|
||||
done();
|
||||
Polymer.Base.async(function() {
|
||||
// Go to last element.
|
||||
MockInteractions.focus(focusableNodes[focusableNodes.length-1]);
|
||||
// Simulate TAB & focus out of overlay.
|
||||
MockInteractions.pressAndReleaseKeyOn(document, 9);
|
||||
MockInteractions.focus(document.body);
|
||||
|
||||
assert.equal(focusableNodes[0], document.activeElement, 'focus wrapped to first focusable');
|
||||
// Simulate Shift+TAB & focus out of overlay.
|
||||
MockInteractions.pressAndReleaseKeyOn(document, 9, ['shift']);
|
||||
MockInteractions.focus(document.body);
|
||||
assert.equal(focusableNodes[focusableNodes.length-1], document.activeElement, 'focus wrapped to last focusable');
|
||||
done();
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -522,17 +556,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
overlayWithTabIndex.withBackdrop = true;
|
||||
var focusableNodes = overlayWithTabIndex._focusableNodes;
|
||||
runAfterOpen(overlayWithTabIndex, function() {
|
||||
// Go to last element.
|
||||
MockInteractions.focus(focusableNodes[focusableNodes.length-1]);
|
||||
// Simulate TAB & focus out of overlay.
|
||||
MockInteractions.pressAndReleaseKeyOn(document, 9);
|
||||
MockInteractions.focus(document.body);
|
||||
assert.equal(focusableNodes[0], document.activeElement, 'focus wrapped to first focusable');
|
||||
// Simulate Shift+TAB & focus out of overlay.
|
||||
MockInteractions.pressAndReleaseKeyOn(document, 9, ['shift']);
|
||||
MockInteractions.focus(document.body);
|
||||
assert.equal(focusableNodes[focusableNodes.length-1], document.activeElement, 'focus wrapped to last focusable');
|
||||
done();
|
||||
Polymer.Base.async(function() {
|
||||
// Go to last element.
|
||||
MockInteractions.focus(focusableNodes[focusableNodes.length-1]);
|
||||
// Simulate TAB & focus out of overlay.
|
||||
MockInteractions.pressAndReleaseKeyOn(document, 9);
|
||||
MockInteractions.focus(document.body);
|
||||
assert.equal(focusableNodes[0], document.activeElement, 'focus wrapped to first focusable');
|
||||
// Simulate Shift+TAB & focus out of overlay.
|
||||
MockInteractions.pressAndReleaseKeyOn(document, 9, ['shift']);
|
||||
MockInteractions.focus(document.body);
|
||||
assert.equal(focusableNodes[focusableNodes.length-1], document.activeElement, 'focus wrapped to last focusable');
|
||||
done();
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -890,7 +926,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
Polymer.Base.async(function() {
|
||||
assert.lengthOf(document.querySelectorAll('iron-overlay-backdrop'), 0, 'backdrop element removed from the DOM');
|
||||
done();
|
||||
}, 1);
|
||||
}, 100);
|
||||
});
|
||||
|
||||
test('newest overlay appear on top', function(done) {
|
||||
|
@ -950,7 +986,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
}, 1);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
suite('always-on-top', function() {
|
||||
|
@ -1003,6 +1039,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
});
|
||||
|
||||
suite('animations', function() {
|
||||
|
||||
test('overlay animations correctly triggered', function(done) {
|
||||
var overlay = fixture('basic');
|
||||
overlay.animated = true;
|
||||
overlay.open();
|
||||
overlay.addEventListener('simple-overlay-open-animation-start', function() {
|
||||
// Since animated overlay will transition center + 300px to center,
|
||||
// we should not find the element at the center when the open animation starts.
|
||||
var centerElement = document.elementFromPoint(window.innerWidth/2, window.innerHeight/2);
|
||||
assert.notEqual(centerElement, overlay, 'overlay should not be centered already');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('a11y', function() {
|
||||
|
||||
test('overlay has aria-hidden=true when opened', function() {
|
||||
|
|
|
@ -15,13 +15,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<dom-module id="test-overlay">
|
||||
|
||||
<style>
|
||||
|
||||
:host {
|
||||
background: white;
|
||||
color: black;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
:host([animated]) {
|
||||
-webkit-transition: -webkit-transform 0.3s;
|
||||
transition: transform 0.3s;
|
||||
-webkit-transform: translateY(300px);
|
||||
transform: translateY(300px);
|
||||
}
|
||||
|
||||
:host(.opened[animated]) {
|
||||
-webkit-transform: translateY(0px);
|
||||
transform: translateY(0px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
@ -31,19 +41,62 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</dom-module>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
(function() {
|
||||
Polymer({
|
||||
|
||||
Polymer({
|
||||
is: 'test-overlay',
|
||||
|
||||
is: 'test-overlay',
|
||||
properties: {
|
||||
animated: {
|
||||
type: Boolean,
|
||||
reflectToAttribute: true
|
||||
}
|
||||
},
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronOverlayBehavior
|
||||
]
|
||||
behaviors: [
|
||||
Polymer.IronOverlayBehavior
|
||||
],
|
||||
|
||||
});
|
||||
listeners: {
|
||||
'transitionend': '__onTransitionEnd'
|
||||
},
|
||||
|
||||
})();
|
||||
_renderOpened: function() {
|
||||
if (this.animated) {
|
||||
if (this.withBackdrop) {
|
||||
this.backdropElement.open();
|
||||
}
|
||||
this.classList.add('opened');
|
||||
this.fire('simple-overlay-open-animation-start');
|
||||
} else {
|
||||
Polymer.IronOverlayBehaviorImpl._renderOpened.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
|
||||
_renderClosed: function() {
|
||||
if (this.animated) {
|
||||
if (this.withBackdrop) {
|
||||
this.backdropElement.close();
|
||||
}
|
||||
this.classList.remove('opened');
|
||||
this.fire('simple-overlay-close-animation-start');
|
||||
} else {
|
||||
Polymer.IronOverlayBehaviorImpl._renderClosed.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
|
||||
__onTransitionEnd: function(e) {
|
||||
if (e && e.target === this) {
|
||||
if (this.opened) {
|
||||
this._finishRenderOpened();
|
||||
} else {
|
||||
this._finishRenderClosed();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
|
15
dashboard-ui/bower_components/libjass/.bower.json
vendored
Normal file
15
dashboard-ui/bower_components/libjass/.bower.json
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "libjass",
|
||||
"_cacheHeaders": {
|
||||
"ETag": "\"fa735770625f92af7e5167367b2bce58\"",
|
||||
"Last-Modified": "Sun, 24 Jan 2016 10:37:21 GMT",
|
||||
"Content-Length": "260662",
|
||||
"Content-Type": "application/octet-stream",
|
||||
"Content-Disposition": "attachment; filename=libjass.zip"
|
||||
},
|
||||
"_release": "e-tag:fa7357706",
|
||||
"_source": "https://github.com/Arnavion/libjass/releases/download/v0.11.0/libjass.zip",
|
||||
"_target": "*",
|
||||
"_originalSource": "https://github.com/Arnavion/libjass/releases/download/v0.11.0/libjass.zip",
|
||||
"_direct": true
|
||||
}
|
133
dashboard-ui/bower_components/libjass/CHANGELOG.md
vendored
Normal file
133
dashboard-ui/bower_components/libjass/CHANGELOG.md
vendored
Normal file
|
@ -0,0 +1,133 @@
|
|||
### v0.11.0 - 2016/01/24
|
||||
- BREAKING CHANGE - WebRenderer.resize(width, height) used to have a broken implementation of letterboxing to move the subs div right or down. Now it's WebRenderer.resize(width, height, left, top) and expects the caller to calculate letterboxing itself and supply left and top accordingly. DefaultRenderer does it using the video resolution and users of WebRenderer can do the same.
|
||||
- BREAKING CHANGE - DefaultRenderer.resize() now ignores its parameters and always resizes to its video element's dimensions. It had already stopped resizing the video element when it was renamed from resizeVideo in v0.6.0, so it doesn't make sense to let it take a completely different width and height.
|
||||
- BREAKING CHANGE - Removed fullscreen support in DefaultRenderer. It started out as a hack using max z-index and works on even fewer browsers now. It probably didn't work for you anyway so it should be no big loss.
|
||||
- Implemented experimental support for \t
|
||||
- Added RendererSettings.fallbackFonts to set the fallback fonts for all styles. Defaults to 'Arial, Helvetica, sans-serif, "Segoe UI Symbol"'.
|
||||
- Better compatibility with loose ASS scripts - assume unnamed first section is Script Info, fall back to Default style for missing styles, recognize arbitrary-case property names, normalize asterisks in style names, etc.
|
||||
- Various font size improvements - faster calculation, fix for incorrect size when line-height is overridden by site CSS, fix for incorrect scaled sizes for letterboxed subs, fix for incorrect metrics for web fonts, etc. The last one requires that all web fonts be specified in RendererSettings.fontMap to be rendered accurately.
|
||||
- WebRenderer now supports using local() URLs in addition to url() in CSS font-face rules.
|
||||
- Added RendererSettings.useAttachedFonts. If true, TTF fonts attached to the script will be used in addition to fonts specified in RendererSettings.fontMap. This setting is false by default, and should only be enabled on trusted fonts since it uses a very naive base64 and TTF parser to extract the font names from the attachment. It also requires ES6 typed arrays - ArrayBuffer, DataView, Uint8Array, etc. in the environment.
|
||||
- Various pre-render, SVG filter and DOM perf improvements.
|
||||
- Fixed \fscx and \fscy to not scale shadows.
|
||||
- Fixed \fscx and \fscy to have optional values.
|
||||
- Fixed \fs+ and \fs- to have required values.
|
||||
- Fixed \r<target_style> to use the target style's alpha values instead of 1.
|
||||
- Fixed \fad subs to not flash after the fade-out ends with low-resolution clocks.
|
||||
- Fixed outlines to not be darker than they should be.
|
||||
- Fixed styles to not ignore the ScaleX and ScaleY properties in the script.
|
||||
- Fixed lack of sufficient space between normal and italic text.
|
||||
- Fixed SVG filters to interpolate in sRGB space instead of RGB.
|
||||
- Fixed ASS parser to complain if a script doesn't have a Script Info section at all.
|
||||
- The promise returned from ASS.from*() is now properly rejected due to errors from loading the script, instead of just remaining unresolved forever.
|
||||
- Fixed SRT parser to swallow UTF-8 BOM just like the ASS parser.
|
||||
- Fixed all clocks to suppress redundant ticks if the current timestamp hasn't change from the last tick.
|
||||
- Fixed {AutoClock, VideoClock}.{setEnabled, toggle} methods to actually enable / disable the high-resolution timer.
|
||||
|
||||
|
||||
### v0.10.0 - 2015/05/05
|
||||
- Implemented libjass.renderers.AutoClock, a clock that automatically ticks and generates clock events according to the state of an external driver.
|
||||
- Implemented \k
|
||||
- libjass.{Set, Map, Promise} can now be set to null to force the use of the polyfills, even if it defaulted to a runtime-provided implementation.
|
||||
- Added ASS.fromReadableStream(), a function that can be used to parse ASS from a readable stream such as the response of window.fetch().
|
||||
- ASS.fromUrl() now tries to use window.fetch() if available instead of XMLHttpRequest.
|
||||
- Fixed constant pausing and playing on Firefox triggered by how slowly it updates video.currentTime (wasn't noticeable but still undesirable).
|
||||
- Fixed a dialogue's animation state not getting updated while seeking if the start and end times of the seek were within its start and end times.
|
||||
- Fixed wrapping mode 1 (end-of-line wrapping) to actually wrap.
|
||||
- Fixed parser to parse the time components of karaoke tags as centiseconds instead of seconds.
|
||||
- Fixed parser to swallow leading BOM, if any.
|
||||
- Fixed errors reported by webworker API were empty objects without message and stack properties.
|
||||
|
||||
|
||||
### v0.9.0 - 2014/11/27
|
||||
- BREAKING CHANGE - ASS.fromString() now returns a Promise of an ASS object, not an ASS object directly. The synchronous ASS parser used by ASS.fromString() is no more.
|
||||
- BACKWARD-COMPATIBLE CHANGE - WebRenderer constructor parameters order has changed from (ass, clock, settings, libjassSubsWrapper) to (ass, clock, libjassSubsWrapper, settings). The constructor will detect the old order and reorder accordingly.
|
||||
- Added ASS.fromStream and ASS.fromXhr that read a stream and an XMLHttpRequest object's response respectively and return (a Promise of) an ASS object. Both of these parse the script asynchronously.
|
||||
- Added RendererSettings.enableSvg that can be used to toggle the use of SVG filter effects for outlines and blur.
|
||||
- libjass.js now has an AMD wrapper so that it can be used with RequireJS, etc.
|
||||
- Settings parameter is now optional for WebRenderer and DefaultRenderer.
|
||||
- Added support for clock rates apart from 1 to clocks and renderers.
|
||||
- Added a parameter to libjass.createWorker to specify the path to libjass.js that will run in the worker.
|
||||
- Fixed Style and Dialogue constructors not setting defaults for missing properties.
|
||||
- Fixed color and alpha parser to support more formats.
|
||||
- Fixed SRT parser to replace all HTML tags it finds, instead of just the first one.
|
||||
- Fixed font size calculation to use the vertical scale instead of horizontal.
|
||||
- Fixed line-height on newlines.
|
||||
- Fixed missing perspective on X and Y rotations.
|
||||
|
||||
|
||||
### v0.8.0 - 2014/08/16
|
||||
- Added web worker support. libjass.parse can now be offloaded to a web worker.
|
||||
- Implemented \fs+ and \fs-
|
||||
- Added ASS.addEvent() to add dialogue lines to an ASS object.
|
||||
- Renamed ClockEvent.TimeUpdate to ClockEvent.Tick, and added ClockEvent.Stop
|
||||
- Clock.enable() and .disable() now return a boolean to indicate whether the function had any effect.
|
||||
- Added Clock.setEnabled() to force the enabled-state to the given value.
|
||||
- Renamed ManualClock.timeUpdate() to ManualClock.tick()
|
||||
- Moved WebRenderer.enable(), .disable() and .enabled to NullRenderer
|
||||
- Fixed not being able to parse tags with default values.
|
||||
- Fixed font preloader downloading the same font multiple times because it didn't filter for duplicates.
|
||||
- Fixed min-width value not taking separate left and right margins into account.
|
||||
- Fixed absolutely positioned subs were always left-aligned even if they had an alignment tag.
|
||||
- Fixed blur and outlines getting truncated.
|
||||
|
||||
|
||||
### v0.7.0 - 2014/05/15
|
||||
- Implemented \be
|
||||
- Split a new renderer, WebRenderer, off DefaultRenderer that doesn't rely on a video element.
|
||||
- All renderers now require a Clock to generate time events. VideoClock is a Clock backed by a video element, while ManualClock is a clock that can be used to generate arbitrary time events.
|
||||
|
||||
|
||||
### v0.6.0 - 2014/03/24
|
||||
- All script properties and style properties are now parsed and stored in the ASS and Style objects.
|
||||
- Basic SRT support, by passing in a libjass.Format argument to ASS.fromString()
|
||||
- \clip and \iclip now have their drawing instructions parsed as an array of libjass.parts.drawing.Instruction's instead of just a string.
|
||||
- Added DefaultRenderer.enable(), DefaultRenderer.disable() and DefaultRenderer.toggle() to change whether the renderer is displaying subtitles or not.
|
||||
- DefaultRenderer.resizeVideo is now called DefaultRenderer.resize. Now it only resizes the subtitle wrapper div, not the video element.
|
||||
- Replaced the 41ms setInterval-bsed timer with a requestAnimationFrame-based timer to reduce load on minimized or hidden browser tabs.
|
||||
- DefaultRenderer now renders dialogues in the correct order according to the script.
|
||||
- Fixed incorrect font sizes.
|
||||
- Replaced jake with gulp.
|
||||
|
||||
|
||||
### v0.5.0 - 2014/01/26
|
||||
- Removed preLoadFonts renderer setting. It was redundant with the actual fontMap setting since the presence or absence of that setting is enough to signal whether the user wants to preload fonts or not.
|
||||
- Multiple renderers can now be used on the same page without conflicting with each other.
|
||||
- Implemented \shad, \xshad, \yshad
|
||||
- Fixed ASS draw scale being used incorrectly.
|
||||
- ASS.resolutionX and ASS.resolutionY are now properties of ASS.properties, a ScriptProperties object.
|
||||
|
||||
|
||||
### v0.4.0 - 2013/12/27
|
||||
- All parts moved from the libjass.tags namespace to the libjass.parts namespace.
|
||||
- Replaced PEG.js parser with a hand-written one. This allows for parsing lines that are strictly invalid grammar but are parsed successfully by VSFilter or libass.
|
||||
- All ASS tags are now supported by the parser.
|
||||
- Removed the useHighResolutionTimer setting for DefaultRenderer. DefaultRenderer always uses the 41ms timer now.
|
||||
- Implemented \move
|
||||
- Implemented ASS draw
|
||||
- Fixed subs overflowing the video dimensions still being visible.
|
||||
- SVG filters are now used for outlines and blur.
|
||||
- Delay parsing of dialogue lines till they need to be pre-rendered. As a side-effect, all fonts in the font map are preloaded now, not just the ones used in the current script.
|
||||
|
||||
|
||||
### v0.3.0 - 2013/10/28
|
||||
- Moved libjass.DefaultRenderer to libjass.renderers.DefaultRenderer
|
||||
- Added libjass.renderers.NullRenderer, a renderer that doesn't render anything.
|
||||
- DefaultRenderer's fontMap setting is now a Map instead of an Object. It now supports more than one URL for each font name.
|
||||
- DefaultRenderer now generates the subtitle wrapper div itself.
|
||||
- DefaultRenderer now takes video letterboxing into account when resizing the subtitles.
|
||||
- DefaultRenderer has a new setting useHighResolutionTimer that makes it use a 41ms timer instead of video.timeUpdate's 250ms timer.
|
||||
- div IDs and CSS class names are now prefixed with "libjass-" to avoid collisions with other elements on the page.
|
||||
- All numeric CSS property values are now truncated to three decimal places.
|
||||
- Added ```jake watch``` that rebuilds and runs tests on changes to the source.
|
||||
- Added ```jake doc``` that builds API documentation.
|
||||
- Added Travis CI build.
|
||||
|
||||
|
||||
### v0.2.0 - 2013/09/11
|
||||
- Added libjass.DefaultRenderer, a class that handles initializing the layer div's, preloading fonts, and drawing Dialogues based on the current video time.
|
||||
- libjass.js can now be loaded in node. Only the parser can be used.
|
||||
- Tests can now be run with ```jake test``` or ```npm test``` using Mocha.
|
||||
|
||||
### v0.1.0 - 2013/08/29
|
||||
- First npm release.
|
202
dashboard-ui/bower_components/libjass/LICENSE
vendored
Normal file
202
dashboard-ui/bower_components/libjass/LICENSE
vendored
Normal file
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
100
dashboard-ui/bower_components/libjass/libjass.css
vendored
Normal file
100
dashboard-ui/bower_components/libjass/libjass.css
vendored
Normal file
|
@ -0,0 +1,100 @@
|
|||
/**
|
||||
* libjass
|
||||
*
|
||||
* https://github.com/Arnavion/libjass
|
||||
*
|
||||
* Copyright 2013 Arnav Singh
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
.libjass-wrapper {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.libjass-subs {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.libjass-subs, .libjass-subs * {
|
||||
pointer-events: none;
|
||||
-webkit-animation-fill-mode: both !important;
|
||||
animation-fill-mode: both !important;
|
||||
}
|
||||
|
||||
.libjass-subs.paused * {
|
||||
-webkit-animation-play-state: paused !important;
|
||||
animation-play-state: paused !important;
|
||||
}
|
||||
|
||||
.libjass-subs .an {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.libjass-subs .an1, .libjass-subs .an2, .libjass-subs .an3 {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.libjass-subs .an4, .libjass-subs .an5, .libjass-subs .an6 {
|
||||
display: table;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.libjass-subs .an4 > *, .libjass-subs .an5 > *, .libjass-subs .an6 > * {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.libjass-subs .an7, .libjass-subs .an8, .libjass-subs .an9 {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.libjass-subs .an1, .libjass-subs .an4, .libjass-subs .an7 {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.libjass-subs .an2, .libjass-subs .an5, .libjass-subs .an8 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.libjass-subs .an3, .libjass-subs .an6, .libjass-subs .an9 {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.libjass-subs {
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
/* Filter wrapper span */
|
||||
.libjass-subs div[data-dialogue-id] > span {
|
||||
-webkit-perspective-origin: center;
|
||||
-webkit-perspective: 400px;
|
||||
perspective-origin: center;
|
||||
perspective: 400px;
|
||||
}
|
||||
|
||||
.libjass-font-measure {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.libjass-filters {
|
||||
display: block;
|
||||
}
|
9650
dashboard-ui/bower_components/libjass/libjass.js
vendored
Normal file
9650
dashboard-ui/bower_components/libjass/libjass.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
dashboard-ui/bower_components/libjass/libjass.js.map
vendored
Normal file
1
dashboard-ui/bower_components/libjass/libjass.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
24
dashboard-ui/bower_components/libjass/libjass.min.js
vendored
Normal file
24
dashboard-ui/bower_components/libjass/libjass.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dashboard-ui/bower_components/libjass/libjass.min.js.map
vendored
Normal file
1
dashboard-ui/bower_components/libjass/libjass.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
24
dashboard-ui/bower_components/libjass/package.json
vendored
Normal file
24
dashboard-ui/bower_components/libjass/package.json
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"name": "libjass",
|
||||
"version": "0.11.0",
|
||||
"description": "A library to render ASS subtitles on HTML5 video in the browser.",
|
||||
"keywords": [
|
||||
"browser",
|
||||
"html5",
|
||||
"subtitles"
|
||||
],
|
||||
"homepage": "https://github.com/Arnavion/libjass",
|
||||
"bugs": "https://github.com/Arnavion/libjass/issues",
|
||||
"license": "Apache-2.0",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Arnav Singh",
|
||||
"email": "arnavion@gmail.com"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Arnavion/libjass"
|
||||
},
|
||||
"main": "libjass.js"
|
||||
}
|
|
@ -13,7 +13,7 @@
|
|||
var self = this;
|
||||
|
||||
function onEnded() {
|
||||
destroyCustomTrack();
|
||||
destroyCustomTrack(this);
|
||||
Events.trigger(self, 'ended');
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@
|
|||
|
||||
function onError(e) {
|
||||
|
||||
destroyCustomTrack();
|
||||
destroyCustomTrack(this);
|
||||
|
||||
var elem = e.target;
|
||||
var errorCode = elem.error ? elem.error.code : '';
|
||||
|
@ -282,7 +282,7 @@
|
|||
|
||||
self.stop = function () {
|
||||
|
||||
destroyCustomTrack();
|
||||
destroyCustomTrack(mediaElement);
|
||||
|
||||
if (mediaElement) {
|
||||
mediaElement.pause();
|
||||
|
@ -538,12 +538,20 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (track) {
|
||||
var format = (track.format || '').toLowerCase();
|
||||
if (format == 'ssa' || format == 'ass') {
|
||||
// libjass is needed here
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function destroyCustomTrack(isPlaying) {
|
||||
function destroyCustomTrack(videoElement, isPlaying) {
|
||||
|
||||
//window.removeEventListener('resize', onVideoResize);
|
||||
window.removeEventListener('resize', onVideoResize);
|
||||
|
||||
var videoSubtitlesElem = document.querySelector('.videoSubtitles');
|
||||
if (videoSubtitlesElem) {
|
||||
|
@ -552,7 +560,7 @@
|
|||
|
||||
if (isPlaying) {
|
||||
|
||||
var allTracks = mediaElement.textTracks; // get list of tracks
|
||||
var allTracks = videoElement.textTracks; // get list of tracks
|
||||
for (var i = 0; i < allTracks.length; i++) {
|
||||
|
||||
var currentTrack = allTracks[i];
|
||||
|
@ -584,10 +592,10 @@
|
|||
});
|
||||
}
|
||||
|
||||
function setTrackForCustomDisplay(track) {
|
||||
function setTrackForCustomDisplay(videoElement, track) {
|
||||
|
||||
if (!track) {
|
||||
destroyCustomTrack(true);
|
||||
destroyCustomTrack(videoElement, true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -596,13 +604,60 @@
|
|||
return;
|
||||
}
|
||||
|
||||
destroyCustomTrack(true);
|
||||
destroyCustomTrack(videoElement, true);
|
||||
customTrackIndex = track.index;
|
||||
renderTracksEvents(track);
|
||||
renderTracksEvents(videoElement, track);
|
||||
lastCustomTrackMs = 0;
|
||||
}
|
||||
|
||||
function renderTracksEvents(track) {
|
||||
function renderWithLibjass(videoElement, track) {
|
||||
|
||||
var rendererSettings = {};
|
||||
|
||||
require(['libjass'], function (libjass) {
|
||||
|
||||
libjass.ASS.fromUrl(track.url).then(function (ass) {
|
||||
|
||||
var clock = currentClock = new libjass.renderers.ManualClock();
|
||||
|
||||
// Create a DefaultRenderer using the video element and the ASS object
|
||||
var renderer = new libjass.renderers.WebRenderer(ass, clock, videoElement.parentNode.parentNode, rendererSettings);
|
||||
|
||||
currentAssRenderer = renderer;
|
||||
|
||||
renderer.addEventListener("ready", function () {
|
||||
try {
|
||||
renderer.resize(videoElement.offsetWidth, videoElement.offsetHeight, 0, 0);
|
||||
window.removeEventListener('resize', onVideoResize);
|
||||
window.addEventListener('resize', onVideoResize);
|
||||
//clock.pause();
|
||||
}
|
||||
catch (ex) {
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function onVideoResize() {
|
||||
var renderer = currentAssRenderer;
|
||||
if (renderer) {
|
||||
var videoElement = mediaElement;
|
||||
var width = videoElement.offsetWidth;
|
||||
var height = videoElement.offsetHeight;
|
||||
console.log('videoElement resized: ' + width + 'x' + height);
|
||||
renderer.resize(width, height, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function renderTracksEvents(videoElement, track) {
|
||||
|
||||
var format = (track.format || '').toLowerCase();
|
||||
if (format == 'ssa' || format == 'ass') {
|
||||
// libjass is needed here
|
||||
renderWithLibjass(videoElement, track);
|
||||
return;
|
||||
}
|
||||
|
||||
if (browserInfo.edge || browserInfo.msie) {
|
||||
fetchSubtitles(track).then(function (data) {
|
||||
|
@ -614,7 +669,7 @@
|
|||
var trackElement = null;
|
||||
var expectedId = 'manualTrack' + track.index;
|
||||
|
||||
var allTracks = mediaElement.textTracks; // get list of tracks
|
||||
var allTracks = videoElement.textTracks; // get list of tracks
|
||||
for (var i = 0; i < allTracks.length; i++) {
|
||||
|
||||
var currentTrack = allTracks[i];
|
||||
|
@ -628,7 +683,7 @@
|
|||
}
|
||||
|
||||
if (!trackElement) {
|
||||
trackElement = mediaElement.addTextTrack('subtitles', 'manualTrack' + track.index, track.language || 'und');
|
||||
trackElement = videoElement.addTextTrack('subtitles', 'manualTrack' + track.index, track.language || 'und');
|
||||
trackElement.label = 'manualTrack' + track.index;
|
||||
|
||||
// download the track json
|
||||
|
@ -656,10 +711,10 @@
|
|||
var currentAssRenderer;
|
||||
function updateSubtitleText(timeMs) {
|
||||
|
||||
//var clock = currentClock;
|
||||
//if (clock) {
|
||||
// clock.seek(timeMs / 1000);
|
||||
//}
|
||||
var clock = currentClock;
|
||||
if (clock) {
|
||||
clock.seek(timeMs / 1000);
|
||||
}
|
||||
|
||||
var trackEvents = currentTrackEvents;
|
||||
if (!trackEvents) {
|
||||
|
@ -710,10 +765,10 @@
|
|||
|
||||
if (enableNativeTrackSupport(track)) {
|
||||
|
||||
setTrackForCustomDisplay(null);
|
||||
setTrackForCustomDisplay(mediaElement, null);
|
||||
} else {
|
||||
setTrackForCustomDisplay(track);
|
||||
|
||||
setTrackForCustomDisplay(mediaElement, track);
|
||||
|
||||
// null these out to disable the player's native display (handled below)
|
||||
streamIndex = -1;
|
||||
track = null;
|
||||
|
@ -806,12 +861,12 @@
|
|||
|
||||
if (AppInfo.isNativeApp && browserInfo.safari) {
|
||||
|
||||
if (navigator.userAgent.toLowerCase().indexOf('iphone') != -1) {
|
||||
return true;
|
||||
if (navigator.userAgent.toLowerCase().indexOf('ipad') != -1) {
|
||||
// Need to disable it in order to support picture in picture
|
||||
return false;
|
||||
}
|
||||
|
||||
// Need to disable it in order to support picture in picture
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return self.canAutoPlayVideo();
|
||||
|
|
|
@ -198,10 +198,33 @@ define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, use
|
|||
|
||||
require(['browserdeviceprofile', 'qualityoptions'], function (profileBuilder, qualityoptions) {
|
||||
|
||||
var supportsCustomSeeking = false;
|
||||
if (!browserInfo.mobile) {
|
||||
supportsCustomSeeking = true;
|
||||
} else if (AppInfo.isNativeApp && browserInfo.safari) {
|
||||
if (navigator.userAgent.toLowerCase().indexOf('ipad') == -1) {
|
||||
// Need to disable it in order to support picture in picture
|
||||
supportsCustomSeeking = true;
|
||||
}
|
||||
} else if (AppInfo.isNativeApp) {
|
||||
supportsCustomSeeking = true;
|
||||
}
|
||||
|
||||
var profile = profileBuilder({
|
||||
supportsAutoPlay: !browserInfo.mobile || AppInfo.isNativeApp
|
||||
supportsCustomSeeking: supportsCustomSeeking
|
||||
});
|
||||
|
||||
if (!(AppInfo.isNativeApp && browserInfo.android)) {
|
||||
profile.SubtitleProfiles.push({
|
||||
Format: 'ass',
|
||||
Method: 'External'
|
||||
});
|
||||
profile.SubtitleProfiles.push({
|
||||
Format: 'ssa',
|
||||
Method: 'External'
|
||||
});
|
||||
}
|
||||
|
||||
var bitrateSetting = appSettings.maxStreamingBitrate();
|
||||
|
||||
if (!maxHeight) {
|
||||
|
@ -434,7 +457,8 @@ define(['appSettings', 'userSettings', 'appStorage'], function (appSettings, use
|
|||
url: textStreamUrl,
|
||||
language: (textStream.Language || 'und'),
|
||||
isDefault: textStream.Index == mediaSource.DefaultSubtitleStreamIndex,
|
||||
index: textStream.Index
|
||||
index: textStream.Index,
|
||||
format: textStream.Codec
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1832,6 +1832,8 @@ var AppInfo = {};
|
|||
define("actionsheet", [embyWebComponentsBowerPath + "/actionsheet/actionsheet"], returnFirstDependency);
|
||||
}
|
||||
|
||||
define("libjass", [bowerPath + "/libjass/libjass", "css!" + bowerPath + "/libjass/libjass"], returnFirstDependency);
|
||||
|
||||
define("backdrop", [embyWebComponentsBowerPath + "/backdrop/backdrop"], returnFirstDependency);
|
||||
define("fetchHelper", [embyWebComponentsBowerPath + "/fetchhelper"], returnFirstDependency);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue