Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shaka-player

Package Overview
Dependencies
Maintainers
3
Versions
348
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.4.0 to 2.4.1

externs/network_information.js

2

build/wrapper.template.js

@@ -6,2 +6,2 @@ (function(){var g={};

else this.shaka=g.shaka;
}).call(window);
}).call(typeof window === "object" ? window : global);

@@ -192,4 +192,8 @@ /**

let commonDrmSystems =
['com.widevine.alpha', 'com.microsoft.playready', 'com.adobe.primetime'];
let commonDrmSystems = [
'com.widevine.alpha',
'com.microsoft.playready',
'com.adobe.primetime',
'org.w3.clearkey',
];
let config = /** @type {shakaExtern.PlayerConfiguration} */(

@@ -196,0 +200,0 @@ {abr: {}, streaming: {}, manifest: {dash: {}}});

@@ -5,3 +5,3 @@ // This file was autogenerated by third_party/closure/deps/depswriter.py.

goog.addDependency('../../../lib/abr/ewma_bandwidth_estimator.js', ['shaka.abr.EwmaBandwidthEstimator'], ['shaka.abr.Ewma']);
goog.addDependency('../../../lib/abr/simple_abr_manager.js', ['shaka.abr.SimpleAbrManager'], ['goog.asserts', 'shaka.abr.EwmaBandwidthEstimator', 'shaka.log', 'shaka.util.Error', 'shaka.util.StreamUtils']);
goog.addDependency('../../../lib/abr/simple_abr_manager.js', ['shaka.abr.SimpleAbrManager'], ['goog.asserts', 'shaka.abr.EwmaBandwidthEstimator', 'shaka.log', 'shaka.util.StreamUtils']);
goog.addDependency('../../../lib/cast/cast_proxy.js', ['shaka.cast.CastProxy'], ['goog.asserts', 'shaka.cast.CastSender', 'shaka.cast.CastUtils', 'shaka.log', 'shaka.util.Error', 'shaka.util.EventManager', 'shaka.util.FakeEvent', 'shaka.util.FakeEventTarget', 'shaka.util.IDestroyable']);

@@ -35,3 +35,3 @@ goog.addDependency('../../../lib/cast/cast_receiver.js', ['shaka.cast.CastReceiver'], ['goog.asserts', 'shaka.cast.CastUtils', 'shaka.log', 'shaka.util.Error', 'shaka.util.EventManager', 'shaka.util.FakeEvent', 'shaka.util.FakeEventTarget', 'shaka.util.IDestroyable']);

goog.addDependency('../../../lib/media/time_ranges_utils.js', ['shaka.media.TimeRangesUtils'], []);
goog.addDependency('../../../lib/media/transmuxer.js', ['shaka.media.Transmuxer'], ['goog.asserts', 'shaka.text.Cue', 'shaka.util.IDestroyable', 'shaka.util.ManifestParserUtils', 'shaka.util.PublicPromise', 'shaka.util.Uint8ArrayUtils']);
goog.addDependency('../../../lib/media/transmuxer.js', ['shaka.media.Transmuxer'], ['goog.asserts', 'shaka.text.Cue', 'shaka.util.Error', 'shaka.util.IDestroyable', 'shaka.util.ManifestParserUtils', 'shaka.util.PublicPromise', 'shaka.util.Uint8ArrayUtils']);
goog.addDependency('../../../lib/media/video_wrapper.js', ['shaka.media.VideoWrapper'], ['goog.asserts', 'shaka.log', 'shaka.util.EventManager', 'shaka.util.IDestroyable', 'shaka.util.Timer']);

@@ -38,0 +38,0 @@ goog.addDependency('../../../lib/media/webm_segment_index_parser.js', ['shaka.media.WebmSegmentIndexParser'], ['goog.asserts', 'shaka.log', 'shaka.media.SegmentReference', 'shaka.util.EbmlElement', 'shaka.util.EbmlParser', 'shaka.util.Error']);

@@ -142,4 +142,7 @@ /**

/**
* Sets the abr configurations.
* Sets the ABR configuration.
*
* It is the responsibility of the AbrManager implementation to implement the
* restrictions behavior described in shaka.extern.AbrConfiguration.
*
* @param {shakaExtern.AbrConfiguration} config

@@ -146,0 +149,0 @@ * @exportDoc

@@ -273,6 +273,10 @@ /**

* An object describing application restrictions on what tracks can play. All
* restrictions must be fulfilled for a track to be playable. If a track does
* not meet the restrictions, it will not appear in the track list and it will
* not be played.
* restrictions must be fulfilled for a track to be playable/selectable.
* The restrictions system behaves somewhat differently at the ABR level and the
* player level, so please refer to the documentation for those specific
* settings.
*
* @see shakaExtern.PlayerConfiguration
* @see shakaExtern.AbrConfiguration
*
* @property {number} minWidth

@@ -632,5 +636,9 @@ * The minimum width of a video track, in pixels.

* @property {shakaExtern.Restrictions} restrictions
* The restrictions to apply to ABR decisions. The AbrManager will not
* choose any streams that do not meet these restrictions. (Note that
* they can still be chosen by the application)
* The restrictions to apply to ABR decisions. These are "soft" restrictions.
* Any track that fails to meet these restrictions will not be selected
* automatically, but will still appear in the track list and can still be
* selected via selectVariantTrack(). If no tracks meet these restrictions,
* AbrManager should not fail, but choose a low-res or low-bandwidth variant
* instead. It is the responsibiliy of AbrManager implementations to follow
* these rules and implement this behavior.
* @property {number} switchInterval

@@ -694,4 +702,6 @@ * The minimum amount of time that must pass between switches, in

* @property {shakaExtern.Restrictions} restrictions
* The application restrictions to apply to the tracks. The track must
* meet all the restrictions to be playable.
* The application restrictions to apply to the tracks. These are "hard"
* restrictions. Any track that fails to meet these restrictions will not
* appear in the track list. If no tracks meet these restrictions, playback
* will fail.
* @property {number} playRangeStart

@@ -698,0 +708,0 @@ * Optional playback and seek start time in seconds. Defaults to 0 if

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

goog.require('shaka.log');
goog.require('shaka.util.Error');
goog.require('shaka.util.StreamUtils');

@@ -122,6 +121,11 @@

if (this.variants_.length && !sortedVariants.length) {
throw new shaka.util.Error(
shaka.util.Error.Severity.CRITICAL,
shaka.util.Error.Category.MANIFEST,
shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET);
// If we couldn't meet the ABR restrictions, we should still play something.
// These restrictions are not "hard" restrictions in the way that top-level
// or DRM-based restrictions are. Sort the variants without restrictions
// and keep just the first (lowest-bandwidth) one.
shaka.log.warning('No variants met the ABR restrictions. ' +
'Choosing a variant by lowest bandwidth.');
sortedVariants = SimpleAbrManager.filterAndSortVariants_(
/* restrictions */ null, this.variants_);
sortedVariants = [sortedVariants[0]];
}

@@ -262,3 +266,3 @@

/**
* @param {shakaExtern.Restrictions} restrictions
* @param {?shakaExtern.Restrictions} restrictions
* @param {!Array.<shakaExtern.Variant>} variants

@@ -271,12 +275,18 @@ * @return {!Array.<shakaExtern.Variant>} variants filtered according to

restrictions, variants) {
return variants
.filter(function(variant) {
return shaka.util.StreamUtils.meetsRestrictions(
variant, restrictions,
/* maxHwRes */ {width: Infinity, height: Infinity});
})
.sort(function(v1, v2) {
return v1.bandwidth - v2.bandwidth;
});
if (restrictions) {
variants = variants.filter((variant) => {
// This was already checked in another scope, but the compiler doesn't
// seem to understand that.
goog.asserts.assert(restrictions, 'Restrictions should exist!');
return shaka.util.StreamUtils.meetsRestrictions(
variant, restrictions,
/* maxHwRes */ {width: Infinity, height: Infinity});
});
}
return variants.sort((v1, v2) => {
return v1.bandwidth - v2.bandwidth;
});
};

@@ -81,3 +81,15 @@ /**

// Don't fit live content, since it might receive more segments.
// Unless that live content is multi-period; it's safe to fit every period
// but the last one, since only the last period might receive new segments.
let shouldFit = !context.dynamic || !context.periodInfo.isLastPeriod;
if (segmentIndex) {
if (shouldFit) {
// Fit the new references before merging them, so that the merge
// algorithm has a more accurate view of their start and end times.
let wrapper = new shaka.media.SegmentIndex(references);
wrapper.fit(context.periodInfo.duration);
}
segmentIndex.merge(references);

@@ -95,3 +107,3 @@ let start = context.presentationTimeline.getSegmentAvailabilityStart();

if (!context.dynamic || !context.periodInfo.isLastPeriod) {
if (shouldFit) {
segmentIndex.fit(context.periodInfo.duration);

@@ -98,0 +110,0 @@ }

@@ -176,3 +176,3 @@ /**

'video/webm; codecs="vp9"',
'video/webm; codecs="av1"',
'video/webm; codecs="vp09.00.10.08"',
'audio/webm; codecs="vorbis"',

@@ -179,0 +179,0 @@ 'audio/webm; codecs="opus"',

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

goog.require('shaka.text.Cue');
goog.require('shaka.util.Error');
goog.require('shaka.util.IDestroyable');

@@ -167,2 +168,14 @@ goog.require('shaka.util.ManifestParserUtils');

this.muxTransmuxer_.flush();
// Workaround for https://goo.gl/Q2ob1E: mux.js not
// emitting 'data' and 'done' events.
// mux.js code is synchronous, so if onTransmuxDone_ has
// not been called by now, it's not going to be.
// Treat it as a transmuxing failure and reject the promise.
if (this.isTransmuxing_) {
this.transmuxPromise_.reject(new shaka.util.Error(
shaka.util.Error.Severity.CRITICAL,
shaka.util.Error.Category.MEDIA,
shaka.util.Error.Code.TRANSMUXING_FAILED));
}
return this.transmuxPromise_;

@@ -169,0 +182,0 @@ };

@@ -403,3 +403,8 @@ /**

/**
* Mux.js did not invoke the callback signifying successful transmuxing.
*/
'TRANSMUXING_FAILED': 3018,
/**

@@ -406,0 +411,0 @@ * The Player was unable to guess the manifest type based on file extension

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

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

"useragent": "~2.1.13",
"wd": "^1.8.0",
"which": "~1.3.0"

@@ -50,0 +51,0 @@ },

@@ -21,12 +21,2 @@ /**

const defaultBandwidthEstimate = 500e3; // 500kbps
const defaultRestrictions = {
minWidth: 0,
maxWidth: Infinity,
minHeight: 0,
maxHeight: Infinity,
minPixels: 0,
maxPixels: Infinity,
minBandwidth: 0,
maxBandwidth: Infinity
};

@@ -86,3 +76,12 @@ /** @type {shakaExtern.AbrConfiguration} */

bandwidthDowngradeTarget: 0.95,
restrictions: defaultRestrictions
restrictions: { // Must be inline to avoid cross-test pollution!
minWidth: 0,
maxWidth: Infinity,
minHeight: 0,
maxHeight: Infinity,
minPixels: 0,
maxPixels: Infinity,
minBandwidth: 0,
maxBandwidth: Infinity
},
};

@@ -94,4 +93,2 @@

abrManager.init(shaka.test.Util.spyFunc(switchCallback));
config.defaultBandwidthEstimate = defaultBandwidthEstimate;
config.restrictions = defaultRestrictions;
abrManager.configure(config);

@@ -356,3 +353,3 @@ abrManager.setVariants(variants);

.addVariant(1).bandwidth(2e5)
.addVideo(2).size(200, 200)
.addVideo(1).size(200, 200)
.build();

@@ -366,5 +363,27 @@

abrManager.configure(config);
chosen = abrManager.chooseVariant();
expect(chosen.id).toBe(0);
});
it('uses lowest-bandwidth variant when restrictions cannot be met', () => {
manifest = new shaka.test.ManifestGenerator()
.addPeriod(0)
.addVariant(0).bandwidth(1e5)
.addVideo(0).size(50, 50)
.addVariant(1).bandwidth(2e5)
.addVideo(1).size(200, 200)
.build();
abrManager.setVariants(manifest.periods[0].variants);
let chosen = abrManager.chooseVariant();
expect(chosen.id).toBe(1);
// This restriction cannot be met, but we shouldn't fail.
config.restrictions.maxWidth = 1;
abrManager.configure(config);
chosen = abrManager.chooseVariant();
expect(chosen.id).toBe(0);
});
});
closure/compiler.jar
The closure compiler, v20180402, by Google.
The closure compiler, v20180402 (modified), 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

@@ -6,0 +9,0 @@ closure/goog

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