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

update components

This commit is contained in:
Luke Pulverenti 2016-04-29 12:55:11 -04:00
parent c6e1a3e747
commit 62ca7d2ffd
16 changed files with 98 additions and 49 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "hls.js", "name": "hls.js",
"version": "0.5.23", "version": "0.5.24",
"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.23", "_release": "0.5.24",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v0.5.23", "tag": "v0.5.24",
"commit": "485756a33406adc4874027d9f20283935c61471c" "commit": "276d45148e6306e9ae06f4c9fa5778e723b78d05"
}, },
"_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

@ -86,25 +86,12 @@ each error is categorized by :
- ```Hls.ErrorTypes.MEDIA_ERROR```for media/video related errors - ```Hls.ErrorTypes.MEDIA_ERROR```for media/video related errors
- ```Hls.ErrorTypes.OTHER_ERROR```for all other errors - ```Hls.ErrorTypes.OTHER_ERROR```for all other errors
- its details: - its details:
- ```Hls.ErrorDetails.MANIFEST_LOAD_ERROR```raised when manifest loading fails because of a network error - refer to [Errors details](#Errors)
- ```Hls.ErrorDetails.MANIFEST_LOAD_TIMEOUT```raised when manifest loading fails because of a timeout
- ```Hls.ErrorDetails.MANIFEST_PARSING_ERROR```raised when manifest parsing failed to find proper content
- ```Hls.ErrorDetails.LEVEL_LOAD_ERROR```raised when level loading fails because of a network error
- ```Hls.ErrorDetails.LEVEL_LOAD_TIMEOUT```raised when level loading fails because of a timeout
- ```Hls.ErrorDetails.LEVEL_SWITCH_ERROR```raised when level switching fails
- ```Hls.ErrorDetails.FRAG_LOAD_ERROR```raised when fragment loading fails because of a network error
- ```Hls.ErrorDetails.FRAG_LOOP_LOADING_ERROR```raised upon detection of same fragment being requested in loop
- ```Hls.ErrorDetails.FRAG_LOAD_TIMEOUT```raised when fragment loading fails because of a timeout
- ```Hls.ErrorDetails.FRAG_DECRYPT_ERROR```raised when fragment decryption fails
- ```Hls.ErrorDetails.FRAG_PARSING_ERROR```raised when fragment parsing fails
- ```Hls.ErrorDetails.BUFFER_APPEND_ERROR```raised when exception is raised while preparing buffer append
- ```Hls.ErrorDetails.BUFFER_APPENDING_ERROR```raised when exception is raised during buffer appending
- ```Hls.ErrorDetails.BUFFER_STALLED_ERROR```raised when playback stalls because the buffer runs out
- its fatality: - its fatality:
- ```false```if error is not fatal, hls.js will try to recover it - ```false```if error is not fatal, hls.js will try to recover it
- ```true```if error is fatal, an action is required to (try to) recover it. - ```true```if error is fatal, an action is required to (try to) recover it.
full details is described [below](##Errors) full details is described [below](#Errors)
see sample code below to listen to errors: see sample code below to listen to errors:
@ -678,7 +665,9 @@ full list of Errors is described below:
- ```Hls.ErrorDetails.BUFFER_FULL_ERROR```raised when no data can be appended anymore in media buffer because it is full. this error is recovered automatically by performing a smooth level switching that empty buffers (without disrupting the playback) and reducing the max buffer length. - ```Hls.ErrorDetails.BUFFER_FULL_ERROR```raised when no data can be appended anymore in media buffer because it is full. this error is recovered automatically by performing a smooth level switching that empty buffers (without disrupting the playback) and reducing the max buffer length.
- data: { type : ```MEDIA_ERROR```, details : ```Hls.ErrorDetails.BUFFER_FULL_ERROR```, fatal : ```false```} - data: { type : ```MEDIA_ERROR```, details : ```Hls.ErrorDetails.BUFFER_FULL_ERROR```, fatal : ```false```}
- ```Hls.ErrorDetails.BUFFER_SEEK_OVER_HOLE```raised after hls.js seeks over a buffer hole to unstuck the playback, - ```Hls.ErrorDetails.BUFFER_SEEK_OVER_HOLE```raised after hls.js seeks over a buffer hole to unstuck the playback,
- data: { type : ```MEDIA_ERROR```, details : ```Hls.ErrorDetails.BUFFER_SEEK_OVER_HOLE```, fatal : ```false```} - data: { type : ```MEDIA_ERROR```, details : ```Hls.ErrorDetails.BUFFER_SEEK_OVER_HOLE```, fatal : ```false```, hole : hole duration}
- ```Hls.ErrorDetails.BUFFER_SEEK_STUCK_IN_BUFFERED```raised after hls.js seeks to workaround a playback stuck although currentTime is buffered
- data: { type : ```MEDIA_ERROR```, details : ```Hls.ErrorDetails.BUFFER_SEEK_STUCK_IN_BUFFERED```, fatal : ```false```}
## Objects ## Objects
### Level ### Level

View file

@ -1,6 +1,6 @@
{ {
"name": "hls.js", "name": "hls.js",
"version": "0.5.23", "version": "0.5.24",
"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

@ -1410,7 +1410,7 @@ var LevelController = function (_EventHandler) {
return this._level; return this._level;
}, },
set: function set(newLevel) { set: function set(newLevel) {
if (this._level !== newLevel || this._levels[newLevel].details === undefined) { if (this._levels && this._levels.length > newLevel && (this._level !== newLevel || this._levels[newLevel].details === undefined)) {
this.setLevelInternal(newLevel); this.setLevelInternal(newLevel);
} }
} }
@ -2533,6 +2533,7 @@ var StreamController = function (_EventHandler) {
// check buffer upfront // check buffer upfront
// if less than jumpThreshold second 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
var configSeekHoleNudgeDuration = this.config.seekHoleNudgeDuration;
if (expectedPlaying && bufferInfo.len <= jumpThreshold) { if (expectedPlaying && bufferInfo.len <= jumpThreshold) {
if (playheadMoving) { if (playheadMoving) {
// playhead moving // playhead moving
@ -2546,7 +2547,7 @@ var StreamController = function (_EventHandler) {
this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false }); this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false });
this.stalled = true; this.stalled = true;
} else { } else {
this.seekHoleNudgeDuration += this.config.seekHoleNudgeDuration; this.seekHoleNudgeDuration += configSeekHoleNudgeDuration;
} }
} }
// if we are below threshold, try to jump if next buffer range is close // if we are below threshold, try to jump if next buffer range is close
@ -2563,10 +2564,30 @@ var StreamController = function (_EventHandler) {
this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: hole }); this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: hole });
} }
} }
// in any case reset stalledInBuffered
this.stalledInBuffered = 0;
} else { } else {
if (targetSeekPosition && media.currentTime !== targetSeekPosition) { if (targetSeekPosition && media.currentTime !== targetSeekPosition) {
_logger.logger.log('adjust currentTime from ' + media.currentTime + ' to ' + targetSeekPosition); _logger.logger.log('adjust currentTime from ' + media.currentTime + ' to ' + targetSeekPosition);
media.currentTime = targetSeekPosition; media.currentTime = targetSeekPosition;
} else if (expectedPlaying && !playheadMoving) {
// if we are in this condition, it means that currentTime is in a buffered area, but playhead is not moving
// if that happens, we wait for a couple of cycle (config.stalledInBufferedNudgeThreshold), then we nudge
// media.currentTime to try to recover that situation.
if (this.stalledInBuffered !== undefined) {
this.stalledInBuffered++;
} else {
this.stalledInBuffered = 1;
}
if (this.stalledInBuffered >= this.config.stalledInBufferedNudgeThreshold) {
_logger.logger.log('playback stuck @ ' + media.currentTime + ', in buffered area, nudge currentTime by ' + configSeekHoleNudgeDuration);
this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_STUCK_IN_BUFFERED, fatal: false });
media.currentTime += configSeekHoleNudgeDuration;
this.stalledInBuffered = 0;
}
} else {
// currentTime is buffered, playhead is moving or playback not expected... everything is fine
this.stalledInBuffered = 0;
} }
} }
} }
@ -5175,6 +5196,8 @@ var ErrorDetails = exports.ErrorDetails = {
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 a seek triggered to workaround a playback stuck although currentTime is buffered
BUFFER_SEEK_STUCK_IN_BUFFERED: 'bufferSeekStuckInBuffered',
// Identifier for an internal exception happening inside hls.js while handling an event // Identifier for an internal exception happening inside hls.js while handling an event
INTERNAL_EXCEPTION: 'internalException' INTERNAL_EXCEPTION: 'internalException'
}; };
@ -5198,6 +5221,12 @@ var _logger = require('./utils/logger');
var _errors = require('./errors'); var _errors = require('./errors');
var _events = require('./events');
var _events2 = _interopRequireDefault(_events);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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"); } }
var EventHandler = function () { var EventHandler = function () {
@ -5272,7 +5301,7 @@ var EventHandler = function () {
eventToFunction.call(this, event, data).call(); eventToFunction.call(this, event, data).call();
} catch (err) { } catch (err) {
_logger.logger.error('internal error happened while processing ' + event + ':' + err.message); _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 }); this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.OTHER_ERROR, details: _errors.ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event: event, err: err });
} }
} }
}]); }]);
@ -5282,7 +5311,7 @@ var EventHandler = function () {
exports.default = EventHandler; exports.default = EventHandler;
},{"./errors":20,"./utils/logger":36}],22:[function(require,module,exports){ },{"./errors":20,"./events":22,"./utils/logger":36}],22:[function(require,module,exports){
'use strict'; 'use strict';
module.exports = { module.exports = {
@ -5713,6 +5742,7 @@ var Hls = function () {
maxBufferHole: 0.5, maxBufferHole: 0.5,
maxSeekHole: 2, maxSeekHole: 2,
seekHoleNudgeDuration: 0.01, seekHoleNudgeDuration: 0.01,
stalledInBufferedNudgeThreshold: 10,
maxFragLookUpTolerance: 0.2, maxFragLookUpTolerance: 0.2,
liveSyncDurationCount: 3, liveSyncDurationCount: 3,
liveMaxLatencyDurationCount: Infinity, liveMaxLatencyDurationCount: Infinity,

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.23", "version": "0.5.24",
"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

@ -113,7 +113,8 @@ class LevelController extends EventHandler {
} }
set level(newLevel) { set level(newLevel) {
if (this._level !== newLevel || this._levels[newLevel].details === undefined) { if (this._levels && this._levels.length > newLevel &&
(this._level !== newLevel || this._levels[newLevel].details === undefined)) {
this.setLevelInternal(newLevel); this.setLevelInternal(newLevel);
} }
} }

View file

@ -1018,6 +1018,7 @@ _checkBuffer() {
// check buffer upfront // check buffer upfront
// if less than jumpThreshold second 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
let configSeekHoleNudgeDuration = this.config.seekHoleNudgeDuration;
if(expectedPlaying && bufferInfo.len <= jumpThreshold) { if(expectedPlaying && bufferInfo.len <= jumpThreshold) {
if(playheadMoving) { if(playheadMoving) {
// playhead moving // playhead moving
@ -1031,7 +1032,7 @@ _checkBuffer() {
this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false}); this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false});
this.stalled = true; this.stalled = true;
} else { } else {
this.seekHoleNudgeDuration += this.config.seekHoleNudgeDuration; this.seekHoleNudgeDuration += configSeekHoleNudgeDuration;
} }
} }
// if we are below threshold, try to jump if next buffer range is close // if we are below threshold, try to jump if next buffer range is close
@ -1050,10 +1051,30 @@ _checkBuffer() {
this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole : hole}); this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole : hole});
} }
} }
// in any case reset stalledInBuffered
this.stalledInBuffered = 0;
} else { } else {
if (targetSeekPosition && media.currentTime !== targetSeekPosition) { if (targetSeekPosition && media.currentTime !== targetSeekPosition) {
logger.log(`adjust currentTime from ${media.currentTime} to ${targetSeekPosition}`); logger.log(`adjust currentTime from ${media.currentTime} to ${targetSeekPosition}`);
media.currentTime = targetSeekPosition; media.currentTime = targetSeekPosition;
} else if (expectedPlaying && !playheadMoving) {
// if we are in this condition, it means that currentTime is in a buffered area, but playhead is not moving
// if that happens, we wait for a couple of cycle (config.stalledInBufferedNudgeThreshold), then we nudge
// media.currentTime to try to recover that situation.
if (this.stalledInBuffered !== undefined) {
this.stalledInBuffered++;
} else {
this.stalledInBuffered = 1;
}
if (this.stalledInBuffered >= this.config.stalledInBufferedNudgeThreshold) {
logger.log(`playback stuck @ ${media.currentTime}, in buffered area, nudge currentTime by ${configSeekHoleNudgeDuration}`);
this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_STUCK_IN_BUFFERED, fatal: false});
media.currentTime+=configSeekHoleNudgeDuration;
this.stalledInBuffered = 0;
}
} else {
// currentTime is buffered, playhead is moving or playback not expected... everything is fine
this.stalledInBuffered = 0;
} }
} }
} }

View file

@ -46,6 +46,8 @@ export const ErrorDetails = {
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 a seek triggered to workaround a playback stuck although currentTime is buffered
BUFFER_SEEK_STUCK_IN_BUFFERED : 'bufferSeekStuckInBuffered',
// Identifier for an internal exception happening inside hls.js while handling an event // Identifier for an internal exception happening inside hls.js while handling an event
INTERNAL_EXCEPTION: 'internalException' INTERNAL_EXCEPTION: 'internalException'
}; };

View file

@ -6,6 +6,7 @@
import {logger} from './utils/logger'; import {logger} from './utils/logger';
import {ErrorTypes, ErrorDetails} from './errors'; import {ErrorTypes, ErrorDetails} from './errors';
import Event from './events';
class EventHandler { class EventHandler {

View file

@ -48,6 +48,7 @@ class Hls {
maxBufferHole: 0.5, maxBufferHole: 0.5,
maxSeekHole: 2, maxSeekHole: 2,
seekHoleNudgeDuration : 0.01, seekHoleNudgeDuration : 0.01,
stalledInBufferedNudgeThreshold: 10,
maxFragLookUpTolerance : 0.2, maxFragLookUpTolerance : 0.2,
liveSyncDurationCount:3, liveSyncDurationCount:3,
liveMaxLatencyDurationCount: Infinity, liveMaxLatencyDurationCount: Infinity,

View file

@ -36,7 +36,7 @@
"tag": "v1.4.0", "tag": "v1.4.0",
"commit": "554f7418fdbd97688eb21518b5f8172167d53a95" "commit": "554f7418fdbd97688eb21518b5f8172167d53a95"
}, },
"_source": "git://github.com/PolymerElements/iron-selector.git", "_source": "git://github.com/polymerelements/iron-selector.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-selector" "_originalSource": "polymerelements/iron-selector"
} }

View file

@ -45,7 +45,7 @@
"tag": "v1.0.11", "tag": "v1.0.11",
"commit": "e3c1ab0c72905b58fb4d9adc2921ea73b5c085a5" "commit": "e3c1ab0c72905b58fb4d9adc2921ea73b5c085a5"
}, },
"_source": "git://github.com/polymerelements/paper-behaviors.git", "_source": "git://github.com/PolymerElements/paper-behaviors.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "polymerelements/paper-behaviors" "_originalSource": "PolymerElements/paper-behaviors"
} }

View file

@ -32,14 +32,14 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0" "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
}, },
"ignore": [], "ignore": [],
"homepage": "https://github.com/polymerelements/paper-ripple", "homepage": "https://github.com/PolymerElements/paper-ripple",
"_release": "1.0.5", "_release": "1.0.5",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.5", "tag": "v1.0.5",
"commit": "d72e7a9a8ab518b901ed18dde492df3b87a93be5" "commit": "d72e7a9a8ab518b901ed18dde492df3b87a93be5"
}, },
"_source": "git://github.com/polymerelements/paper-ripple.git", "_source": "git://github.com/PolymerElements/paper-ripple.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "polymerelements/paper-ripple" "_originalSource": "PolymerElements/paper-ripple"
} }

View file

@ -1671,13 +1671,17 @@ var AppInfo = {};
define("sharingmanager", [embyWebComponentsBowerPath + "/sharing/sharingmanager"], returnFirstDependency); define("sharingmanager", [embyWebComponentsBowerPath + "/sharing/sharingmanager"], returnFirstDependency);
if (Dashboard.isRunningInCordova()) {
paths.apphost = "cordova/apphost";
} else {
paths.apphost = "components/apphost";
}
// hack for an android test before browserInfo is loaded // hack for an android test before browserInfo is loaded
if (Dashboard.isRunningInCordova() && window.MainActivity) { if (Dashboard.isRunningInCordova() && window.MainActivity) {
paths.appStorage = "cordova/android/appstorage"; paths.appStorage = "cordova/android/appstorage";
paths.apphost = "cordova/apphost";
} else { } else {
paths.appStorage = apiClientBowerPath + "/appstorage"; paths.appStorage = apiClientBowerPath + "/appstorage";
paths.apphost = "components/apphost";
} }
paths.playlistManager = "scripts/playlistmanager"; paths.playlistManager = "scripts/playlistmanager";