update components

Conflicts:
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/.bower.json
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/CHANGELOG.md
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/LICENSE
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/components.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/components/prism-core.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/components/prism-core.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/components/prism-jsx.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/components/prism-jsx.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/package.json
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/file-highlight/prism-file-highlight.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/file-highlight/prism-file-highlight.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-invisibles/prism-show-invisibles.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-invisibles/prism-show-invisibles.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-invisibles/prism-show-invisibles.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-language/prism-show-language.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-language/prism-show-language.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/show-language/prism-show-language.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/wpd/prism-wpd.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/plugins/wpd/prism-wpd.min.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/prism.js
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-coy.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-dark.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-funky.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-okaidia.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-tomorrow.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism-twilight.css
	MediaBrowser.WebDashboard/dashboard-ui/bower_components/prism/themes/prism.css
This commit is contained in:
Luke Pulverenti 2016-02-03 18:00:01 -05:00
parent df4c86218e
commit be5906a13e
54 changed files with 570 additions and 641 deletions

View file

@ -881,13 +881,15 @@ var MSEMediaController = (function (_EventHandler) {
}, {
key: 'startLoad',
value: function startLoad() {
if (this.levels && this.media) {
if (this.levels) {
this.startInternal();
if (this.lastCurrentTime) {
_utilsLogger.logger.log('seeking @ ' + this.lastCurrentTime);
var media = this.media,
lastCurrentTime = this.lastCurrentTime;
if (media && lastCurrentTime) {
_utilsLogger.logger.log('seeking @ ' + lastCurrentTime);
if (!this.lastPaused) {
_utilsLogger.logger.log('resuming video');
this.media.play();
media.play();
}
this.state = State.IDLE;
} else {
@ -897,7 +899,7 @@ var MSEMediaController = (function (_EventHandler) {
this.nextLoadPosition = this.startPosition = this.lastCurrentTime;
this.tick();
} else {
_utilsLogger.logger.warn('cannot start loading as either manifest not parsed or video not attached');
_utilsLogger.logger.warn('cannot start loading as manifest not parsed yet');
}
}
}, {
@ -1486,7 +1488,7 @@ var MSEMediaController = (function (_EventHandler) {
to avoid rounding issues/infinite loop,
only flush buffer range of length greater than 500ms.
*/
if (flushEnd - flushStart > 0.5) {
if (Math.min(flushEnd, bufEnd) - flushStart > 0.5) {
_utilsLogger.logger.log('flush ' + type + ' [' + flushStart + ',' + flushEnd + '], of [' + bufStart + ',' + bufEnd + '], pos:' + this.media.currentTime);
sb.remove(flushStart, flushEnd);
return false;
@ -1499,6 +1501,8 @@ var MSEMediaController = (function (_EventHandler) {
return false;
}
}
} else {
_utilsLogger.logger.warn('abort flushing too many retries');
}
/* after successful buffer flushing, rebuild buffer Range array
@ -2063,7 +2067,7 @@ var MSEMediaController = (function (_EventHandler) {
jumpThreshold = 0;
} else {
// playhead not moving AND media playing
_utilsLogger.logger.log('playback seems stuck');
_utilsLogger.logger.log('playback seems stuck @' + currentTime);
if (!this.stalled) {
this.hls.trigger(_events2['default'].ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false });
this.stalled = true;
@ -2850,52 +2854,52 @@ var AACDemuxer = (function () {
id3 = new _demuxId32['default'](data),
pts = 90 * id3.timeStamp,
config,
adtsFrameSize,
adtsStartOffset,
adtsHeaderLen,
frameLength,
frameDuration,
frameIndex,
offset,
headerLength,
stamp,
nbSamples,
len,
aacSample;
// look for ADTS header (0xFFFx)
for (adtsStartOffset = id3.length, len = data.length; adtsStartOffset < len - 1; adtsStartOffset++) {
if (data[adtsStartOffset] === 0xff && (data[adtsStartOffset + 1] & 0xf0) === 0xf0) {
for (offset = id3.length, len = data.length; offset < len - 1; offset++) {
if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {
break;
}
}
if (!track.audiosamplerate) {
config = _adts2['default'].getAudioConfig(this.observer, data, adtsStartOffset, audioCodec);
config = _adts2['default'].getAudioConfig(this.observer, data, offset, audioCodec);
track.config = config.config;
track.audiosamplerate = config.samplerate;
track.channelCount = config.channelCount;
track.codec = config.codec;
track.timescale = this.remuxer.timescale;
track.duration = this.remuxer.timescale * duration;
track.timescale = config.samplerate;
track.duration = config.samplerate * duration;
_utilsLogger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);
}
nbSamples = 0;
while (adtsStartOffset + 5 < len) {
frameIndex = 0;
frameDuration = 1024 * 90000 / track.audiosamplerate;
while (offset + 5 < len) {
// The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header
headerLength = !!(data[offset + 1] & 0x01) ? 7 : 9;
// retrieve frame size
adtsFrameSize = (data[adtsStartOffset + 3] & 0x03) << 11;
// byte 4
adtsFrameSize |= data[adtsStartOffset + 4] << 3;
// byte 5
adtsFrameSize |= (data[adtsStartOffset + 5] & 0xE0) >>> 5;
adtsHeaderLen = !!(data[adtsStartOffset + 1] & 0x01) ? 7 : 9;
adtsFrameSize -= adtsHeaderLen;
stamp = Math.round(pts + nbSamples * 1024 * 90000 / track.audiosamplerate);
frameLength = (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;
frameLength -= headerLength;
//stamp = pes.pts;
//console.log('AAC frame, offset/length/pts:' + (adtsStartOffset+7) + '/' + adtsFrameSize + '/' + stamp.toFixed(0));
if (adtsFrameSize > 0 && adtsStartOffset + adtsHeaderLen + adtsFrameSize <= len) {
aacSample = { unit: data.subarray(adtsStartOffset + adtsHeaderLen, adtsStartOffset + adtsHeaderLen + adtsFrameSize), pts: stamp, dts: stamp };
if (frameLength > 0 && offset + headerLength + frameLength <= len) {
stamp = pts + frameIndex * frameDuration;
//logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);
aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };
track.samples.push(aacSample);
track.len += adtsFrameSize;
adtsStartOffset += adtsFrameSize + adtsHeaderLen;
nbSamples++;
track.len += frameLength;
offset += frameLength + headerLength;
frameIndex++;
// look for ADTS header (0xFFFx)
for (; adtsStartOffset < len - 1; adtsStartOffset++) {
if (data[adtsStartOffset] === 0xff && (data[adtsStartOffset + 1] & 0xf0) === 0xf0) {
for (; offset < len - 1; offset++) {
if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {
break;
}
}
@ -2913,12 +2917,12 @@ var AACDemuxer = (function () {
value: function probe(data) {
// check if data contains ID3 timestamp and ADTS sync worc
var id3 = new _demuxId32['default'](data),
adtsStartOffset,
offset,
len;
if (id3.hasTimeStamp) {
// look for ADTS header (0xFFFx)
for (adtsStartOffset = id3.length, len = data.length; adtsStartOffset < len - 1; adtsStartOffset++) {
if (data[adtsStartOffset] === 0xff && (data[adtsStartOffset + 1] & 0xf0) === 0xf0) {
for (offset = id3.length, len = data.length; offset < len - 1; offset++) {
if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) {
//logger.log('ADTS sync word found !');
return true;
}
@ -4553,8 +4557,8 @@ var TSDemuxer = (function () {
track.audiosamplerate = config.samplerate;
track.channelCount = config.channelCount;
track.codec = config.codec;
track.timescale = this.remuxer.timescale;
track.duration = track.timescale * duration;
track.timescale = config.samplerate;
track.duration = config.samplerate * duration;
_utilsLogger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);
}
frameIndex = 0;
@ -4579,7 +4583,7 @@ var TSDemuxer = (function () {
//stamp = pes.pts;
if (frameLength > 0 && offset + headerLength + frameLength <= len) {
stamp = Math.round(pts + frameIndex * frameDuration);
stamp = pts + frameIndex * frameDuration;
//logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);
aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };
track.samples.push(aacSample);
@ -5076,7 +5080,7 @@ var Hls = (function () {
debug: false,
maxBufferLength: 30,
maxBufferSize: 60 * 1000 * 1000,
maxBufferHole: 0.3,
maxBufferHole: 0.5,
maxSeekHole: 2,
liveSyncDurationCount: 3,
liveMaxLatencyDurationCount: Infinity,
@ -6674,7 +6678,8 @@ var MP4Remuxer = (function () {
var view,
offset = 8,
pesTimeScale = this.PES_TIMESCALE,
pes2mp4ScaleFactor = this.PES2MP4SCALEFACTOR,
mp4timeScale = track.timescale,
pes2mp4ScaleFactor = pesTimeScale / mp4timeScale,
aacSample,
mp4Sample,
unit,
@ -6690,15 +6695,10 @@ var MP4Remuxer = (function () {
samples = [],
samples0 = [];
track.samples.forEach(function (aacSample) {
if (pts === undefined || aacSample.pts > pts) {
samples0.push(aacSample);
pts = aacSample.pts;
} else {
_utilsLogger.logger.warn('dropping past audio frame');
track.len -= aacSample.unit.byteLength;
}
track.samples.sort(function (a, b) {
return a.pts - b.pts;
});
samples0 = track.samples;
while (samples0.length) {
aacSample = samples0.shift();
@ -6710,13 +6710,15 @@ var MP4Remuxer = (function () {
if (lastDTS !== undefined) {
ptsnorm = this._PTSNormalize(pts, lastDTS);
dtsnorm = this._PTSNormalize(dts, lastDTS);
// let's compute sample duration
// let's compute sample duration.
// there should be 1024 audio samples in one AAC frame
mp4Sample.duration = (dtsnorm - lastDTS) / pes2mp4ScaleFactor;
if (mp4Sample.duration < 0) {
if (Math.abs(mp4Sample.duration - 1024) > 10) {
// not expected to happen ...
_utilsLogger.logger.log('invalid AAC sample duration at PTS:' + aacSample.pts + ':' + mp4Sample.duration);
mp4Sample.duration = 0;
_utilsLogger.logger.log('invalid AAC sample duration at PTS ' + Math.round(pts / 90) + ',should be 1024,found :' + Math.round(mp4Sample.duration));
}
mp4Sample.duration = 1024;
dtsnorm = 1024 * pes2mp4ScaleFactor + lastDTS;
} else {
var nextAacPts = this.nextAacPts,
delta;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long