Socket
Socket
Sign inDemoInstall

shaka-player

Package Overview
Dependencies
Maintainers
3
Versions
327
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shaka-player - npm Package Compare versions

Comparing version 2.0.6 to 2.0.7

docs/tutorials/service-worker.md

23

CHANGELOG.md

@@ -0,1 +1,24 @@

## 2.0.7 (2017-03-29)
New Features:
- Improved keyboard navigation in demo page for accessibility
- Play through small gaps at the start of the timeline
- Add a method for accessing the HTMLMediaElement from the Player
- https://github.com/google/shaka-player/pull/723
- Improved error reporting for HTTP errors
Bugfixes:
- Fixed a DASH compliance bug in SegmentList w/ presentationTimeOffset
- Fixed compiler renaming in emsg events.
- https://github.com/google/shaka-player/issues/717
- Fix period transitions where text streams may be absent
- https://github.com/google/shaka-player/issues/715
- Fix Firefox DRM detection
- Fix cleanup of expired EME sessions for offline
- Fix demo app error thrown when offline is not supported
- Fix infinite loop in offline storage of SegmentTemplate-based DASH
- https://github.com/google/shaka-player/issues/739
- Fix contamination between tests
## 2.0.6 (2017-02-24)

@@ -2,0 +25,0 @@

@@ -18,3 +18,10 @@ /**

/**
* @fileoverview Shaka Player demo, main section.
*
* @suppress {visibility} to work around compiler errors until we can
* refactor the demo into classes that talk via public method. TODO
*/
/** @suppress {duplicate} */

@@ -160,2 +167,7 @@ var shakaDemo = shakaDemo || {};

// TODO: document demo app debugging features
if (window.debugConfig) {
player.configure(window.debugConfig);
}
return asset;

@@ -162,0 +174,0 @@ };

@@ -18,3 +18,10 @@ /**

/**
* @fileoverview Shaka Player demo, main section.
*
* @suppress {visibility} to work around compiler errors until we can
* refactor the demo into classes that talk via public method. TODO
*/
/** @suppress {duplicate} */

@@ -21,0 +28,0 @@ var shakaDemo = shakaDemo || {};

159

demo/controls.js

@@ -90,2 +90,5 @@ /**

/** @private {boolean} */
this.isKeyboardSeeking_ = false;
/** @private {number} */

@@ -164,2 +167,20 @@ this.trickPlayRate_ = 1;

// Listen to events to handle custom border highlighting, and implement a
// keyboard trap.
// This needs to be on the document body to allow the keyboard trap to detect
// focusing on external elements.
// Because of event bubbling, these will implicitly listen to child elements.
document.body.addEventListener(
'focus', this.onFocus_.bind(this), true /* capture phase */);
// Also add an event listener for blurs, to handle the case where the user
// clicks on a non-focusable element to un-select the focused element.
document.body.addEventListener(
'blur', this.onBlur_.bind(this), true /* capture phase */);
// Also add an event listener to the video container for keyboard events,
// to detect when the user is interacting with input bars (volume, etc)
// to prevent the controls from going opaque while being used.
this.videoContainer_.addEventListener(
sliderInputEvent, this.onContainerInput_.bind(this));
this.fullscreenButton_.addEventListener(

@@ -237,2 +258,6 @@ 'click', this.onFullscreenClick_.bind(this));

this.onPlayStateChange_();
// The currentTime button should be disabled when not viewing a livestream.
var isVod = !this.player_.isLive();
this.currentTime_.disabled = isVod;
};

@@ -245,8 +270,7 @@

* in and out of fullscreen mode.
* @param {!Event} event
* @param {boolean} isTouch
* @private
*/
ShakaControls.prototype.onMouseMove_ = function(event) {
if (event.type == 'touchstart' || event.type == 'touchmove' ||
event.type == 'touchend') {
ShakaControls.prototype.makeControlsOpaque_ = function(isTouch) {
if (isTouch) {
this.lastTouchEventTime_ = Date.now();

@@ -264,2 +288,8 @@ } else if (this.lastTouchEventTime_ + 1000 < Date.now()) {

this.startMouseStillTimeout_();
};
/** @private */
ShakaControls.prototype.startMouseStillTimeout_ = function() {
// Hide the cursor when the mouse stops moving.

@@ -272,6 +302,38 @@ // Only applies while the cursor is over the video container.

// Only start a timeout on 'touchend' or for 'mousemove' with no touch events.
if (event.type == 'touchend' || !this.lastTouchEventTime_) {
this.mouseStillTimeoutId_ = window.setTimeout(
this.onMouseStill_.bind(this), 3000);
this.mouseStillTimeoutId_ = window.setTimeout(
this.onMouseStill_.bind(this), 3000);
};
/**
* @param {!Event} event
* @private
*/
ShakaControls.prototype.onMouseMove_ = function(event) {
this.makeControlsOpaque_(event.type == 'touchstart' ||
event.type == 'touchmove' ||
event.type == 'touchend');
};
/** @private */
ShakaControls.prototype.onContainerInput_ = function() {
// This event listener isn't on the document, so there's no need
// to check to see if the controls have focus.
this.makeControlsOpaque_(false /* isTouch */);
};
/**
* @param {!Event} event
* @private
*/
ShakaControls.prototype.onBlur_ = function(event) {
// The relatedTarget field contains the element that will be focused,
// if this element is blurring before a focus.
if (!event.relatedTarget) {
// The selected element is being unselected, so immediately try to blur.
// If, for example, an one of the controls are selected and the user
// clicks on the background.
this.onMouseStill_();
}

@@ -281,2 +343,42 @@ };

/**
* @param {!Event} event
* @private
*/
ShakaControls.prototype.onFocus_ = function(event) {
// Focus changing into the controls counts as a touch event
// no matter what the source is (keyboard, mouse, etc)
if (this.controlsHaveFocus_()) {
this.makeControlsOpaque_(false /* isTouch */);
} else {
// Start the timeout without making controls opaque,
// in case (for instance) you focused out of the controls.
this.startMouseStillTimeout_();
}
if (document.fullscreenElement && !this.controlsHaveFocus_()) {
// When fullscreen, trap the focus inside the controls.
// The relatedTarget field contains the previously focused element.
if (event.relatedTarget == this.playPauseButton_) {
// They focused out going left, so wrap around to the right.
this.fullscreenButton_.focus();
} else {
// They focused out going right, or have just focused,
// so start on the left.
this.playPauseButton_.focus();
}
}
};
/**
* @return {boolean}
* @private
*/
ShakaControls.prototype.controlsHaveFocus_ = function() {
return (this.videoContainer_.contains(document.activeElement));
};
/** @private */

@@ -301,6 +403,11 @@ ShakaControls.prototype.onMouseOut_ = function() {

this.videoContainer_.style.cursor = 'none';
// Revert opacity control to CSS. Hovering directly over the controls will
// keep them showing, even in fullscreen mode. Unless there were touch events,
// then override the hover and hide the controls.
this.controls_.style.opacity = this.lastTouchEventTime_ ? '0' : '';
// The controls shouldn't fade when selected,
// unless the video is fullscreen.
if (!this.controlsHaveFocus_() || document.fullscreenElement) {
// Revert opacity control to CSS. Hovering directly over the controls will
// keep them showing, even in fullscreen mode. Unless there were touch
// events, then override the hover and hide the controls.
this.controls_.style.opacity = this.lastTouchEventTime_ ? '0' : '';
}
};

@@ -366,2 +473,3 @@

this.isSeeking_ = true;
this.isKeyboardSeeking_ = false;
this.video_.pause();

@@ -373,2 +481,9 @@ };

ShakaControls.prototype.onSeekInput_ = function() {
if (!this.isSeeking_) {
// The seek was initialized by non-mouse/touchpad
// input, so onSeekStart_ wasn't called. Call it now.
this.onSeekStart_();
this.isKeyboardSeeking_ = true;
}
if (!this.video_.duration) {

@@ -387,3 +502,4 @@ // Can't seek yet. Ignore.

this.seekTimeoutId_ = window.setTimeout(
this.onSeekInputTimeout_.bind(this), 125);
this.onSeekInputTimeout_.bind(this),
this.isKeyboardSeeking_ ? 500 : 125);
};

@@ -396,2 +512,8 @@

this.video_.currentTime = parseFloat(this.seekBar_.value);
if (this.isKeyboardSeeking_) {
// Users who are seeking via keyboard have no way of manually ending
// the seek process, so timing out also causes the seek to end.
this.onSeekEnd_();
}
};

@@ -424,2 +546,5 @@

ShakaControls.prototype.onVolumeStateChange_ = function() {
// The volume bar goes from 0 to 100 while the volume variable goes from
// 0 to 1 because the input range implementation of IE and Edge doesn't
// work well with input ranges that go from 0 to 1.
if (this.video_.muted) {

@@ -430,8 +555,8 @@ this.muteButton_.textContent = 'volume_off';

this.muteButton_.textContent = 'volume_up';
this.volumeBar_.value = this.video_.volume;
this.volumeBar_.value = this.video_.volume * 100;
}
var gradient = ['to right'];
gradient.push('#ccc ' + (this.volumeBar_.value * 100) + '%');
gradient.push('#000 ' + (this.volumeBar_.value * 100) + '%');
gradient.push('#ccc ' + (this.volumeBar_.value) + '%');
gradient.push('#000 ' + (this.volumeBar_.value) + '%');
gradient.push('#000 100%');

@@ -445,3 +570,3 @@ this.volumeBar_.style.background =

ShakaControls.prototype.onVolumeInput_ = function() {
this.video_.volume = parseFloat(this.volumeBar_.value);
this.video_.volume = parseFloat(this.volumeBar_.value) / 100;
this.video_.muted = false;

@@ -448,0 +573,0 @@ };

@@ -18,3 +18,10 @@ /**

/**
* @fileoverview Shaka Player demo, main section.
*
* @suppress {visibility} to work around compiler errors until we can
* refactor the demo into classes that talk via public method. TODO
*/
/** @suppress {duplicate} */

@@ -21,0 +28,0 @@ var shakaDemo = shakaDemo || {};

@@ -18,3 +18,10 @@ /**

/**
* @fileoverview Shaka Player demo, main section.
*
* @suppress {visibility} to work around compiler errors until we can
* refactor the demo into classes that talk via public method. TODO
*/
/** @suppress {duplicate} */

@@ -21,0 +28,0 @@ var shakaDemo = shakaDemo || {};

@@ -18,3 +18,10 @@ /**

/**
* @fileoverview Shaka Player demo, main section.
*
* @suppress {visibility} to work around compiler errors until we can
* refactor the demo into classes that talk via public method. TODO
*/
/** @suppress {duplicate} */

@@ -48,2 +55,6 @@ var shakaDemo = shakaDemo || {};

/** @private {?number} */
shakaDemo.lastMousePressTime_ = null;
/**

@@ -112,2 +123,11 @@ * The registered ID of the v2 Chromecast receiver demo.

// Listen to events to automatically blur elements focused by mouse input.
// This is to prevent the borders from showing up when not needed, as they
// are distracting for the user (not to mention fairly ugly).
// Because of event bubbling, this will implicitly listen to child elements.
document.body.addEventListener(
'focus', shakaDemo.onFocus_.bind(shakaDemo), true /* capture phase */);
document.body.addEventListener(
'mousedown', shakaDemo.onMouseDown_.bind(shakaDemo));
if (!shaka.Player.isBrowserSupported()) {

@@ -188,2 +208,38 @@ var errorDisplayLink = document.getElementById('errorDisplayLink');

/**
* @param {!Event} event
* @private
*/
shakaDemo.onFocus_ = function(event) {
if (shakaDemo.lastMousePressTime_ > Date.now() - 10) {
// We don't want control elements to stay selected when clicked on
// because the selection borders are ugly and should only be shown
// when actually necessary (i.e. keyboard navigation).
if (document.activeElement.type != 'text') {
document.activeElement.blur();
}
}
};
/**
* @param {!Event} event
* @private
*/
shakaDemo.onMouseDown_ = function(event) {
shakaDemo.lastMousePressTime_ = Date.now();
if (document.activeElement) {
// There's something selected already, perhaps due to
// switching from keyboard controls to mouse controls.
// Un-select that thing.
// Otherwise, clicking on a focused element won't un-focus
// it, since clicking on a focused element doesn't issue a
// focus event.
document.activeElement.blur();
}
};
/**
* @param {!Event} event

@@ -190,0 +246,0 @@ * @private

@@ -18,3 +18,10 @@ /**

/**
* @fileoverview Shaka Player demo, main section.
*
* @suppress {visibility} to work around compiler errors until we can
* refactor the demo into classes that talk via public method. TODO
*/
/** @suppress {duplicate} */

@@ -205,2 +212,7 @@ var shakaDemo = shakaDemo || {};

shakaDemo.onCastStatusChange_ = function(connected) {
if (!shakaDemo.offlineOptGroup_) {
// No offline support.
return;
}
// When we are casting, offline assets become unavailable.

@@ -207,0 +219,0 @@ shakaDemo.offlineOptGroup_.disabled = connected;

605

dist/shaka-player.compiled.externs.js

@@ -11,4 +11,12 @@ /**

/** @const */
shaka.offline = {};
/** @const */
shaka.polyfill = {};
/** @const */
shaka.media.TextEngine = {};
/** @const */
shaka.util = {};
/** @const */
shaka.net = {};
/** @const */
shaka.cast = {};

@@ -21,21 +29,33 @@ /** @const */

shaka.media.ManifestParser = {};
/** @const */
shaka.net = {};
/** @const */
shaka.util = {};
/** @const */
shaka.offline = {};
/** @const */
shaka.polyfill = {};
/**
* Install all polyfills.
* An interface to standardize how objects are destroyed.
* @interface
*/
shaka.polyfill.installAll = function() {};
shaka.util.IDestroyable = function() {};
/**
* Registers a new polyfill to be installed.
* @param {function()} polyfill
* Destroys the object, releasing all resources and shutting down all
* operations. Returns a Promise which is resolved when destruction is
* complete. This Promise should never be rejected.
* @return {!Promise}
*/
shaka.polyfill.register = function(polyfill) {};
shaka.util.IDestroyable.prototype.destroy = function() {};
/**
* @param {string} mimeType
* @param {shakaExtern.TextParserPlugin} parser
*/
shaka.media.TextEngine.registerParser = function(mimeType, parser) {};
/**
* @param {string} mimeType
*/
shaka.media.TextEngine.unregisterParser = function(mimeType) {};
/**
* Creates a cue using the best platform-specific interface available.
* @param {number} startTime
* @param {number} endTime
* @param {string} payload
* @return {TextTrackCue} or null if the parameters were invalid.
*/
shaka.media.TextEngine.makeCue = function(startTime, endTime, payload) {};
/**
* Creates a new Error.

@@ -159,130 +179,2 @@ * @param {shaka.util.Error.Category} category

/**
* An interface to standardize how objects are destroyed.
* @interface
*/
shaka.util.IDestroyable = function() {};
/**
* Destroys the object, releasing all resources and shutting down all
* operations. Returns a Promise which is resolved when destruction is
* complete. This Promise should never be rejected.
* @return {!Promise}
*/
shaka.util.IDestroyable.prototype.destroy = function() {};
/**
* @param {string} mimeType
* @param {shakaExtern.TextParserPlugin} parser
*/
shaka.media.TextEngine.registerParser = function(mimeType, parser) {};
/**
* @param {string} mimeType
*/
shaka.media.TextEngine.unregisterParser = function(mimeType) {};
/**
* Creates a cue using the best platform-specific interface available.
* @param {number} startTime
* @param {number} endTime
* @param {string} payload
* @return {TextTrackCue} or null if the parameters were invalid.
*/
shaka.media.TextEngine.makeCue = function(startTime, endTime, payload) {};
/**
* A work-alike for EventTarget. Only DOM elements may be true EventTargets,
* but this can be used as a base class to provide event dispatch to non-DOM
* classes. Only FakeEvents should be dispatched.
* @struct
* @constructor
* @implements {EventTarget}
*/
shaka.util.FakeEventTarget = function() {};
/**
* These are the listener types defined in the closure extern for EventTarget.
* @typedef {EventListener|function(!Event):(boolean|undefined)}
*/
shaka.util.FakeEventTarget.ListenerType;
/**
* Add an event listener to this object.
* @param {string} type The event type to listen for.
* @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or
* listener object to invoke.
* @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have
* parents, so events neither capture nor bubble.
* @override
*/
shaka.util.FakeEventTarget.prototype.addEventListener = function(type, listener, opt_capturing) {};
/**
* Remove an event listener from this object.
* @param {string} type The event type for which you wish to remove a listener.
* @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or
* listener object to remove.
* @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have
* parents, so events neither capture nor bubble.
* @override
*/
shaka.util.FakeEventTarget.prototype.removeEventListener = function(type, listener, opt_capturing) {};
/**
* Dispatch an event from this object.
* @param {!Event} event The event to be dispatched from this object.
* @return {boolean} True if the default action was prevented.
* @override
*/
shaka.util.FakeEventTarget.prototype.dispatchEvent = function(event) {};
/**
* A proxy to switch between local and remote playback for Chromecast in a way
* that is transparent to the app's controls.
* @constructor
* @struct
* @param {!HTMLMediaElement} video The local video element associated with the
* local Player instance.
* @param {!shaka.Player} player A local Player instance.
* @param {string} receiverAppId The ID of the cast receiver application.
* @implements {shaka.util.IDestroyable}
* @extends {shaka.util.FakeEventTarget}
*/
shaka.cast.CastProxy = function(video, player, receiverAppId) {};
/**
* Destroys the proxy and the underlying local Player.
* @override
*/
shaka.cast.CastProxy.prototype.destroy = function() {};
/**
* Get a proxy for the video element that delegates to local and remote video
* elements as appropriate.
* @suppress {invalidCasts} to cast proxy Objects to unrelated types
* @return {HTMLMediaElement}
*/
shaka.cast.CastProxy.prototype.getVideo = function() {};
/**
* Get a proxy for the Player that delegates to local and remote Player objects
* as appropriate.
* @suppress {invalidCasts} to cast proxy Objects to unrelated types
* @return {shaka.Player}
*/
shaka.cast.CastProxy.prototype.getPlayer = function() {};
/**
* @return {boolean} True if the cast API is available and there are receivers.
*/
shaka.cast.CastProxy.prototype.canCast = function() {};
/**
* @return {boolean} True if we are currently casting.
*/
shaka.cast.CastProxy.prototype.isCasting = function() {};
/**
* @return {string} The name of the Cast receiver device, if isCasting().
*/
shaka.cast.CastProxy.prototype.receiverName = function() {};
/**
* @return {!Promise} Resolved when connected to a receiver. Rejected if the
* connection fails or is canceled by the user.
*/
shaka.cast.CastProxy.prototype.cast = function() {};
/**
* Set application-specific data.
* @param {Object} appData Application-specific data to relay to the receiver.
*/
shaka.cast.CastProxy.prototype.setAppData = function(appData) {};
/**
* Show a dialog where user can choose to disconnect from the cast connection.
*/
shaka.cast.CastProxy.prototype.suggestDisconnect = function() {};
/**
* Creates an InitSegmentReference, which provides the location to an

@@ -436,2 +328,41 @@ * initialization segment.

/**
* Creates a new SimpleAbrManager.
* @constructor
* @struct
* @implements {shakaExtern.AbrManager}
*/
shaka.abr.SimpleAbrManager = function() {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.stop = function() {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.init = function(switchCallback) {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.chooseStreams = function(streamSetsByType) {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.enable = function() {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.disable = function() {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.segmentDownloaded = function(startTimeMs, endTimeMs, numBytes) {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate = function() {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.setDefaultEstimate = function(estimate) {};
/**
* NetworkingEngine wraps all networking operations. This accepts plugins that

@@ -529,87 +460,43 @@ * handle the actual request. A plugin is registered using registerScheme.

/**
* Creates a SegmentIndex.
* @param {!Array.<!shaka.media.SegmentReference>} references The list of
* SegmentReferences, which must be sorted first by their start times
* (ascending) and second by their end times (ascending), and have
* continuous, increasing positions.
* @constructor
* A work-alike for EventTarget. Only DOM elements may be true EventTargets,
* but this can be used as a base class to provide event dispatch to non-DOM
* classes. Only FakeEvents should be dispatched.
* @struct
* @implements {shaka.util.IDestroyable}
*/
shaka.media.SegmentIndex = function(references) {};
/**
* @override
*/
shaka.media.SegmentIndex.prototype.destroy = function() {};
/**
* Finds the position of the segment for the given time, in seconds, relative
* to the start of a particular Period. Returns the position of the segment
* with the largest end time if more than one segment is known for the given
* time.
* @param {number} time
* @return {?number} The position of the segment, or null
* if the position of the segment could not be determined.
*/
shaka.media.SegmentIndex.prototype.find = function(time) {};
/**
* Gets the SegmentReference for the segment at the given position.
* @param {number} position The position of the segment.
* @return {shaka.media.SegmentReference} The SegmentReference, or null if
* no such SegmentReference exists.
*/
shaka.media.SegmentIndex.prototype.get = function(position) {};
/**
* Merges the given SegmentReferences. Supports extending the original
* references only. Will not replace old references or interleave new ones.
* @param {!Array.<!shaka.media.SegmentReference>} references The list of
* SegmentReferences, which must be sorted first by their start times
* (ascending) and second by their end times (ascending), and have
* continuous, increasing positions.
*/
shaka.media.SegmentIndex.prototype.merge = function(references) {};
/**
* Removes all SegmentReferences that end before the given time.
* @param {number} time The time in seconds.
*/
shaka.media.SegmentIndex.prototype.evict = function(time) {};
/**
* Creates a new SimpleAbrManager.
* @constructor
* @struct
* @implements {shakaExtern.AbrManager}
* @implements {EventTarget}
*/
shaka.abr.SimpleAbrManager = function() {};
shaka.util.FakeEventTarget = function() {};
/**
* @override
* These are the listener types defined in the closure extern for EventTarget.
* @typedef {EventListener|function(!Event):(boolean|undefined)}
*/
shaka.abr.SimpleAbrManager.prototype.stop = function() {};
shaka.util.FakeEventTarget.ListenerType;
/**
* Add an event listener to this object.
* @param {string} type The event type to listen for.
* @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or
* listener object to invoke.
* @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have
* parents, so events neither capture nor bubble.
* @override
*/
shaka.abr.SimpleAbrManager.prototype.init = function(switchCallback) {};
shaka.util.FakeEventTarget.prototype.addEventListener = function(type, listener, opt_capturing) {};
/**
* Remove an event listener from this object.
* @param {string} type The event type for which you wish to remove a listener.
* @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or
* listener object to remove.
* @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have
* parents, so events neither capture nor bubble.
* @override
*/
shaka.abr.SimpleAbrManager.prototype.chooseStreams = function(streamSetsByType) {};
shaka.util.FakeEventTarget.prototype.removeEventListener = function(type, listener, opt_capturing) {};
/**
* Dispatch an event from this object.
* @param {!Event} event The event to be dispatched from this object.
* @return {boolean} True if the default action was prevented.
* @override
*/
shaka.abr.SimpleAbrManager.prototype.enable = function() {};
shaka.util.FakeEventTarget.prototype.dispatchEvent = function(event) {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.disable = function() {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.segmentDownloaded = function(startTimeMs, endTimeMs, numBytes) {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate = function() {};
/**
* @override
*/
shaka.abr.SimpleAbrManager.prototype.setDefaultEstimate = function(estimate) {};
/**
* Construct a Player.

@@ -696,2 +583,7 @@ * @param {!HTMLMediaElement} video Any existing TextTracks attached to this

/**
* @return {HTMLMediaElement} A reference to the HTML Media Element passed
* in during initialization.
*/
shaka.Player.prototype.getMediaElement = function() {};
/**
* @return {shaka.net.NetworkingEngine} A reference to the Player's networking

@@ -814,111 +706,64 @@ * engine. Applications may use this to make requests through Shaka's

* @namespace
* @summary A TextEngine plugin that parses WebVTT files.
* @param {ArrayBuffer} data
* @param {number} offset
* @param {?number} segmentStartTime
* @param {?number} segmentEndTime
* @param {boolean} useRelativeCueTimestamps
* @return {!Array.<!TextTrackCue>}
* @throws {shaka.util.Error}
* @summary A plugin that handles requests for offline content.
* @param {string} uri
* @param {shakaExtern.Request} request
* @return {!Promise.<shakaExtern.Response>}
*/
shaka.media.VttTextParser = function(data, offset, segmentStartTime, segmentEndTime, useRelativeCueTimestamps) {};
shaka.offline.OfflineScheme = function(uri, request) {};
/**
* @namespace
* @summary Extracts a VTT segment from an MP4 file and maps it to cue objects.
* @param {ArrayBuffer} data
* @param {number} offset
* @param {?number} segmentStartTime
* @param {?number} segmentEndTime
* @param {boolean} useRelativeCueTimestamps Only used by the VTT parser
* @return {!Array.<!TextTrackCue>}
* Install all polyfills.
*/
shaka.media.Mp4VttParser = function(data, offset, segmentStartTime, segmentEndTime, useRelativeCueTimestamps) {};
shaka.polyfill.installAll = function() {};
/**
* A receiver to communicate between the Chromecast-hosted player and the
* sender application.
* Registers a new polyfill to be installed.
* @param {function()} polyfill
*/
shaka.polyfill.register = function(polyfill) {};
/**
* Creates a SegmentIndex.
* @param {!Array.<!shaka.media.SegmentReference>} references The list of
* SegmentReferences, which must be sorted first by their start times
* (ascending) and second by their end times (ascending), and have
* continuous, increasing positions.
* @constructor
* @struct
* @param {!HTMLMediaElement} video The local video element associated with the
* local Player instance.
* @param {!shaka.Player} player A local Player instance.
* @param {function(Object)=} opt_appDataCallback A callback to handle
* application-specific data passed from the sender.
* @implements {shaka.util.IDestroyable}
* @extends {shaka.util.FakeEventTarget}
*/
shaka.cast.CastReceiver = function(video, player, opt_appDataCallback) {};
shaka.media.SegmentIndex = function(references) {};
/**
* @return {boolean} True if the cast API is available and there are receivers.
*/
shaka.cast.CastReceiver.prototype.isConnected = function() {};
/**
* @return {boolean} True if the receiver is not currently doing loading or
* playing anything.
*/
shaka.cast.CastReceiver.prototype.isIdle = function() {};
/**
* Destroys the underlying Player, then terminates the cast receiver app.
* @override
*/
shaka.cast.CastReceiver.prototype.destroy = function() {};
shaka.media.SegmentIndex.prototype.destroy = function() {};
/**
* Creates a new DASH parser.
* @struct
* @constructor
* @implements {shakaExtern.ManifestParser}
* Finds the position of the segment for the given time, in seconds, relative
* to the start of a particular Period. Returns the position of the segment
* with the largest end time if more than one segment is known for the given
* time.
* @param {number} time
* @return {?number} The position of the segment, or null
* if the position of the segment could not be determined.
*/
shaka.dash.DashParser = function() {};
shaka.media.SegmentIndex.prototype.find = function(time) {};
/**
* @override
* Gets the SegmentReference for the segment at the given position.
* @param {number} position The position of the segment.
* @return {shaka.media.SegmentReference} The SegmentReference, or null if
* no such SegmentReference exists.
*/
shaka.dash.DashParser.prototype.configure = function(config) {};
shaka.media.SegmentIndex.prototype.get = function(position) {};
/**
* @override
* Merges the given SegmentReferences. Supports extending the original
* references only. Will not replace old references or interleave new ones.
* @param {!Array.<!shaka.media.SegmentReference>} references The list of
* SegmentReferences, which must be sorted first by their start times
* (ascending) and second by their end times (ascending), and have
* continuous, increasing positions.
*/
shaka.dash.DashParser.prototype.start = function(uri, networkingEngine, filterPeriod, onError, onEvent) {};
shaka.media.SegmentIndex.prototype.merge = function(references) {};
/**
* @override
* Removes all SegmentReferences that end before the given time.
* @param {number} time The time in seconds.
*/
shaka.dash.DashParser.prototype.stop = function() {};
shaka.media.SegmentIndex.prototype.evict = function(time) {};
/**
* @namespace
* @summary A networking plugin to handle http and https URIs via XHR.
* @param {string} uri
* @param {shakaExtern.Request} request
* @return {!Promise.<shakaExtern.Response>}
*/
shaka.net.HttpPlugin = function(uri, request) {};
/**
* @namespace
* @summary A TextEngine plugin that parses TTML files.
* @param {ArrayBuffer} data
* @param {number} offset
* @param {?number} segmentStartTime
* @param {?number} segmentEndTime
* @param {boolean} useRelativeCueTimestamps Only used by the VTT parser
* @return {!Array.<!TextTrackCue>}
* @throws {shaka.util.Error}
*/
shaka.media.TtmlTextParser = function(data, offset, segmentStartTime, segmentEndTime, useRelativeCueTimestamps) {};
/**
* @namespace
* @summary A plugin that handles requests for offline content.
* @param {string} uri
* @param {shakaExtern.Request} request
* @return {!Promise.<shakaExtern.Response>}
*/
shaka.offline.OfflineScheme = function(uri, request) {};
/**
* @namespace
* @summary Extracts a TTML segment from an MP4 file and invokes the TTML parser
* to parse it.
* @param {ArrayBuffer} data
* @param {number} offset
* @param {?number} segmentStartTime
* @param {?number} segmentEndTime
* @param {boolean} useRelativeCueTimestamps Only used by the VTT parser
* @return {!Array.<!TextTrackCue>}
*/
shaka.media.Mp4TtmlParser = function(data, offset, segmentStartTime, segmentEndTime, useRelativeCueTimestamps) {};
/**
* This manages persistent offline data including storage, listing, and deleting

@@ -993,2 +838,14 @@ * stored manifests. Playback of offline manifests are done using Player

* @namespace
* @summary A TextEngine plugin that parses WebVTT files.
* @param {ArrayBuffer} data
* @param {number} offset
* @param {?number} segmentStartTime
* @param {?number} segmentEndTime
* @param {boolean} useRelativeCueTimestamps
* @return {!Array.<!TextTrackCue>}
* @throws {shaka.util.Error}
*/
shaka.media.VttTextParser = function(data, offset, segmentStartTime, segmentEndTime, useRelativeCueTimestamps) {};
/**
* @namespace
* @summary A networking plugin to handle data URIs.

@@ -1001,1 +858,149 @@ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs

shaka.net.DataUriPlugin = function(uri, request) {};
/**
* @namespace
* @summary A TextEngine plugin that parses TTML files.
* @param {ArrayBuffer} data
* @param {number} offset
* @param {?number} segmentStartTime
* @param {?number} segmentEndTime
* @param {boolean} useRelativeCueTimestamps Only used by the VTT parser
* @return {!Array.<!TextTrackCue>}
* @throws {shaka.util.Error}
*/
shaka.media.TtmlTextParser = function(data, offset, segmentStartTime, segmentEndTime, useRelativeCueTimestamps) {};
/**
* @namespace
* @summary Extracts a TTML segment from an MP4 file and invokes the TTML parser
* to parse it.
* @param {ArrayBuffer} data
* @param {number} offset
* @param {?number} segmentStartTime
* @param {?number} segmentEndTime
* @param {boolean} useRelativeCueTimestamps Only used by the VTT parser
* @return {!Array.<!TextTrackCue>}
*/
shaka.media.Mp4TtmlParser = function(data, offset, segmentStartTime, segmentEndTime, useRelativeCueTimestamps) {};
/**
* A proxy to switch between local and remote playback for Chromecast in a way
* that is transparent to the app's controls.
* @constructor
* @struct
* @param {!HTMLMediaElement} video The local video element associated with the
* local Player instance.
* @param {!shaka.Player} player A local Player instance.
* @param {string} receiverAppId The ID of the cast receiver application.
* @implements {shaka.util.IDestroyable}
* @extends {shaka.util.FakeEventTarget}
*/
shaka.cast.CastProxy = function(video, player, receiverAppId) {};
/**
* Destroys the proxy and the underlying local Player.
* @override
*/
shaka.cast.CastProxy.prototype.destroy = function() {};
/**
* Get a proxy for the video element that delegates to local and remote video
* elements as appropriate.
* @suppress {invalidCasts} to cast proxy Objects to unrelated types
* @return {HTMLMediaElement}
*/
shaka.cast.CastProxy.prototype.getVideo = function() {};
/**
* Get a proxy for the Player that delegates to local and remote Player objects
* as appropriate.
* @suppress {invalidCasts} to cast proxy Objects to unrelated types
* @return {shaka.Player}
*/
shaka.cast.CastProxy.prototype.getPlayer = function() {};
/**
* @return {boolean} True if the cast API is available and there are receivers.
*/
shaka.cast.CastProxy.prototype.canCast = function() {};
/**
* @return {boolean} True if we are currently casting.
*/
shaka.cast.CastProxy.prototype.isCasting = function() {};
/**
* @return {string} The name of the Cast receiver device, if isCasting().
*/
shaka.cast.CastProxy.prototype.receiverName = function() {};
/**
* @return {!Promise} Resolved when connected to a receiver. Rejected if the
* connection fails or is canceled by the user.
*/
shaka.cast.CastProxy.prototype.cast = function() {};
/**
* Set application-specific data.
* @param {Object} appData Application-specific data to relay to the receiver.
*/
shaka.cast.CastProxy.prototype.setAppData = function(appData) {};
/**
* Show a dialog where user can choose to disconnect from the cast connection.
*/
shaka.cast.CastProxy.prototype.suggestDisconnect = function() {};
/**
* A receiver to communicate between the Chromecast-hosted player and the
* sender application.
* @constructor
* @struct
* @param {!HTMLMediaElement} video The local video element associated with the
* local Player instance.
* @param {!shaka.Player} player A local Player instance.
* @param {function(Object)=} opt_appDataCallback A callback to handle
* application-specific data passed from the sender.
* @implements {shaka.util.IDestroyable}
* @extends {shaka.util.FakeEventTarget}
*/
shaka.cast.CastReceiver = function(video, player, opt_appDataCallback) {};
/**
* @return {boolean} True if the cast API is available and there are receivers.
*/
shaka.cast.CastReceiver.prototype.isConnected = function() {};
/**
* @return {boolean} True if the receiver is not currently doing loading or
* playing anything.
*/
shaka.cast.CastReceiver.prototype.isIdle = function() {};
/**
* Destroys the underlying Player, then terminates the cast receiver app.
* @override
*/
shaka.cast.CastReceiver.prototype.destroy = function() {};
/**
* @namespace
* @summary Extracts a VTT segment from an MP4 file and maps it to cue objects.
* @param {ArrayBuffer} data
* @param {number} offset
* @param {?number} segmentStartTime
* @param {?number} segmentEndTime
* @param {boolean} useRelativeCueTimestamps Only used by the VTT parser
* @return {!Array.<!TextTrackCue>}
*/
shaka.media.Mp4VttParser = function(data, offset, segmentStartTime, segmentEndTime, useRelativeCueTimestamps) {};
/**
* Creates a new DASH parser.
* @struct
* @constructor
* @implements {shakaExtern.ManifestParser}
*/
shaka.dash.DashParser = function() {};
/**
* @override
*/
shaka.dash.DashParser.prototype.configure = function(config) {};
/**
* @override
*/
shaka.dash.DashParser.prototype.start = function(uri, networkingEngine, filterPeriod, onError, onEvent) {};
/**
* @override
*/
shaka.dash.DashParser.prototype.stop = function() {};
/**
* @namespace
* @summary A networking plugin to handle http and https URIs via XHR.
* @param {string} uri
* @param {shakaExtern.Request} request
* @return {!Promise.<shakaExtern.Response>}
*/
shaka.net.HttpPlugin = function(uri, request) {};

@@ -16,3 +16,4 @@ [

{ "architecture": { "title": "Architecture Diagrams" } },
{ "service-worker": { "title": "Service Worker Caching" } },
{ "upgrade": { "title": "Shaka v2 Upgrade Guide" } }
]

@@ -228,2 +228,37 @@ /**

/**
* @typedef {{
* schemeIdUri: string,
* value: string,
* timescale: number,
* presentationTimeDelta: number,
* eventDuration: number,
* id: number,
* messageData: Uint8Array
* }}
*
* @description
* Contains information about an EMSG MP4 box.
*
* @property {string} schemeIdUri
* Identifies the message scheme.
* @property {string} value
* Specifies the value for the event.
* @property {number} timescale
* Provides the timescale, in ticks per second,
* for the time and duration fields within this box.
* @property {number} presentationTimeDelta
* Provides the Media Presentation time delta of the media presentation
* time of the event and the earliest presentation time in this segment.
* @property {number} eventDuration
* Provides the duration of event in media presentation time.
* @property {number} id
* A field identifying this instance of the message.
* @property {Uint8Array} messageData
* Body of the message.
* @exportDoc
*/
shakaExtern.EmsgInfo;
/**
* @typedef {function(!Element):Array.<shakaExtern.DrmInfo>}

@@ -230,0 +265,0 @@ * @see shakaExtern.DashManifestConfiguration

@@ -321,37 +321,2 @@ /**

/**
* @typedef {{
* schemeIdUri: string,
* value: string,
* timescale: number,
* presentationTimeDelta: number,
* eventDuration: number,
* id: number,
* messageData: Uint8Array
* }}
*
* @description
* Contains information about an EMSG MP4 box.
*
* @property {string} schemeIdUri
* Identifies the message scheme.
* @property {string} value
* Specifies the value for the event.
* @property {number} timescale
* Provides the timescale, in ticks per second,
* for the time and duration fields within this box.
* @property {number} presentationTimeDelta
* Provides the Media Presentation time delta of the media presentation
* time of the event and the earliest presentation time in this segment.
* @property {number} eventDuration
* Provides the duration of event in media presentation time.
* @property {number} id
* A field identifying this instance of the message.
* @property {Uint8Array} messageData
* Body of the message.
* @exportDoc
*/
shaka.dash.DashParser.EmsgInfo;
/**
* @override

@@ -1433,3 +1398,3 @@ * @exportInterface

/** @type {shaka.dash.DashParser.EmsgInfo} */
/** @type {shakaExtern.EmsgInfo} */
var emsg = {

@@ -1436,0 +1401,0 @@ schemeIdUri: scheme_id,

@@ -171,5 +171,5 @@ /**

if (segmentInfo.segmentDuration) {
// Consider the presentationTimeOffset
startTime = segmentInfo.segmentDuration * (startNumber - 1) -
segmentInfo.presentationTimeOffset;
// See DASH sec. 5.3.9.5.3
// Don't use presentationTimeOffset for @duration.
startTime = segmentInfo.segmentDuration * (startNumber - 1);
} else if (segmentInfo.timeline && segmentInfo.timeline.length > 0) {

@@ -176,0 +176,0 @@ // The presentationTimeOffset was considered in timeline creation

@@ -322,2 +322,9 @@ /**

var segmentStart = position * segmentDuration;
// Do not construct segments references that should not exist.
if (segmentStart < 0)
return null;
else if (periodDuration && segmentStart >= periodDuration)
return null;
var getUris = function() {

@@ -324,0 +331,0 @@ var mediaUri = MpdUtils.fillUriTemplate(

@@ -1153,5 +1153,9 @@ /**

if (msUntilExpiration < 0 || (hasExpiredKeys && msUntilExpiration < 1000)) {
shaka.log.debug('Session has expired', session);
this.activeSessions_.splice(i, 1);
session.close();
// If this is part of a remove(), we don't want to close the session until
// the update is complete. Otherwise, we will orphan the session.
if (!this.activeSessions_[i].updatePromise) {
shaka.log.debug('Session has expired', session);
this.activeSessions_.splice(i, 1);
session.close();
}
}

@@ -1245,18 +1249,18 @@

.then(function(access) {
// We can't (yet) trust every browser to report the session types they
// support in access.getConfiguration(). Therefore, we create a
// MediaKeys object and try to create an offline session.
// https://goo.gl/gtYT3z, https://goo.gl/rvnB1g, https://goo.gl/z0URJ0
// Edge doesn't return supported session types, but current versions
// do not support persistent-license. If sessionTypes is missing,
// assume no support for persistent-license.
// TODO: polyfill Edge to return known supported session types.
// Edge bug: https://goo.gl/z0URJ0
// Firefox does return supported session types, but will still let you
// create a session even if the type is unsupported.
// Firefox bug: https://goo.gl/lB4H3i
var sessionTypes = access.getConfiguration().sessionTypes;
var persistentState = sessionTypes ?
sessionTypes.indexOf('persistent-license') >= 0 : false;
support[keySystem] = {persistentState: persistentState};
return access.createMediaKeys();
})
.then(function(mediaKeys) {
var persistentState = false;
try {
// This will throw if persistent licenses are not supported.
mediaKeys.createSession('persistent-license');
persistentState = true;
} catch (e) {}
support[keySystem] = {persistentState: persistentState};
}, function() {
}).catch(function() {
// Either the request failed or createMediaKeys failed.
// Either way, write null to the support object.
support[keySystem] = null;

@@ -1263,0 +1267,0 @@ });

@@ -308,11 +308,5 @@ /**

} else {
var TimeRangesUtils = shaka.media.TimeRangesUtils;
var buffered = this.getBuffered_(contentType);
bufferedAhead = TimeRangesUtils.bufferedAheadOf(buffered, time);
if (!bufferedAhead && opt_tolerance) {
bufferedAhead = TimeRangesUtils.bufferedAheadOf(
buffered, time + opt_tolerance);
if (bufferedAhead) bufferedAhead += opt_tolerance;
}
bufferedAhead = shaka.media.TimeRangesUtils.bufferedAheadOfThreshold(
buffered, time, opt_tolerance || 0);
}

@@ -319,0 +313,0 @@ return bufferedAhead;

@@ -224,4 +224,4 @@ /**

// it's an accurate way to determine if we are buffering or not.
var bufferedAhead = shaka.media.TimeRangesUtils.bufferedAheadOf(
this.video_.buffered, this.video_.currentTime);
var bufferedAhead = shaka.media.TimeRangesUtils.bufferedAheadOfThreshold(
this.video_.buffered, this.video_.currentTime, 0.1);
var bufferEnd = shaka.media.TimeRangesUtils.bufferEnd(this.video_.buffered);

@@ -228,0 +228,0 @@

@@ -198,3 +198,4 @@ /**

* recovering: boolean,
* hasError: boolean
* hasError: boolean,
* resumeAt: number
* }}

@@ -240,2 +241,6 @@ *

* updates.
* @property {number} resumeAt
* An override for the time to start performing updates at. If the playhead
* is behind this time, update_() will still start fetching segments from
* this time. If the playhead is ahead of the time, this field is ignored.
*/

@@ -553,6 +558,8 @@ shaka.media.StreamingEngine.MediaState_;

* @param {!Object.<string, shakaExtern.Stream>} streamsByType
* @param {number=} opt_resumeAt
* @return {!Promise}
* @private
*/
shaka.media.StreamingEngine.prototype.initStreams_ = function(streamsByType) {
shaka.media.StreamingEngine.prototype.initStreams_ = function(
streamsByType, opt_resumeAt) {
var MapUtils = shaka.util.MapUtils;

@@ -599,3 +606,4 @@ goog.asserts.assert(this.config_,

recovering: false,
hasError: false
hasError: false,
resumeAt: opt_resumeAt || 0
};

@@ -807,2 +815,3 @@ this.scheduleUpdate_(this.mediaStates_[type], 0);

shaka.log.v2(logPrefix, 'timeNeeded=' + timeNeeded);
mediaState.resumeAt = 0;

@@ -916,3 +925,3 @@ var currentPeriodIndex = this.findPeriodContainingStream_(mediaState.stream);

if (!mediaState.lastStream || !mediaState.lastSegmentReference) {
return playheadTime;
return Math.max(playheadTime, mediaState.resumeAt);
}

@@ -1568,3 +1577,3 @@

for (var type in this.mediaStates_) {
if (streamsByType[type]) continue;
if (streamsByType[type] || type == 'text') continue;

@@ -1580,4 +1589,10 @@ shaka.log.error(logPrefix,

for (var type in streamsByType) {
if (this.mediaStates_[type] ||
(type == 'text' && this.config_.ignoreTextStreamFailures)) continue;
if (this.mediaStates_[type]) continue;
if (type == 'text') {
// initStreams_ will switch streams and schedule an update.
this.initStreams_(
{text: streamsByType['text']}, needPeriod.startTime);
delete streamsByType[type];
continue;
}

@@ -1594,4 +1609,9 @@ shaka.log.error(logPrefix,

var stream = streamsByType[type];
this.switch(type, stream, /* clearBuffer */ false);
this.scheduleUpdate_(this.mediaStates_[type], 0);
if (stream) {
this.switch(type, stream, /* clearBuffer */ false);
this.scheduleUpdate_(this.mediaStates_[type], 0);
} else {
goog.asserts.assert(type == 'text', 'Invalid streams chosen');
delete this.mediaStates_[type];
}
}

@@ -1598,0 +1618,0 @@

@@ -118,3 +118,26 @@ /**

/**
* Computes the amount buffered ahead, allowing a gap of the given size at the
* beginning.
*
* @param {TimeRanges} b
* @param {number} time
* @param {number} tolerance The size of the allowed gap, in seconds.
* @return {number} The amount of content buffered, in seconds.
*/
shaka.media.TimeRangesUtils.bufferedAheadOfThreshold = function(
b, time, tolerance) {
var TimeRangesUtils = shaka.media.TimeRangesUtils;
var bufferedAhead = TimeRangesUtils.bufferedAheadOf(b, time);
if (!bufferedAhead) {
bufferedAhead = TimeRangesUtils.bufferedAheadOf(b, time + tolerance);
if (bufferedAhead) bufferedAhead += tolerance;
}
return bufferedAhead;
};
/** @const {number} */
shaka.media.TimeRangesUtils.GAP_TOLERANCE = 0.04; // 40 ms

@@ -47,12 +47,13 @@ /**

goog.asserts.assert(target, 'XHR onload has no target!');
var headers = target.getAllResponseHeaders().split('\r\n').reduce(
function(all, part) {
var header = part.split(': ');
all[header[0].toLowerCase()] = header.slice(1).join(': ');
return all;
},
{});
if (target.status >= 200 && target.status <= 299 &&
target.status != 202) {
// Most 2xx HTTP codes are success cases.
var headers = target.getAllResponseHeaders().split('\r\n').reduce(
function(all, part) {
var header = part.split(': ');
all[header[0].toLowerCase()] = header.slice(1).join(': ');
return all;
},
{});
if (target.responseURL) {

@@ -62,3 +63,8 @@ uri = target.responseURL;

/** @type {shakaExtern.Response} */
var response = {uri: uri, data: target.response, headers: headers};
var response = {
uri: uri,
data: target.response,
headers: headers,
fromCache: !!headers['x-shaka-from-cache']
};
resolve(response);

@@ -77,3 +83,4 @@ } else {

target.status,
responseText));
responseText,
headers));
}

@@ -80,0 +87,0 @@ };

@@ -207,3 +207,3 @@ /**

*/
goog.define('GIT_VERSION', 'v2.0.6-debug');
goog.define('GIT_VERSION', 'v2.0.7-debug');

@@ -237,3 +237,3 @@

* 'emsg'
* @property {!shaka.dash.DashParser.EmsgInfo} detail
* @property {shakaExtern.EmsgInfo} detail
* An object which contains the content of the emsg box.

@@ -675,2 +675,12 @@ * @exportDoc

/**
* @return {HTMLMediaElement} A reference to the HTML Media Element passed
* in during initialization.
* @export
*/
shaka.Player.prototype.getMediaElement = function() {
return this.video_;
};
/**
* @return {shaka.net.NetworkingEngine} A reference to the Player's networking

@@ -677,0 +687,0 @@ * engine. Applications may use this to make requests through Shaka's

@@ -153,2 +153,3 @@ /**

if (shaka.polyfill.Promise.nativePromise_) {
shaka.log.info('Removing Promise polyfill.');
window['Promise'] = shaka.polyfill.Promise.nativePromise_;

@@ -155,0 +156,0 @@ shaka.polyfill.Promise.q_ = [];

@@ -159,2 +159,3 @@ /**

* be interpretted as text.
* <br> error.data[3] is the map of response headers.
*/

@@ -433,2 +434,7 @@ 'BAD_HTTP_STATUS': 1001,

* did not return the correct number or type of Streams.
*
* This can happen when there is multi-Period content where one Period is
* video+audio and another is video-only or audio-only. We don't support this
* case because it is incompatible with MSE. When the browser reaches the
* transition, it will pause, waiting for the audio stream.
*/

@@ -448,6 +454,8 @@ 'INVALID_STREAMS_CHOSEN': 5005,

* <ul>
* <li>The key system is not supported.
* <li> The key system is not supported.
* <li> The key system does not support the features requested (e.g.
* persistent state).
* <li> A user prompt was shown and the user denied access.
* <li> The key system is not available from unsecure contexts. (ie.
requires HTTPS) See https://goo.gl/EEhZqT.
* </ul>

@@ -454,0 +462,0 @@ */

{
"name": "shaka-player",
"description": "DASH/EME video player library",
"version": "2.0.6",
"version": "2.0.7",
"homepage": "https://github.com/google/shaka-player",

@@ -24,2 +24,3 @@ "author": "Google",

"karma-coverage": "~1.1.1",
"karma-edge-launcher": "^0.2.0",
"karma-firefox-launcher": "~1.0.0",

@@ -26,0 +27,0 @@ "karma-ie-launcher": "~1.0.0",

@@ -71,3 +71,3 @@ /**

Object.defineProperty(window['navigator'],
'userAgent', {value: 'CrKey'});
'userAgent', {value: 'CrKey', configurable: true});
});

@@ -74,0 +74,0 @@

@@ -59,2 +59,3 @@ /**

jasmine.clock().uninstall();
shaka.polyfill.Promise.uninstall();
});

@@ -61,0 +62,0 @@

@@ -49,2 +49,7 @@ /**

});
jasmine.Ajax.stubRequest('https://foo.bar/cache').andReturn({
'response': new ArrayBuffer(0),
'status': 200,
'responseHeaders': { 'X-Shaka-From-Cache': 'true' }
});
jasmine.Ajax.stubRequest('https://foo.bar/timeout').andTimeout();

@@ -106,2 +111,14 @@ jasmine.Ajax.stubRequest('https://foo.bar/error').andError();

it('detects cache headers', function(done) {
var request = shaka.net.NetworkingEngine.makeRequest(
['https://foo.bar/cache'], retryParameters);
shaka.net.HttpPlugin(request.uris[0], request)
.catch(fail)
.then(function(response) {
expect(response).toBeTruthy();
expect(response.fromCache).toBe(true);
})
.then(done);
});
/**

@@ -123,2 +140,3 @@ * @param {string} uri

expect(response.data.byteLength).toBe(10);
expect(response.fromCache).toBe(false);
expect(response.headers).toBeTruthy();

@@ -125,0 +143,0 @@ // Returned header names are in lowercase.

@@ -73,5 +73,9 @@ /**

// Make sure that the references stop at the end.
var lastExpectedReference = references[references.length - 1];
var positionAfterEnd =
stream.findSegmentPosition(references[references.length - 1].endTime);
stream.findSegmentPosition(lastExpectedReference.endTime);
expect(positionAfterEnd).toBe(null);
var referencePastEnd =
stream.getSegmentReference(lastExpectedReference.position + 1);
expect(referencePastEnd).toBe(null);
};

@@ -78,0 +82,0 @@

closure/compiler.jar
The closure compiler, v20161024, by Google.
The closure compiler, v20170218, by Google.
Apache v2.0 license.

@@ -4,0 +4,0 @@ https://github.com/google/closure-compiler

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 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc