shaka-player
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -1,6 +0,41 @@ | ||
(function(){var g={}; | ||
(function(window){%output%}.call(g,this)); | ||
if (typeof(module)!="undefined"&&module.exports)module.exports=g.shaka; | ||
else if (typeof(define)!="undefined" && define.amd)define(function(){return g.shaka}); | ||
else this.shaka=g.shaka; | ||
}).call(typeof window === "object" ? window : global); | ||
(function() { | ||
// This is "window" in browsers and "global" in nodejs. | ||
// See https://github.com/google/shaka-player/issues/1445 | ||
var innerGlobal = typeof window != 'undefined' ? window : global; | ||
// This is where our library exports things to. It is "this" in the wrapped | ||
// code. With this, we can decide later what module loader we are in, if any, | ||
// and put these exports in the appropriate place for that loader. | ||
var exportTo = {}; | ||
// According to the Closure team, their polyfills will be written to | ||
// $jscomp.global, which will be "window", or "global", or "this", depending | ||
// on circumstances. | ||
// See https://github.com/google/closure-compiler/issues/2957 and | ||
// https://github.com/google/shaka-player/issues/1455#issuecomment-393250035 | ||
// We provide "global" for use by Closure, and "window" for use by the Shaka | ||
// library itself. Both point to "innerGlobal" above. | ||
(function(window, global) { | ||
%output% | ||
}).call(exportTo, innerGlobal, innerGlobal); | ||
if (typeof exports != 'undefined') { | ||
// CommonJS module loader. Use "exports" instead of "module.exports" to | ||
// avoid triggering inappropriately in Electron. | ||
for (var k in exportTo.shaka) { | ||
exports[k] = exportTo.shaka[k]; | ||
} | ||
} else if (typeof define != 'undefined' && define.amd) { | ||
// AMD module loader. | ||
define(function(){ | ||
return exportTo.shaka; | ||
}); | ||
} else { | ||
// Loaded as an ES module or directly in a <script> tag. | ||
// Export directly to the global scope. | ||
innerGlobal.shaka = exportTo.shaka; | ||
} | ||
})(); |
@@ -193,3 +193,3 @@ # Shaka Upgrade Guide, v1.x => v2 | ||
For more on what you can specify for a custom scheme, see the docs for | ||
{@link shakaExtern.DrmInfo}. | ||
{@link shaka.extern.DrmInfo}. | ||
@@ -310,4 +310,4 @@ | ||
For more on request filters, see the docs for | ||
{@link shaka.net.NetworkingEngine.RequestFilter}, {@link shakaExtern.Request}, | ||
{@link shaka.net.NetworkingEngine.ResponseFilter}, {@link shakaExtern.Response}. | ||
{@link shaka.net.NetworkingEngine.RequestFilter}, {@link shaka.extern.Request}, | ||
{@link shaka.net.NetworkingEngine.ResponseFilter}, {@link shaka.extern.Response}. | ||
@@ -393,3 +393,3 @@ | ||
For more on the AbrManager interface, see the docs for | ||
{@link shakaExtern.AbrManager}. | ||
{@link shaka.extern.AbrManager}. | ||
@@ -439,3 +439,3 @@ | ||
See also the {@link shakaExtern.Track} structure which is used for all track | ||
See also the {@link shaka.extern.Track} structure which is used for all track | ||
types (variant and text). | ||
@@ -518,3 +518,3 @@ | ||
`minVideoBandwidth`, and `maxVideoBandwidth`, see | ||
{@link shakaExtern.Restrictions}. | ||
{@link shaka.extern.Restrictions}. | ||
@@ -585,3 +585,3 @@ For more information on configuration in v2, see {@tutorial config}, | ||
For more on stats in v2, see {@link shakaExtern.Stats}. | ||
For more on stats in v2, see {@link shaka.extern.Stats}. | ||
@@ -652,3 +652,3 @@ | ||
For more on the support object, check out {@link shakaExtern.SupportType}. | ||
For more on the support object, check out {@link shaka.extern.SupportType}. | ||
You can also see the full `probeSupport()` report for your browser at: | ||
@@ -655,0 +655,0 @@ {@link http://shaka-player-demo.appspot.com/support.html} |
@@ -79,3 +79,3 @@ # Shaka Upgrade Guide, v2.0 => v2.4 | ||
See also the {@link shakaExtern.Track} structure which is used for all track | ||
See also the {@link shaka.extern.Track} structure which is used for all track | ||
types (variant and text). | ||
@@ -108,3 +108,3 @@ | ||
In v2.4, they are set through `configure()` method which accepts a | ||
{@link shakaExtern.AbrConfiguration} structure. The new method is more general, | ||
{@link shaka.extern.AbrConfiguration} structure. The new method is more general, | ||
and allows for the configuration of bandwidth upgrade and downgrade targets | ||
@@ -332,4 +332,4 @@ as well. | ||
For more information, see the {@link shakaExtern.TextParser.TimeContext}, | ||
{@link shaka.text.Cue} and {@link shakaExtern.TextParser} definitions in | ||
For more information, see the {@link shaka.extern.TextParser.TimeContext}, | ||
{@link shaka.text.Cue} and {@link shaka.extern.TextParser} definitions in | ||
the API docs. | ||
@@ -471,4 +471,4 @@ | ||
For more information, see the {@link shakaExtern.ManifestParser.PlayerInterface} | ||
and {@link shakaExtern.ManifestParser} definitions in the API docs. | ||
For more information, see the {@link shaka.extern.ManifestParser.PlayerInterface} | ||
and {@link shaka.extern.ManifestParser} definitions in the API docs. | ||
@@ -475,0 +475,0 @@ |
@@ -136,3 +136,3 @@ # Shaka Upgrade Guide, v2.1 => v2.4 | ||
In v2.4, they are set through `configure()` method which accepts a | ||
{@link shakaExtern.AbrConfiguration} structure. The new method is more general, | ||
{@link shaka.extern.AbrConfiguration} structure. The new method is more general, | ||
and allows for the configuration of bandwidth upgrade and downgrade targets | ||
@@ -139,0 +139,0 @@ as well. |
@@ -83,4 +83,4 @@ # Shaka Upgrade Guide, v2.2 => v2.4 | ||
See {@link shakaExtern.TextParser.prototype.parseInit} and | ||
{@link shakaExtern.TextParser.prototype.parseMedia} for details. | ||
See {@link shaka.extern.TextParser.prototype.parseInit} and | ||
{@link shaka.extern.TextParser.prototype.parseMedia} for details. | ||
@@ -99,3 +99,3 @@ | ||
See {@link shakaExtern.CueRegion} for details. | ||
See {@link shaka.extern.CueRegion} for details. | ||
@@ -102,0 +102,0 @@ |
@@ -46,3 +46,3 @@ # Shaka Upgrade Guide, v2.3 => v2.4 | ||
See {@link shakaExtern.TextParser.TimeContext} and {@link shaka.text.CueRegion} | ||
See {@link shaka.extern.TextParser.TimeContext} and {@link shaka.text.CueRegion} | ||
for details. | ||
@@ -62,3 +62,3 @@ | ||
See {@link shakaExtern.CueRegion} for details. | ||
See {@link shaka.extern.CueRegion} for details. | ||
@@ -65,0 +65,0 @@ |
@@ -18,4 +18,6 @@ /** | ||
/** @externs */ | ||
/** | ||
@@ -22,0 +24,0 @@ * A representation of an abortable operation. Note that these are not |
@@ -22,3 +22,2 @@ /** | ||
/** | ||
@@ -25,0 +24,0 @@ * An object which selects Streams from a set of possible choices. This also |
@@ -32,2 +32,3 @@ /** | ||
* @type {shaka.util.Error.Severity} | ||
* @exportDoc | ||
*/ | ||
@@ -39,2 +40,3 @@ shakaExtern.Error.prototype.severity; | ||
* @const {shaka.util.Error.Category} | ||
* @exportDoc | ||
*/ | ||
@@ -46,2 +48,3 @@ shakaExtern.Error.prototype.category; | ||
* @const {shaka.util.Error.Code} | ||
* @exportDoc | ||
*/ | ||
@@ -53,2 +56,3 @@ shakaExtern.Error.prototype.code; | ||
* @const {!Array.<*>} | ||
* @exportDoc | ||
*/ | ||
@@ -60,4 +64,5 @@ shakaExtern.Error.prototype.data; | ||
* @type {boolean} | ||
* @exportDoc | ||
*/ | ||
shakaExtern.Error.prototype.handled; | ||
@@ -728,3 +728,4 @@ /** | ||
* ''. | ||
* @exportDoc | ||
*/ | ||
shakaExtern.LanguageRole; |
@@ -32,2 +32,3 @@ /** | ||
* @type {string} | ||
* @exportDoc | ||
*/ | ||
@@ -40,2 +41,3 @@ shakaExtern.CueRegion.prototype.id; | ||
* @type {number} | ||
* @exportDoc | ||
*/ | ||
@@ -48,2 +50,3 @@ shakaExtern.CueRegion.prototype.viewportAnchorX; | ||
* @type {number} | ||
* @exportDoc | ||
*/ | ||
@@ -57,2 +60,3 @@ shakaExtern.CueRegion.prototype.viewportAnchorY; | ||
* @type {number} | ||
* @exportDoc | ||
*/ | ||
@@ -66,2 +70,3 @@ shakaExtern.CueRegion.prototype.regionAnchorX; | ||
* @type {number} | ||
* @exportDoc | ||
*/ | ||
@@ -74,2 +79,3 @@ shakaExtern.CueRegion.prototype.regionAnchorY; | ||
* @type {number} | ||
* @exportDoc | ||
*/ | ||
@@ -82,2 +88,3 @@ shakaExtern.CueRegion.prototype.width; | ||
* @type {number} | ||
* @exportDoc | ||
*/ | ||
@@ -90,2 +97,3 @@ shakaExtern.CueRegion.prototype.height; | ||
* @type {shaka.text.CueRegion.units} | ||
* @exportDoc | ||
*/ | ||
@@ -98,2 +106,3 @@ shakaExtern.CueRegion.prototype.heightUnits; | ||
* @type {shaka.text.CueRegion.units} | ||
* @exportDoc | ||
*/ | ||
@@ -106,2 +115,3 @@ shakaExtern.CueRegion.prototype.widthUnits; | ||
* @type {shaka.text.CueRegion.units} | ||
* @exportDoc | ||
*/ | ||
@@ -117,2 +127,3 @@ shakaExtern.CueRegion.prototype.viewportAnchorUnits; | ||
* @type {shaka.text.CueRegion.scrollMode} | ||
* @exportDoc | ||
*/ | ||
@@ -132,2 +143,3 @@ shakaExtern.CueRegion.prototype.scroll; | ||
* @type {number} | ||
* @exportDoc | ||
*/ | ||
@@ -140,2 +152,3 @@ shakaExtern.Cue.prototype.startTime; | ||
* @type {number} | ||
* @exportDoc | ||
*/ | ||
@@ -148,2 +161,3 @@ shakaExtern.Cue.prototype.endTime; | ||
* @type {!string} | ||
* @exportDoc | ||
*/ | ||
@@ -156,2 +170,3 @@ shakaExtern.Cue.prototype.payload; | ||
* @type {shakaExtern.CueRegion} | ||
* @exportDoc | ||
*/ | ||
@@ -165,2 +180,3 @@ shakaExtern.Cue.prototype.region; | ||
* @type {?number} | ||
* @exportDoc | ||
*/ | ||
@@ -173,2 +189,3 @@ shakaExtern.Cue.prototype.position; | ||
* @type {shaka.text.Cue.positionAlign} | ||
* @exportDoc | ||
*/ | ||
@@ -181,2 +198,3 @@ shakaExtern.Cue.prototype.positionAlign; | ||
* @type {number} | ||
* @exportDoc | ||
*/ | ||
@@ -189,2 +207,3 @@ shakaExtern.Cue.prototype.size; | ||
* @type {shaka.text.Cue.textAlign} | ||
* @exportDoc | ||
*/ | ||
@@ -197,2 +216,3 @@ shakaExtern.Cue.prototype.textAlign; | ||
* @type {shaka.text.Cue.writingDirection} | ||
* @exportDoc | ||
*/ | ||
@@ -206,2 +226,3 @@ shakaExtern.Cue.prototype.writingDirection; | ||
* @type {shaka.text.Cue.lineInterpretation} | ||
* @exportDoc | ||
*/ | ||
@@ -215,2 +236,3 @@ shakaExtern.Cue.prototype.lineInterpretation; | ||
* @type {?number} | ||
* @exportDoc | ||
*/ | ||
@@ -225,2 +247,3 @@ shakaExtern.Cue.prototype.line; | ||
* @type {string}. | ||
* @exportDoc | ||
*/ | ||
@@ -233,2 +256,3 @@ shakaExtern.Cue.prototype.lineHeight; | ||
* @type {shaka.text.Cue.lineAlign} | ||
* @exportDoc | ||
*/ | ||
@@ -241,2 +265,3 @@ shakaExtern.Cue.prototype.lineAlign; | ||
* @type {shaka.text.Cue.displayAlign} | ||
* @exportDoc | ||
*/ | ||
@@ -250,2 +275,3 @@ shakaExtern.Cue.prototype.displayAlign; | ||
* @type {!string} | ||
* @exportDoc | ||
*/ | ||
@@ -260,2 +286,3 @@ shakaExtern.Cue.prototype.color; | ||
* @type {!string} | ||
* @exportDoc | ||
*/ | ||
@@ -268,2 +295,3 @@ shakaExtern.Cue.prototype.backgroundColor; | ||
* @type {string} | ||
* @exportDoc | ||
*/ | ||
@@ -276,2 +304,3 @@ shakaExtern.Cue.prototype.fontSize; | ||
* @type {shaka.text.Cue.fontWeight} | ||
* @exportDoc | ||
*/ | ||
@@ -284,2 +313,3 @@ shakaExtern.Cue.prototype.fontWeight; | ||
* @type {shaka.text.Cue.fontStyle} | ||
* @exportDoc | ||
*/ | ||
@@ -292,2 +322,3 @@ shakaExtern.Cue.prototype.fontStyle; | ||
* @type {!string} | ||
* @exportDoc | ||
*/ | ||
@@ -301,2 +332,3 @@ shakaExtern.Cue.prototype.fontFamily; | ||
* @type {!Array.<!shaka.text.Cue.textDecoration>} | ||
* @exportDoc | ||
*/ | ||
@@ -309,2 +341,3 @@ shakaExtern.Cue.prototype.textDecoration; | ||
* @type {boolean} | ||
* @exportDoc | ||
*/ | ||
@@ -317,2 +350,3 @@ shakaExtern.Cue.prototype.wrapLine; | ||
* @type {!string} | ||
* @exportDoc | ||
*/ | ||
@@ -383,2 +417,3 @@ shakaExtern.Cue.prototype.id; | ||
* @typedef {function(new:shakaExtern.TextParser)} | ||
* @exportDoc | ||
*/ | ||
@@ -385,0 +420,0 @@ shakaExtern.TextParserPlugin; |
@@ -149,2 +149,3 @@ /** | ||
browserNoActivityTimeout: 5 * 60 * 1000, // disconnect after 5m silence | ||
processKillTimeout: 5 * 1000, // allow up to 5s for process to shut down | ||
captureTimeout: settings.capture_timeout, | ||
@@ -151,0 +152,0 @@ // https://support.saucelabs.com/customer/en/portal/articles/2440724 |
@@ -184,2 +184,8 @@ /** | ||
MapUtils.values(keySystems) | ||
.filter(function(keySystem) { | ||
// If the manifest doesn't specify any key systems, we shouldn't | ||
// put clearkey in this list. Otherwise, it may be triggered when | ||
// a real key system should be used instead. | ||
return keySystem != 'org.w3.clearkey'; | ||
}) | ||
.map(function(keySystem) { | ||
@@ -186,0 +192,0 @@ return ManifestParserUtils.createDrmInfo(keySystem, defaultInit); |
@@ -155,3 +155,3 @@ /** | ||
* Called when an error occurs. If the error is recoverable (see | ||
* @link{shaka.util.Error}) then the caller may invoke either | ||
* {@link shaka.util.Error}) then the caller may invoke either | ||
* StreamingEngine.switch*() or StreamingEngine.seeked() to attempt recovery. | ||
@@ -254,2 +254,10 @@ * @property {function(!Object.<string,string>)} onKeyStatus | ||
// If initial manifest contains unencrypted content, drm configuration | ||
// overrides DrmInfo so drmEngine can be activated. Thus, the player can play | ||
// encrypted content if live stream switches from unencrypted content to | ||
// encrypted content during live streams. | ||
let isEncryptedContent = manifest.periods.some((period) => { | ||
return period.variants.some((variant) => variant.drmInfos.length); | ||
}); | ||
// |isOffline_| determines what kind of session to create. The argument to | ||
@@ -270,3 +278,4 @@ // |prepareMediaKeyConfigs_| determines the kind of CDM to query for. So | ||
return this.queryMediaKeys_(configsByKeySystem, keySystemsInOrder); | ||
return this.queryMediaKeys_( | ||
configsByKeySystem, keySystemsInOrder, isEncryptedContent); | ||
}; | ||
@@ -568,2 +577,4 @@ | ||
* a real preference for the application. | ||
* @param {boolean} isEncryptedContent | ||
* True if the content is encrypted, false otherwise. | ||
* @return {!Promise} Resolved if/when a key system has been chosen. | ||
@@ -573,3 +584,3 @@ * @private | ||
shaka.media.DrmEngine.prototype.queryMediaKeys_ = | ||
function(configsByKeySystem, keySystemsInOrder) { | ||
function(configsByKeySystem, keySystemsInOrder, isEncryptedContent) { | ||
if (keySystemsInOrder.length == 1 && keySystemsInOrder[0] == '') { | ||
@@ -682,2 +693,8 @@ return Promise.reject(new shaka.util.Error( | ||
if (!isEncryptedContent) { | ||
// It doesn't matter if we fail to initialize the drm engine, if we won't | ||
// actually need it anyway. | ||
p = p.catch(() => {}); | ||
} | ||
instigator.reject(); | ||
@@ -684,0 +701,0 @@ return p; |
@@ -70,2 +70,5 @@ /** | ||
/** @private {?number} */ | ||
this.lastCorrectiveSeek_; | ||
/** @private {shaka.media.GapJumpingController} */ | ||
@@ -275,4 +278,11 @@ this.gapController_ = | ||
if (Math.abs(targetTime - currentTime) > gapLimit) { | ||
this.videoWrapper_.setTime(targetTime); | ||
return; | ||
// You can only seek like this every so often. This is to prevent an | ||
// infinite loop on systems where changing currentTime takes a significant | ||
// amount of time (e.g. Chromecast). | ||
let time = new Date().getTime() / 1000; | ||
if (!this.lastCorrectiveSeek_ || this.lastCorrectiveSeek_ < time - 1) { | ||
this.lastCorrectiveSeek_ = time; | ||
this.videoWrapper_.setTime(targetTime); | ||
return; | ||
} | ||
} | ||
@@ -279,0 +289,0 @@ |
@@ -197,3 +197,4 @@ /** | ||
if (this.bufferStart_ == null) { | ||
this.bufferStart_ = Math.max(startTime, this.appendWindowStart_); | ||
this.bufferStart_ = | ||
Math.max(startTime + this.timestampOffset_, this.appendWindowStart_); | ||
} else { | ||
@@ -205,3 +206,4 @@ // We already had something in buffer, and we assume we are extending the | ||
} | ||
this.bufferEnd_ = Math.min(endTime, this.appendWindowEnd_); | ||
this.bufferEnd_ = | ||
Math.min(endTime + this.timestampOffset_, this.appendWindowEnd_); | ||
}.bind(this)); | ||
@@ -208,0 +210,0 @@ }; |
@@ -80,4 +80,5 @@ /** | ||
isValid = isValid && shaka.util.ConfigUtils.mergeConfigObjects( | ||
let subMergeValid = shaka.util.ConfigUtils.mergeConfigObjects( | ||
destination[k], source[k], subTemplate, overrides, subPath); | ||
isValid = isValid && subMergeValid; | ||
} else if (typeof source[k] != typeof subTemplate || | ||
@@ -84,0 +85,0 @@ source[k] == null || |
{ | ||
"name": "shaka-player", | ||
"description": "DASH/EME video player library", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"homepage": "https://github.com/google/shaka-player", | ||
@@ -6,0 +6,0 @@ "author": "Google", |
@@ -90,2 +90,3 @@ # ![Shaka Player](docs/shaka-player-logo.png) | ||
- WebVTT and TTML | ||
- CEA-608/708 captions | ||
@@ -97,3 +98,2 @@ HLS features **not** supported: | ||
- I-frame-only playlists: https://github.com/google/shaka-player/issues/742 | ||
- CEA-608/708 captions: https://github.com/google/shaka-player/issues/276 | ||
- Raw AAC (without an MP4 container): https://github.com/google/shaka-player/issues/1083 | ||
@@ -100,0 +100,0 @@ |
@@ -373,3 +373,2 @@ /** | ||
[ | ||
buildDrmInfo('org.w3.clearkey', keyIds), | ||
buildDrmInfo('com.widevine.alpha', keyIds), | ||
@@ -376,0 +375,0 @@ buildDrmInfo('com.microsoft.playready', keyIds), |
@@ -177,2 +177,9 @@ /** | ||
function setMockDate(seconds) { | ||
let minutes = Math.floor(seconds / 60); | ||
seconds = seconds % 60; | ||
let mockDate = new Date(2013, 9, 23, 7, minutes, seconds); | ||
jasmine.clock().mockDate(mockDate); | ||
} | ||
describe('getTime', function() { | ||
@@ -391,2 +398,5 @@ it('returns current time when the video is paused', function() { | ||
// This has to periodically increment the mock date to allow the onSeeking_ | ||
// handler to seek, if appropriate. | ||
// Calling on['seeking']() is like dispatching a 'seeking' event. So, each | ||
@@ -396,2 +406,3 @@ // time we change the video's current time or Playhead changes the video's | ||
setMockDate(0); | ||
video.on['seeking'](); | ||
@@ -405,2 +416,3 @@ expect(video.currentTime).toBe(5); | ||
// Seek in safe region & in buffered region. | ||
setMockDate(10); | ||
video.currentTime = 26; | ||
@@ -415,2 +427,3 @@ video.on['seeking'](); | ||
// Seek in safe region & in unbuffered region. | ||
setMockDate(20); | ||
video.currentTime = 24; | ||
@@ -425,2 +438,3 @@ video.on['seeking'](); | ||
// Seek before start, start is unbuffered. | ||
setMockDate(30); | ||
video.currentTime = 1; | ||
@@ -431,2 +445,3 @@ video.on['seeking'](); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
setMockDate(40); | ||
video.on['seeking'](); | ||
@@ -440,2 +455,3 @@ expect(onSeek).toHaveBeenCalled(); | ||
// Seek outside safe region & in buffered region. | ||
setMockDate(50); | ||
video.currentTime = 11; | ||
@@ -450,2 +466,3 @@ video.on['seeking'](); | ||
// Seek outside safe region & in unbuffered region. | ||
setMockDate(60); | ||
video.currentTime = 9; | ||
@@ -456,2 +473,3 @@ video.on['seeking'](); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
setMockDate(70); | ||
video.on['seeking'](); | ||
@@ -463,2 +481,3 @@ expect(onSeek).toHaveBeenCalled(); | ||
// Seek past end. | ||
setMockDate(80); | ||
video.currentTime = 120; | ||
@@ -469,2 +488,3 @@ video.on['seeking'](); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
setMockDate(90); | ||
video.on['seeking'](); | ||
@@ -476,2 +496,3 @@ expect(onSeek).toHaveBeenCalled(); | ||
// Seek before start, start is buffered. | ||
setMockDate(100); | ||
video.currentTime = 1; | ||
@@ -482,2 +503,3 @@ video.on['seeking'](); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
setMockDate(110); | ||
video.on['seeking'](); | ||
@@ -493,2 +515,3 @@ expect(onSeek).toHaveBeenCalled(); | ||
// Seek before start | ||
setMockDate(120); | ||
video.currentTime = 4; | ||
@@ -499,2 +522,3 @@ video.on['seeking'](); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
setMockDate(130); | ||
video.on['seeking'](); | ||
@@ -506,2 +530,3 @@ expect(onSeek).toHaveBeenCalled(); | ||
// Seek in window. | ||
setMockDate(140); | ||
video.currentTime = 8; | ||
@@ -512,2 +537,3 @@ video.on['seeking'](); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
setMockDate(150); | ||
video.on['seeking'](); | ||
@@ -519,2 +545,3 @@ expect(onSeek).toHaveBeenCalled(); | ||
// Seek past end. | ||
setMockDate(160); | ||
video.currentTime = 13; | ||
@@ -525,2 +552,3 @@ video.on['seeking'](); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
setMockDate(170); | ||
video.on['seeking'](); | ||
@@ -549,2 +577,3 @@ expect(onSeek).toHaveBeenCalled(); | ||
setMockDate(0); | ||
video.on['seeking'](); | ||
@@ -555,2 +584,3 @@ expect(video.currentTime).toBe(5); | ||
// Seek past end. | ||
setMockDate(10); | ||
video.currentTime = 120; | ||
@@ -561,2 +591,3 @@ video.on['seeking'](); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
setMockDate(20); | ||
video.on['seeking'](); | ||
@@ -568,2 +599,3 @@ expect(onSeek).toHaveBeenCalled(); | ||
// Seek before start. | ||
setMockDate(30); | ||
video.currentTime = 1; | ||
@@ -574,2 +606,3 @@ video.on['seeking'](); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
setMockDate(40); | ||
video.on['seeking'](); | ||
@@ -579,2 +612,54 @@ expect(onSeek).toHaveBeenCalled(); | ||
it('doesn\'t repeatedly re-seek', function() { | ||
video.readyState = HTMLMediaElement.HAVE_METADATA; | ||
video.buffered = createFakeBuffered([{start: 25, end: 55}]); | ||
timeline.isLive.and.returnValue(false); | ||
timeline.getSeekRangeStart.and.returnValue(5); | ||
timeline.getSafeSeekRangeStart.and.returnValue(5); | ||
timeline.getSeekRangeEnd.and.returnValue(60); | ||
timeline.getDuration.and.returnValue(60); | ||
playhead = new shaka.media.Playhead( | ||
video, | ||
manifest, | ||
config, | ||
5 /* startTime */, | ||
Util.spyFunc(onSeek), | ||
Util.spyFunc(onEvent)); | ||
// First, seek to start time. | ||
video.currentTime = 0; | ||
video.on['seeking'](); | ||
// The first time, it should re-seek without issue. | ||
setMockDate(0); | ||
video.currentTime = 0; | ||
video.on['seeking'](); | ||
expect(video.currentTime).toBe(5); | ||
expect(playhead.getTime()).toBe(5); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
onSeek.calls.reset(); | ||
// No time passes, so it shouldn't be willing to re-seek. | ||
video.currentTime = 0; | ||
video.on['seeking'](); | ||
expect(video.currentTime).toBe(0); | ||
// The playhead wanted to seek ahead to 5, but was unable to. | ||
expect(playhead.getTime()).toBe(5); | ||
expect(onSeek).toHaveBeenCalled(); | ||
onSeek.calls.reset(); | ||
// Wait 10 seconds, so it should be willing to re-seek. | ||
setMockDate(10); | ||
video.currentTime = 0; | ||
video.on['seeking'](); | ||
expect(video.currentTime).toBe(5); | ||
expect(playhead.getTime()).toBe(5); | ||
expect(onSeek).not.toHaveBeenCalled(); | ||
}); // doesn't repeatedly re-seek | ||
it('handles live manifests with no seek range', function() { | ||
@@ -581,0 +666,0 @@ video.buffered = createFakeBuffered([{start: 1000, end: 1030}]); |
@@ -242,2 +242,13 @@ /** | ||
}); | ||
it('handles timestamp offset', async function() { | ||
textEngine.setTimestampOffset(60); | ||
await textEngine.appendBuffer(dummyData, 0, 3); | ||
expect(textEngine.bufferStart()).toBe(60); | ||
expect(textEngine.bufferEnd()).toBe(63); | ||
await textEngine.appendBuffer(dummyData, 3, 6); | ||
expect(textEngine.bufferStart()).toBe(60); | ||
expect(textEngine.bufferEnd()).toBe(66); | ||
}); | ||
}); | ||
@@ -275,2 +286,8 @@ | ||
}); | ||
it('handles timestamp offset', async function() { | ||
textEngine.setTimestampOffset(60); | ||
await textEngine.appendBuffer(dummyData, 3, 6); | ||
expect(textEngine.bufferedAheadOf(64)).toBe(2); | ||
}); | ||
}); | ||
@@ -277,0 +294,0 @@ |
closure/compiler.jar | ||
The closure compiler, v20180402 (modified), by Google. | ||
The closure compiler, v20180402, by Google. | ||
Apache v2.0 license. | ||
https://github.com/google/closure-compiler | ||
Local mods: | ||
- Fixed issues with Symbol polyfill interactions with output wrappers | ||
- https://github.com/google/closure-compiler/issues/2957 | ||
@@ -9,0 +6,0 @@ closure/goog |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
422
93018
16492672