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

update form

This commit is contained in:
Luke Pulverenti 2016-04-15 15:20:04 -04:00
parent 077f440dcc
commit 14519607f4
29 changed files with 306 additions and 188 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "hls.js", "name": "hls.js",
"version": "0.5.20", "version": "0.5.21",
"license": "Apache-2.0", "license": "Apache-2.0",
"description": "Media Source Extension - HLS library, by/for Dailymotion", "description": "Media Source Extension - HLS library, by/for Dailymotion",
"homepage": "https://github.com/dailymotion/hls.js", "homepage": "https://github.com/dailymotion/hls.js",
@ -16,11 +16,11 @@
"test", "test",
"tests" "tests"
], ],
"_release": "0.5.20", "_release": "0.5.21",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v0.5.20", "tag": "v0.5.21",
"commit": "3fb06c59d0df49961c057b522dc08eba4b8b0f08" "commit": "25b13e24bbd97785da7e255db117902e692c09dd"
}, },
"_source": "git://github.com/dailymotion/hls.js.git", "_source": "git://github.com/dailymotion/hls.js.git",
"_target": "~0.5.7", "_target": "~0.5.7",

View file

@ -1,6 +1,6 @@
{ {
"name": "hls.js", "name": "hls.js",
"version": "0.5.20", "version": "0.5.21",
"license": "Apache-2.0", "license": "Apache-2.0",
"description": "Media Source Extension - HLS library, by/for Dailymotion", "description": "Media Source Extension - HLS library, by/for Dailymotion",
"homepage": "https://github.com/dailymotion/hls.js", "homepage": "https://github.com/dailymotion/hls.js",

View file

@ -427,7 +427,9 @@ var AbrController = function (_EventHandler) {
}, { }, {
key: 'onFragLoading', key: 'onFragLoading',
value: function onFragLoading(data) { value: function onFragLoading(data) {
if (!this.timer) {
this.timer = setInterval(this.onCheck, 100); this.timer = setInterval(this.onCheck, 100);
}
this.fragCurrent = data.frag; this.fragCurrent = data.frag;
} }
}, { }, {
@ -1188,6 +1190,7 @@ var LevelController = function (_EventHandler) {
value: function destroy() { value: function destroy() {
if (this.timer) { if (this.timer) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null;
} }
this._manualLevel = -1; this._manualLevel = -1;
} }
@ -1712,6 +1715,20 @@ var StreamController = function (_EventHandler) {
_logger.logger.log('buffer end: ' + bufferEnd + ' is located too far from the end of live sliding playlist, media position will be reseted to: ' + this.seekAfterBuffered.toFixed(3)); _logger.logger.log('buffer end: ' + bufferEnd + ' is located too far from the end of live sliding playlist, media position will be reseted to: ' + this.seekAfterBuffered.toFixed(3));
bufferEnd = this.seekAfterBuffered; bufferEnd = this.seekAfterBuffered;
} }
// if end of buffer greater than live edge, don't load any fragment
// this could happen if live playlist intermittently slides in the past.
// level 1 loaded [182580161,182580167]
// level 1 loaded [182580162,182580169]
// Loading 182580168 of [182580162 ,182580169],level 1 ..
// Loading 182580169 of [182580162 ,182580169],level 1 ..
// level 1 loaded [182580162,182580168] <============= here we should have bufferEnd > end. in that case break to avoid reloading 182580168
// level 1 loaded [182580164,182580171]
//
if (bufferEnd > end) {
break;
}
if (this.startFragRequested && !levelDetails.PTSKnown) { if (this.startFragRequested && !levelDetails.PTSKnown) {
/* we are switching level on live playlist, but we don't have any PTS info for that quality level ... /* we are switching level on live playlist, but we don't have any PTS info for that quality level ...
try to load frag matching with next SN. try to load frag matching with next SN.
@ -2516,11 +2533,11 @@ var StreamController = function (_EventHandler) {
_logger.logger.log('playback not stuck anymore @' + currentTime); _logger.logger.log('playback not stuck anymore @' + currentTime);
} }
// check buffer upfront // check buffer upfront
// if less than 200ms is buffered, and media is expected to play but playhead is not moving, // if less than jumpThreshold second is buffered, and media is expected to play but playhead is not moving,
// and we have a new buffer range available upfront, let's seek to that one // and we have a new buffer range available upfront, let's seek to that one
if (bufferInfo.len <= jumpThreshold) { if (expectedPlaying && bufferInfo.len <= jumpThreshold) {
if (playheadMoving || !expectedPlaying) { if (playheadMoving) {
// playhead moving or media not playing // playhead moving
jumpThreshold = 0; jumpThreshold = 0;
this.seekHoleNudgeDuration = 0; this.seekHoleNudgeDuration = 0;
} else { } else {
@ -5158,7 +5175,9 @@ var ErrorDetails = exports.ErrorDetails = {
// Identifier for a buffer full event // Identifier for a buffer full event
BUFFER_FULL_ERROR: 'bufferFullError', BUFFER_FULL_ERROR: 'bufferFullError',
// Identifier for a buffer seek over hole event // Identifier for a buffer seek over hole event
BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole' BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',
// Identifier for an internal exception happening inside hls.js while handling an event
INTERNAL_EXCEPTION: 'internalException'
}; };
},{}],21:[function(require,module,exports){ },{}],21:[function(require,module,exports){
@ -5170,18 +5189,18 @@ Object.defineProperty(exports, "__esModule", {
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*
*
* All objects in the event handling chain should inherit from this class
*
*/
var _logger = require('./utils/logger');
var _errors = require('./errors');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/*
*
* All objects in the event handling chain should inherit from this class
*
*/
//import {logger} from './utils/logger';
var EventHandler = function () { var EventHandler = function () {
function EventHandler(hls) { function EventHandler(hls) {
_classCallCheck(this, EventHandler); _classCallCheck(this, EventHandler);
@ -5250,7 +5269,12 @@ var EventHandler = function () {
} }
return this[funcName].bind(this, data); return this[funcName].bind(this, data);
}; };
try {
eventToFunction.call(this, event, data).call(); eventToFunction.call(this, event, data).call();
} catch (err) {
_logger.logger.error('internal error happened while processing ' + event + ':' + err.message);
this.hls.trigger(Event.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });
}
} }
}]); }]);
@ -5259,7 +5283,7 @@ var EventHandler = function () {
exports.default = EventHandler; exports.default = EventHandler;
},{}],22:[function(require,module,exports){ },{"./errors":20,"./utils/logger":36}],22:[function(require,module,exports){
'use strict'; 'use strict';
module.exports = { module.exports = {
@ -5498,12 +5522,16 @@ var LevelHelper = function () {
if (PTSFrag) { if (PTSFrag) {
LevelHelper.updateFragPTS(newDetails, PTSFrag.sn, PTSFrag.startPTS, PTSFrag.endPTS); LevelHelper.updateFragPTS(newDetails, PTSFrag.sn, PTSFrag.startPTS, PTSFrag.endPTS);
} else { } else {
// ensure that delta is within oldfragments range
// no need to offset start if delta === 0
if (delta > 0 && delta < oldfragments.length) {
// adjust start by sliding offset // adjust start by sliding offset
var sliding = oldfragments[delta].start; var sliding = oldfragments[delta].start;
for (i = 0; i < newfragments.length; i++) { for (i = 0; i < newfragments.length; i++) {
newfragments[i].start += sliding; newfragments[i].start += sliding;
} }
} }
}
// if we are here, it means we have fragments overlapping between // if we are here, it means we have fragments overlapping between
// old and new level. reliable PTS info is thus relying on old level // old and new level. reliable PTS info is thus relying on old level
newDetails.PTSKnown = oldDetails.PTSKnown; newDetails.PTSKnown = oldDetails.PTSKnown;
@ -5795,6 +5823,7 @@ var Hls = function () {
this.playlistLoader.destroy(); this.playlistLoader.destroy();
this.fragmentLoader.destroy(); this.fragmentLoader.destroy();
this.levelController.destroy(); this.levelController.destroy();
this.abrController.destroy();
this.bufferController.destroy(); this.bufferController.destroy();
this.capLevelController.destroy(); this.capLevelController.destroy();
this.streamController.destroy(); this.streamController.destroy();
@ -7281,8 +7310,8 @@ var MP4Remuxer = function () {
ptsnorm = this._PTSNormalize(pts, nextAvcDts); ptsnorm = this._PTSNormalize(pts, nextAvcDts);
dtsnorm = this._PTSNormalize(dts, nextAvcDts); dtsnorm = this._PTSNormalize(dts, nextAvcDts);
delta = Math.round((dtsnorm - nextAvcDts) / 90); delta = Math.round((dtsnorm - nextAvcDts) / 90);
// if fragment are contiguous, or delta less than 600ms, ensure there is no overlap/hole between fragments // if fragment are contiguous, or if there is a huge delta (more than 10s) between expected PTS and sample PTS
if (contiguous || Math.abs(delta) < 600) { if (contiguous || Math.abs(delta) > 10000) {
if (delta) { if (delta) {
if (delta > 1) { if (delta > 1) {
_logger.logger.log('AVC:' + delta + ' ms hole between fragments detected,filling it'); _logger.logger.log('AVC:' + delta + ' ms hole between fragments detected,filling it');
@ -7414,8 +7443,8 @@ var MP4Remuxer = function () {
ptsnorm = this._PTSNormalize(pts, nextAacPts); ptsnorm = this._PTSNormalize(pts, nextAacPts);
dtsnorm = this._PTSNormalize(dts, nextAacPts); dtsnorm = this._PTSNormalize(dts, nextAacPts);
delta = Math.round(1000 * (ptsnorm - nextAacPts) / pesTimeScale); delta = Math.round(1000 * (ptsnorm - nextAacPts) / pesTimeScale);
// if fragment are contiguous, or delta less than 600ms, ensure there is no overlap/hole between fragments // if fragment are contiguous, or if there is a huge delta (more than 10s) between expected PTS and sample PTS
if (contiguous || Math.abs(delta) < 600) { if (contiguous || Math.abs(delta) > 10000) {
// log delta // log delta
if (delta) { if (delta) {
if (delta > 0) { if (delta > 0) {
@ -7427,7 +7456,7 @@ var MP4Remuxer = function () {
track.len -= unit.byteLength; track.len -= unit.byteLength;
continue; continue;
} }
// set DTS to next DTS // set PTS/DTS to next PTS/DTS
ptsnorm = dtsnorm = nextAacPts; ptsnorm = dtsnorm = nextAacPts;
} }
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{ {
"name": "hls.js", "name": "hls.js",
"version": "0.5.20", "version": "0.5.21",
"license": "Apache-2.0", "license": "Apache-2.0",
"description": "Media Source Extension - HLS library, by/for Dailymotion", "description": "Media Source Extension - HLS library, by/for Dailymotion",
"homepage": "https://github.com/dailymotion/hls.js", "homepage": "https://github.com/dailymotion/hls.js",

View file

@ -30,7 +30,9 @@ class AbrController extends EventHandler {
} }
onFragLoading(data) { onFragLoading(data) {
if (!this.timer) {
this.timer = setInterval(this.onCheck, 100); this.timer = setInterval(this.onCheck, 100);
}
this.fragCurrent = data.frag; this.fragCurrent = data.frag;
} }

View file

@ -21,6 +21,7 @@ class LevelController extends EventHandler {
destroy() { destroy() {
if (this.timer) { if (this.timer) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null;
} }
this._manualLevel = -1; this._manualLevel = -1;
} }

View file

@ -208,6 +208,20 @@ class StreamController extends EventHandler {
logger.log(`buffer end: ${bufferEnd} is located too far from the end of live sliding playlist, media position will be reseted to: ${this.seekAfterBuffered.toFixed(3)}`); logger.log(`buffer end: ${bufferEnd} is located too far from the end of live sliding playlist, media position will be reseted to: ${this.seekAfterBuffered.toFixed(3)}`);
bufferEnd = this.seekAfterBuffered; bufferEnd = this.seekAfterBuffered;
} }
// if end of buffer greater than live edge, don't load any fragment
// this could happen if live playlist intermittently slides in the past.
// level 1 loaded [182580161,182580167]
// level 1 loaded [182580162,182580169]
// Loading 182580168 of [182580162 ,182580169],level 1 ..
// Loading 182580169 of [182580162 ,182580169],level 1 ..
// level 1 loaded [182580162,182580168] <============= here we should have bufferEnd > end. in that case break to avoid reloading 182580168
// level 1 loaded [182580164,182580171]
//
if (bufferEnd > end) {
break;
}
if (this.startFragRequested && !levelDetails.PTSKnown) { if (this.startFragRequested && !levelDetails.PTSKnown) {
/* we are switching level on live playlist, but we don't have any PTS info for that quality level ... /* we are switching level on live playlist, but we don't have any PTS info for that quality level ...
try to load frag matching with next SN. try to load frag matching with next SN.
@ -1004,11 +1018,11 @@ _checkBuffer() {
logger.log(`playback not stuck anymore @${currentTime}`); logger.log(`playback not stuck anymore @${currentTime}`);
} }
// check buffer upfront // check buffer upfront
// if less than 200ms is buffered, and media is expected to play but playhead is not moving, // if less than jumpThreshold second is buffered, and media is expected to play but playhead is not moving,
// and we have a new buffer range available upfront, let's seek to that one // and we have a new buffer range available upfront, let's seek to that one
if(bufferInfo.len <= jumpThreshold) { if(expectedPlaying && bufferInfo.len <= jumpThreshold) {
if(playheadMoving || !expectedPlaying) { if(playheadMoving) {
// playhead moving or media not playing // playhead moving
jumpThreshold = 0; jumpThreshold = 0;
this.seekHoleNudgeDuration = 0; this.seekHoleNudgeDuration = 0;
} else { } else {

View file

@ -45,5 +45,7 @@ export const ErrorDetails = {
// Identifier for a buffer full event // Identifier for a buffer full event
BUFFER_FULL_ERROR: 'bufferFullError', BUFFER_FULL_ERROR: 'bufferFullError',
// Identifier for a buffer seek over hole event // Identifier for a buffer seek over hole event
BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole' BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole',
// Identifier for an internal exception happening inside hls.js while handling an event
INTERNAL_EXCEPTION: 'internalException'
}; };

View file

@ -4,7 +4,8 @@
* *
*/ */
//import {logger} from './utils/logger'; import {logger} from './utils/logger';
import {ErrorTypes, ErrorDetails} from './errors';
class EventHandler { class EventHandler {
@ -59,7 +60,12 @@ class EventHandler {
} }
return this[funcName].bind(this, data); return this[funcName].bind(this, data);
}; };
try {
eventToFunction.call(this, event, data).call(); eventToFunction.call(this, event, data).call();
} catch (err) {
logger.error(`internal error happened while processing ${event}:${err.message}`);
this.hls.trigger(Event.ERROR, {type: ErrorTypes.OTHER_ERROR, details: ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event : event, err : err});
}
} }
} }

View file

@ -44,12 +44,16 @@ class LevelHelper {
if(PTSFrag) { if(PTSFrag) {
LevelHelper.updateFragPTS(newDetails,PTSFrag.sn,PTSFrag.startPTS,PTSFrag.endPTS); LevelHelper.updateFragPTS(newDetails,PTSFrag.sn,PTSFrag.startPTS,PTSFrag.endPTS);
} else { } else {
// ensure that delta is within oldfragments range
// no need to offset start if delta === 0
if (delta > 0 && delta < oldfragments.length) {
// adjust start by sliding offset // adjust start by sliding offset
var sliding = oldfragments[delta].start; var sliding = oldfragments[delta].start;
for(i = 0 ; i < newfragments.length ; i++) { for(i = 0 ; i < newfragments.length ; i++) {
newfragments[i].start += sliding; newfragments[i].start += sliding;
} }
} }
}
// if we are here, it means we have fragments overlapping between // if we are here, it means we have fragments overlapping between
// old and new level. reliable PTS info is thus relying on old level // old and new level. reliable PTS info is thus relying on old level
newDetails.PTSKnown = oldDetails.PTSKnown; newDetails.PTSKnown = oldDetails.PTSKnown;

View file

@ -142,6 +142,7 @@ class Hls {
this.playlistLoader.destroy(); this.playlistLoader.destroy();
this.fragmentLoader.destroy(); this.fragmentLoader.destroy();
this.levelController.destroy(); this.levelController.destroy();
this.abrController.destroy();
this.bufferController.destroy(); this.bufferController.destroy();
this.capLevelController.destroy(); this.capLevelController.destroy();
this.streamController.destroy(); this.streamController.destroy();

View file

@ -190,8 +190,8 @@ class MP4Remuxer {
ptsnorm = this._PTSNormalize(pts, nextAvcDts); ptsnorm = this._PTSNormalize(pts, nextAvcDts);
dtsnorm = this._PTSNormalize(dts, nextAvcDts); dtsnorm = this._PTSNormalize(dts, nextAvcDts);
delta = Math.round((dtsnorm - nextAvcDts) / 90); delta = Math.round((dtsnorm - nextAvcDts) / 90);
// if fragment are contiguous, or delta less than 600ms, ensure there is no overlap/hole between fragments // if fragment are contiguous, or if there is a huge delta (more than 10s) between expected PTS and sample PTS
if (contiguous || Math.abs(delta) < 600) { if (contiguous || Math.abs(delta) > 10000) {
if (delta) { if (delta) {
if (delta > 1) { if (delta > 1) {
logger.log(`AVC:${delta} ms hole between fragments detected,filling it`); logger.log(`AVC:${delta} ms hole between fragments detected,filling it`);
@ -314,8 +314,8 @@ class MP4Remuxer {
ptsnorm = this._PTSNormalize(pts, nextAacPts); ptsnorm = this._PTSNormalize(pts, nextAacPts);
dtsnorm = this._PTSNormalize(dts, nextAacPts); dtsnorm = this._PTSNormalize(dts, nextAacPts);
delta = Math.round(1000 * (ptsnorm - nextAacPts) / pesTimeScale); delta = Math.round(1000 * (ptsnorm - nextAacPts) / pesTimeScale);
// if fragment are contiguous, or delta less than 600ms, ensure there is no overlap/hole between fragments // if fragment are contiguous, or if there is a huge delta (more than 10s) between expected PTS and sample PTS
if (contiguous || Math.abs(delta) < 600) { if (contiguous || Math.abs(delta) > 10000) {
// log delta // log delta
if (delta) { if (delta) {
if (delta > 0) { if (delta > 0) {
@ -327,7 +327,7 @@ class MP4Remuxer {
track.len -= unit.byteLength; track.len -= unit.byteLength;
continue; continue;
} }
// set DTS to next DTS // set PTS/DTS to next PTS/DTS
ptsnorm = dtsnorm = nextAacPts; ptsnorm = dtsnorm = nextAacPts;
} }
} }

View file

@ -29,14 +29,14 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"ignore": [], "ignore": [],
"homepage": "https://github.com/PolymerElements/iron-behaviors", "homepage": "https://github.com/polymerelements/iron-behaviors",
"_release": "1.0.13", "_release": "1.0.13",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.13", "tag": "v1.0.13",
"commit": "a7bc3428a6da2beed21987b3a8028206826a12bc" "commit": "a7bc3428a6da2beed21987b3a8028206826a12bc"
}, },
"_source": "git://github.com/PolymerElements/iron-behaviors.git", "_source": "git://github.com/polymerelements/iron-behaviors.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-behaviors" "_originalSource": "polymerelements/iron-behaviors"
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-overlay-behavior", "name": "iron-overlay-behavior",
"version": "1.6.2", "version": "1.6.3",
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for making an element an overlay", "description": "Provides a behavior for making an element an overlay",
"private": true, "private": true,
@ -35,11 +35,11 @@
}, },
"ignore": [], "ignore": [],
"homepage": "https://github.com/polymerelements/iron-overlay-behavior", "homepage": "https://github.com/polymerelements/iron-overlay-behavior",
"_release": "1.6.2", "_release": "1.6.3",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.6.2", "tag": "v1.6.3",
"commit": "be4e703b6894af6d4013a8a9f514a384ee91e2db" "commit": "5b331ebaefe3214937b94ba19769154efee46244"
}, },
"_source": "git://github.com/polymerelements/iron-overlay-behavior.git", "_source": "git://github.com/polymerelements/iron-overlay-behavior.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -1,5 +1,5 @@
language: node_js language: node_js
sudo: false sudo: required
before_script: before_script:
- npm install -g bower polylint web-component-tester - npm install -g bower polylint web-component-tester
- bower install - bower install
@ -8,18 +8,16 @@ env:
global: global:
- secure: H8AA9JkWfG/vc3MiimoIoYi45KD10hKzitLJnExkomgzFI/f5o9SGtwjCii5P8Kvf4xndftDjYwRgbYyJpSg0IJeq8rm1WS89cY8O6/1dlI/tK1j5xbVRrhqmRQncxUb3K4MAT6Z9br1jwEeamRa+NKmq+v+VEpQY5vwuQ/BHJw= - secure: H8AA9JkWfG/vc3MiimoIoYi45KD10hKzitLJnExkomgzFI/f5o9SGtwjCii5P8Kvf4xndftDjYwRgbYyJpSg0IJeq8rm1WS89cY8O6/1dlI/tK1j5xbVRrhqmRQncxUb3K4MAT6Z9br1jwEeamRa+NKmq+v+VEpQY5vwuQ/BHJw=
- secure: EaE1AUVgWyn0Y6kqkb54z5r39RvTJzAOmeM0lRl7wXzr5k0mq3VGlxTksJqCVd1PdJESXEhy8eldBnlkwZir/imDTNQxKm13k7ZiFC0000XAzpLZElkH2cLlYCRWcuM+vS7dA9hytV0UcGK2VGqbxfpcesB20dPSneDEUuc5X64= - secure: EaE1AUVgWyn0Y6kqkb54z5r39RvTJzAOmeM0lRl7wXzr5k0mq3VGlxTksJqCVd1PdJESXEhy8eldBnlkwZir/imDTNQxKm13k7ZiFC0000XAzpLZElkH2cLlYCRWcuM+vS7dA9hytV0UcGK2VGqbxfpcesB20dPSneDEUuc5X64=
- CXX=g++-4.8
node_js: stable node_js: stable
addons: addons:
firefox: latest firefox: latest
apt: apt:
sources: sources:
- google-chrome - google-chrome
- ubuntu-toolchain-r-test
packages: packages:
- google-chrome-stable - google-chrome-stable
- g++-4.8
sauce_connect: true sauce_connect: true
script: script:
- xvfb-run wct - xvfb-run wct
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi" - "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
dist: trusty

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-overlay-behavior", "name": "iron-overlay-behavior",
"version": "1.6.2", "version": "1.6.3",
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for making an element an overlay", "description": "Provides a behavior for making an element an overlay",
"private": true, "private": true,

View file

@ -35,8 +35,8 @@ Custom property | Description | Default
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
width: 100vw; width: 100%;
height: 100vh; height: 100%;
background-color: var(--iron-overlay-backdrop-background-color, #000); background-color: var(--iron-overlay-backdrop-background-color, #000);
opacity: 0; opacity: 0;
transition: opacity 0.2s; transition: opacity 0.2s;

View file

@ -326,13 +326,13 @@ context. You should place this element as a child of `<body>` whenever possible.
// requestAnimationFrame for non-blocking rendering // requestAnimationFrame for non-blocking rendering
if (this.__openChangedAsync) { if (this.__openChangedAsync) {
cancelAnimationFrame(this.__openChangedAsync); window.cancelAnimationFrame(this.__openChangedAsync);
} }
if (this.opened) { if (this.opened) {
if (this.withBackdrop) { if (this.withBackdrop) {
this.backdropElement.prepare(); this.backdropElement.prepare();
} }
this.__openChangedAsync = requestAnimationFrame(function() { this.__openChangedAsync = window.requestAnimationFrame(function() {
this.__openChangedAsync = null; this.__openChangedAsync = null;
this._prepareRenderOpened(); this._prepareRenderOpened();
this._renderOpened(); this._renderOpened();
@ -543,11 +543,11 @@ context. You should place this element as a child of `<body>` whenever possible.
*/ */
_onIronResize: function() { _onIronResize: function() {
if (this.__onIronResizeAsync) { if (this.__onIronResizeAsync) {
cancelAnimationFrame(this.__onIronResizeAsync); window.cancelAnimationFrame(this.__onIronResizeAsync);
this.__onIronResizeAsync = null; this.__onIronResizeAsync = null;
} }
if (this.opened && !this.__isAnimating) { if (this.opened && !this.__isAnimating) {
this.__onIronResizeAsync = requestAnimationFrame(function() { this.__onIronResizeAsync = window.requestAnimationFrame(function() {
this.__onIronResizeAsync = null; this.__onIronResizeAsync = null;
this.refit(); this.refit();
}.bind(this)); }.bind(this));

View file

@ -52,7 +52,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/** /**
* The shared backdrop element. * The shared backdrop element.
* @type {Element} backdropElement * @type {!Element} backdropElement
*/ */
get backdropElement() { get backdropElement() {
if (!this._backdropElement) { if (!this._backdropElement) {
@ -63,7 +63,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/** /**
* The deepest active element. * The deepest active element.
* @type {Element} activeElement the active element * @type {!Element} activeElement the active element
*/ */
get deepActiveElement() { get deepActiveElement() {
// document.activeElement can be null // document.activeElement can be null
@ -83,13 +83,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
*/ */
_bringOverlayAtIndexToFront: function(i) { _bringOverlayAtIndexToFront: function(i) {
var overlay = this._overlays[i]; var overlay = this._overlays[i];
if (!overlay) {
return;
}
var lastI = this._overlays.length - 1; var lastI = this._overlays.length - 1;
var currentOverlay = this._overlays[lastI];
// Ensure always-on-top overlay stays on top. // Ensure always-on-top overlay stays on top.
if (!overlay.alwaysOnTop && this._overlays[lastI].alwaysOnTop) { if (currentOverlay && this._shouldBeBehindOverlay(overlay, currentOverlay)) {
lastI--; lastI--;
} }
// If already the top element, return. // If already the top element, return.
if (!overlay || i >= lastI) { if (i >= lastI) {
return; return;
} }
// Update z-index to be on top. // Update z-index to be on top.
@ -109,7 +113,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/** /**
* Adds the overlay and updates its z-index if it's opened, or removes it if it's closed. * Adds the overlay and updates its z-index if it's opened, or removes it if it's closed.
* Also updates the backdrop z-index. * Also updates the backdrop z-index.
* @param {Element} overlay * @param {!Element} overlay
*/ */
addOrRemoveOverlay: function(overlay) { addOrRemoveOverlay: function(overlay) {
if (overlay.opened) { if (overlay.opened) {
@ -123,7 +127,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/** /**
* Tracks overlays for z-index and focus management. * Tracks overlays for z-index and focus management.
* Ensures the last added overlay with always-on-top remains on top. * Ensures the last added overlay with always-on-top remains on top.
* @param {Element} overlay * @param {!Element} overlay
*/ */
addOverlay: function(overlay) { addOverlay: function(overlay) {
var i = this._overlays.indexOf(overlay); var i = this._overlays.indexOf(overlay);
@ -137,7 +141,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var newZ = this._getZ(overlay); var newZ = this._getZ(overlay);
// Ensure always-on-top overlay stays on top. // Ensure always-on-top overlay stays on top.
if (currentOverlay && currentOverlay.alwaysOnTop && !overlay.alwaysOnTop) { if (currentOverlay && this._shouldBeBehindOverlay(overlay, currentOverlay)) {
// This bumps the z-index of +2. // This bumps the z-index of +2.
this._applyOverlayZ(currentOverlay, minimumZ); this._applyOverlayZ(currentOverlay, minimumZ);
insertionIndex--; insertionIndex--;
@ -158,7 +162,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}, },
/** /**
* @param {Element} overlay * @param {!Element} overlay
*/ */
removeOverlay: function(overlay) { removeOverlay: function(overlay) {
var i = this._overlays.indexOf(overlay); var i = this._overlays.indexOf(overlay);
@ -276,7 +280,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}, },
/** /**
* @param {Element} element * @param {!Element} element
* @param {number|string} z * @param {number|string} z
* @private * @private
*/ */
@ -285,7 +289,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}, },
/** /**
* @param {Element} overlay * @param {!Element} overlay
* @param {number} aboveZ * @param {number} aboveZ
* @private * @private
*/ */
@ -365,6 +369,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
overlay._onCaptureTab(event); overlay._onCaptureTab(event);
} }
} }
},
/**
* Returns if the overlay1 should be behind overlay2.
* @param {!Element} overlay1
* @param {!Element} overlay2
* @return {boolean}
* @private
*/
_shouldBeBehindOverlay: function(overlay1, overlay2) {
var o1 = /** @type {?} */ (overlay1);
var o2 = /** @type {?} */ (overlay2);
return !o1.alwaysOnTop && o2.alwaysOnTop;
} }
}; };

View file

@ -22,10 +22,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script> <script>
WCT.loadSuites([ WCT.loadSuites([
'iron-overlay-behavior.html', 'iron-overlay-behavior.html',
'iron-overlay-behavior.html?dom=shadow' 'iron-overlay-behavior.html?dom=shadow',
'iron-overlay-backdrop.html',
'iron-overlay-backdrop.html?dom=shadow',
]); ]);
</script> </script>
</body></html> </body></html>

View file

@ -0,0 +1,94 @@
<!doctype html>
<!--
@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
-->
<html>
<head>
<title>iron-overlay-backdrop tests</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
<link rel="import" href="test-overlay.html">
<style>
html,
body {
margin: 0;
width: 100%;
height: 100%;
min-width: 0;
}
.sizer {
width: 4000px;
height: 5000px;
}
</style>
<style is="custom-style">
iron-overlay-backdrop {
/* For quicker tests */
--iron-overlay-backdrop: {
transition: none;
}
}
</style>
</head>
<body>
<div class="sizer"></div>
<test-fixture id="backdrop">
<template>
<test-overlay with-backdrop>
Overlay with backdrop
</test-overlay>
</template>
</test-fixture>
<script>
function runAfterOpen(overlay, callback) {
overlay.addEventListener('iron-overlay-opened', callback);
overlay.open();
}
suite('overlay with backdrop', function() {
var overlay;
setup(function() {
overlay = fixture('backdrop');
});
test('backdrop size matches parent size', function(done) {
runAfterOpen(overlay, function() {
Polymer.Base.async(function() {
var backdrop = overlay.backdropElement;
var parent = backdrop.parentElement;
assert.strictEqual(backdrop.offsetWidth, parent.clientWidth, 'backdrop width matches parent width');
assert.strictEqual(backdrop.offsetHeight, parent.clientHeight, 'backdrop height matches parent height');
done();
}, 1);
});
});
});
</script>
</body>
</html>

View file

@ -26,14 +26,14 @@
"web-component-tester": "*" "web-component-tester": "*"
}, },
"private": true, "private": true,
"homepage": "https://github.com/Polymer/polymer", "homepage": "https://github.com/polymer/polymer",
"_release": "1.4.0", "_release": "1.4.0",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.4.0", "tag": "v1.4.0",
"commit": "11c987b2eb3c73b388a79fc8aaea8ca01624f514" "commit": "11c987b2eb3c73b388a79fc8aaea8ca01624f514"
}, },
"_source": "git://github.com/Polymer/polymer.git", "_source": "git://github.com/polymer/polymer.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "Polymer/polymer" "_originalSource": "polymer/polymer"
} }

View file

@ -1,4 +1,4 @@
<div id="devicesUploadPage" data-role="page" class="page type-interior devicesPage withTabs" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Camera%20upload" data-require="scripts/devicesupload,paper-input,jqmcheckbox"> <div id="devicesUploadPage" data-role="page" class="page type-interior devicesPage withTabs" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Camera%20upload" data-require="scripts/devicesupload,paper-input,paper-checkbox">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">
@ -24,9 +24,9 @@
<div class="fieldDescription">${LabelCameraUploadPathHelp}</div> <div class="fieldDescription">${LabelCameraUploadPathHelp}</div>
</li> </li>
<li> <li>
<label for="chkSubfolder">${LabelCreateCameraUploadSubfolder}</label> <br />
<input type="checkbox" id="chkSubfolder" data-mini="true" /> <paper-checkbox id="chkSubfolder">${LabelCreateCameraUploadSubfolder}</paper-checkbox>
<div class="fieldDescription">${LabelCreateCameraUploadSubfolderHelp}</div> <div class="fieldDescription paperCheckboxFieldDescription">${LabelCreateCameraUploadSubfolderHelp}</div>
</li> </li>
</ul><br /> </ul><br />

View file

@ -12,7 +12,7 @@
$('#txtUploadPath', page).val(config.CameraUploadPath || ''); $('#txtUploadPath', page).val(config.CameraUploadPath || '');
$('#chkSubfolder', page).checked(config.EnableCameraUploadSubfolders).checkboxradio('refresh'); $('#chkSubfolder', page).checked(config.EnableCameraUploadSubfolders);
loadDeviceList(page, devices, config); loadDeviceList(page, devices, config);
} }
@ -21,32 +21,27 @@
var html = ''; var html = '';
html += '<fieldset data-role="controlgroup">'; html += '<div class="paperCheckboxListLabel">';
html += '<legend>';
html += Globalize.translate('LabelEnableCameraUploadFor'); html += Globalize.translate('LabelEnableCameraUploadFor');
html += '</legend>'; html += '</div>';
html += '<div class="paperCheckboxList paperList">';
var index = 0; var index = 0;
html += devices.map(function (d) { html += devices.map(function (d) {
var deviceHtml = ''; var deviceHtml = '';
var id = "chk" + index;
deviceHtml += '<label for="' + id + '">';
deviceHtml += d.Name;
if (d.AppName) {
deviceHtml += '<br/><span>' + d.AppName + '</span>';
}
deviceHtml += '</label>';
var isChecked = config.EnabledCameraUploadDevices.indexOf(d.Id) != -1; var isChecked = config.EnabledCameraUploadDevices.indexOf(d.Id) != -1;
var checkedHtml = isChecked ? ' checked="checked"' : ''; var checkedHtml = isChecked ? ' checked="checked"' : '';
deviceHtml += '<input type="checkbox" id="' + id + '" class="chkDevice" data-id="' + d.Id + '"' + checkedHtml + ' />'; var label = d.Name;
if (d.AppName) {
label += ' - ' + d.AppName;
}
deviceHtml += '<paper-checkbox class="chkDevice" data-id="' + d.Id + '"' + checkedHtml + '>' + label + '</paper-checkbox>';
index++; index++;
@ -54,7 +49,7 @@
}).join(''); }).join('');
html += '</fieldset>'; html += '</div>';
html += '<div class="fieldDescription">'; html += '<div class="fieldDescription">';
html += Globalize.translate('LabelEnableCameraUploadForHelp'); html += Globalize.translate('LabelEnableCameraUploadForHelp');
@ -89,7 +84,11 @@
config.CameraUploadPath = $('#txtUploadPath', page).val(); config.CameraUploadPath = $('#txtUploadPath', page).val();
config.EnabledCameraUploadDevices = $('.chkDevice:checked', page).get().map(function (c) { config.EnabledCameraUploadDevices = $('.chkDevice', page).get().filter(function (c) {
return c.checked;
}).map(function (c) {
return c.getAttribute('data-id'); return c.getAttribute('data-id');

View file

@ -1101,6 +1101,10 @@
return 'photos.html?topParentId=' + item.Id; return 'photos.html?topParentId=' + item.Id;
} }
} }
else if (item.IsFolder) {
return id ? "itemlist.html?parentId=" + id : "#";
}
if (item.Type == 'CollectionFolder') { if (item.Type == 'CollectionFolder') {
return 'itemlist.html?topParentId=' + item.Id + '&parentId=' + item.Id; return 'itemlist.html?topParentId=' + item.Id + '&parentId=' + item.Id;
} }

View file

@ -47,7 +47,7 @@
html += '</div>'; html += '</div>';
html += '</div>'; html += '</div>';
html += '<div class="viewMenuBarTabs hiddenScrollX hide">'; html += '<div class="viewMenuBarTabs hiddenScrollX">';
html += '</div>'; html += '</div>';
var viewMenuBar = document.createElement('div'); var viewMenuBar = document.createElement('div');
@ -652,45 +652,6 @@
return getParameterByName('topParentId') || null; return getParameterByName('topParentId') || null;
} }
function slideDownToShow(elem) {
if (!elem.classList.contains('hide')) {
return;
}
elem.classList.remove('hide');
requestAnimationFrame(function () {
var keyframes = [
{ height: '0', offset: 0 },
{ height: elem.clientHeight + 'px', offset: 1 }];
var timing = { duration: 200, iterations: 1, easing: 'ease-out' };
elem.animate(keyframes, timing);
});
}
function slideUpToHide(elem) {
if (elem.classList.contains('hide')) {
return;
}
var height = elem.clientHeight;
requestAnimationFrame(function () {
elem.innerHTML = '';
var keyframes = [
{ height: height + 'px', offset: 0 },
{ height: '0', offset: 1 }];
var timing = { duration: 200, iterations: 1, easing: 'ease-out' };
elem.animate(keyframes, timing).onfinish = function () {
elem.classList.add('hide');
};
});
}
window.LibraryMenu = { window.LibraryMenu = {
getTopParentId: getTopParentId, getTopParentId: getTopParentId,
@ -766,8 +727,8 @@
mainDrawerPanel.classList.remove('withTallToolbar'); mainDrawerPanel.classList.remove('withTallToolbar');
viewMenuBarTabs = document.querySelector('.viewMenuBarTabs'); viewMenuBarTabs = document.querySelector('.viewMenuBarTabs');
slideUpToHide(viewMenuBarTabs); viewMenuBarTabs.innerHTML = '';
//viewMenuBarTabs.innerHTML = ''; viewMenuBarTabs.classList.add('hide');
LibraryMenu.tabType = null; LibraryMenu.tabType = null;
} }
return; return;
@ -775,35 +736,28 @@
viewMenuBarTabs = document.querySelector('.viewMenuBarTabs'); viewMenuBarTabs = document.querySelector('.viewMenuBarTabs');
if (!LibraryMenu.tabType) {
viewMenuBarTabs.classList.remove('hide');
}
if (LibraryMenu.tabType != type) { if (LibraryMenu.tabType != type) {
require(['paper-tabs'], function() { require(['paper-tabs'], function () {
var noInk = browserInfo.animate ? '' : ' noink'; var noInk = browserInfo.animate ? '' : ' noink';
viewMenuBarTabs.innerHTML = '<paper-tabs selected="' + selectedIndex + '" hidescrollbuttons ' + noInk + '>' + builder().map(function(t) { viewMenuBarTabs.innerHTML = '<paper-tabs selected="' + selectedIndex + '" hidescrollbuttons ' + noInk + '>' + builder().map(function (t) {
return '<paper-tab link><a class="clearLink paperTabLink" href="' + t.href + '"><div>' + t.name + '</div></a></paper-tab>'; return '<paper-tab link><a class="clearLink paperTabLink" href="' + t.href + '"><div>' + t.name + '</div></a></paper-tab>';
}).join('') + '</paper-tabs>'; }).join('') + '</paper-tabs>';
mainDrawerPanel.classList.add('withTallToolbar'); mainDrawerPanel.classList.add('withTallToolbar');
if (!LibraryMenu.tabType) {
//viewMenuBarTabs.classList.remove('hide');
slideDownToShow(viewMenuBarTabs);
}
LibraryMenu.tabType = type; LibraryMenu.tabType = type;
}); });
return; return;
} else { }
viewMenuBarTabs.querySelector('paper-tabs').selected = selectedIndex;
if (!LibraryMenu.tabType) { viewMenuBarTabs.querySelector('paper-tabs').selected = selectedIndex;
//viewMenuBarTabs.classList.remove('hide');
slideDownToShow(viewMenuBarTabs);
}
}
LibraryMenu.tabType = type; LibraryMenu.tabType = type;
}, },
@ -1180,7 +1134,6 @@
}); });
Events.on(ConnectionManager, 'localusersignedin', function (e, user) { Events.on(ConnectionManager, 'localusersignedin', function (e, user) {
requiresDrawerRefresh = true;
setDrawerClass(); setDrawerClass();
var apiClient = ConnectionManager.getApiClient(user.ServerId); var apiClient = ConnectionManager.getApiClient(user.ServerId);
ConnectionManager.user(ConnectionManager.getApiClient(user.ServerId)).then(function (user) { ConnectionManager.user(ConnectionManager.getApiClient(user.ServerId)).then(function (user) {
@ -1195,14 +1148,8 @@
} }
}); });
Events.on(ConnectionManager, 'localusersignedout', function () { Events.on(ConnectionManager, 'localusersignedout', updateUserInHeader);
requiresDrawerRefresh = true; Events.on(MediaController, 'playerchange', updateCastIcon);
updateUserInHeader();
});
Events.on(MediaController, 'playerchange', function () {
updateCastIcon();
});
setDrawerClass(); setDrawerClass();

View file

@ -67,7 +67,7 @@
html = LibraryBrowser.getPosterViewHtml({ html = LibraryBrowser.getPosterViewHtml({
items: result.Items, items: result.Items,
shape: "square", shape: "square",
context: 'music', context: 'folders',
showTitle: true, showTitle: true,
showParentTitle: true, showParentTitle: true,
lazy: true, lazy: true,