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

shaka-player

Package Overview
Dependencies
Maintainers
2
Versions
344
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 1.4.1 to 1.4.2

8

app.js

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

}
if ('offline' in params) {
app.loadStream();
app.onStreamTypeChange();
}
}

@@ -218,2 +223,5 @@ ).catch(

app.loadStream();
} else if ('offline' in params) {
document.getElementById('streamTypeList').value = 'offline';
// loadStream() deferred until group IDs loaded
}

@@ -220,0 +228,0 @@ app.onStreamTypeChange();

2

build/wrapper.template.js
(function(){var g={};
(function(window){%output%}.bind(g,this))();
if (typeof(module)!="undefined"&&module.exports)module.exports=g.shaka;
else if (typeof(define)!="undefined")define(function(){return g.shaka});
else if (typeof(define)!="undefined" && define.amd)define(function(){return g.shaka});
else this.shaka=g.shaka;
})();

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

## 1.4.2 (2015-09-04)
A roll-up of recent bugfixes.
Bugfixes:
- Fix storage of duplicate session IDs for encrypted offline content.
- Specify EME sessionTypes, required in newer EME draft.
- https://github.com/google/shaka-player/issues/128
- Fix regression in rewind support, once more working outside buffered range.
- https://github.com/google/shaka-player/issues/165
- Support renamed output protection errors from newer EME draft.
- Fix seeking in custom controls on Android.
- https://github.com/google/shaka-player/issues/164
- Fix missing final chunk when storing certain videos for offline playback.
- https://github.com/google/shaka-player/issues/157
- Prevent crashing of module loaders which use 'define' but are not full AMD
loaders.
- https://github.com/google/shaka-player/issues/163
Test app features:
- Added 'offline' URL param.
## 1.4.1 (2015-08-18)

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

@@ -89,7 +89,11 @@ /**

var seekTimeoutId = null;
seekBar.addEventListener('mousedown', function() {
var onSeekStart = function() {
playerControls.isSeeking_ = true;
video.pause();
});
seekBar.addEventListener('input', function() {
};
var onSeekInputTimeout = function() {
seekTimeoutId = null;
video.currentTime = seekBar.value;
};
var onSeekInput = function() {
if (!video.duration) {

@@ -106,13 +110,18 @@ // Can't seek. Ignore.

window.clearTimeout(seekTimeoutId);
seekTimeoutId = null;
}
seekTimeoutId = window.setTimeout(function() {
seekTimeoutId = null;
video.currentTime = seekBar.value;
}, 100);
});
seekBar.addEventListener('mouseup', function() {
seekTimeoutId = window.setTimeout(onSeekInputTimeout, 100);
};
var onSeekEnd = function() {
if (seekTimeoutId) {
window.clearTimeout(seekTimeoutId);
onSeekInputTimeout();
}
video.play();
playerControls.isSeeking_ = false;
});
};
seekBar.addEventListener('mousedown', onSeekStart);
seekBar.addEventListener('touchstart', onSeekStart);
seekBar.addEventListener('input', onSeekInput);
seekBar.addEventListener('mouseup', onSeekEnd);
seekBar.addEventListener('touchend', onSeekEnd);
// initialize seek bar with 0

@@ -318,3 +327,5 @@ seekBar.value = 0;

seekBar.max = seekRange.end;
seekBar.value = seekRange.end - displayTime;
if (!playerControls.isSeeking_) {
seekBar.value = seekRange.end - displayTime;
}
} else {

@@ -327,3 +338,5 @@ var showHour = video.duration >= 3600;

seekBar.max = video.duration;
seekBar.value = displayTime;
if (!playerControls.isSeeking_) {
seekBar.value = displayTime;
}
}

@@ -330,0 +343,0 @@

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

* distinctiveIdentifier: (string|undefined),
* persistentState: (string|undefined)
* persistentState: (string|undefined),
* sessionTypes: (Array.<string>|undefined)
* }} */

@@ -38,0 +39,0 @@ var MediaKeySystemConfiguration;

@@ -306,2 +306,6 @@ /**

var sessionTypes = [
this.videoSource_.isOffline() ? 'persistent-license' : 'temporary'
];
return {

@@ -312,3 +316,4 @@ audioCapabilities: undefined,

distinctiveIdentifier: distinctiveIdentifier,
persistentState: persistentState
persistentState: persistentState,
sessionTypes: sessionTypes
};

@@ -601,3 +606,3 @@ };

for (var v = i.next(); !v.done; v = i.next()) {
var message = shaka.media.EmeManager.KEY_STATUS_ERROR_MAP_[v.value];
var message = shaka.media.EmeManager.getErrorMessage_(v.value);
if (message) {

@@ -681,2 +686,22 @@ var error = new Error(message);

/**
* Gets the error message for the given status code.
*
* @param {string} status
* @return {?string}
* @private
*/
shaka.media.EmeManager.getErrorMessage_ = function(status) {
var message = shaka.media.EmeManager.KEY_STATUS_ERROR_MAP_[status];
// usable, output-downscaled, and status-pending do not result in errors.
// the assertion helps catch future status message changes.
shaka.asserts.assert(message ||
status === 'usable' ||
status === 'output-downscaled' ||
status === 'status-pending');
return message;
};
/**
* A map of key statuses to errors. Not every key status appears in the map,

@@ -689,3 +714,5 @@ * in which case that key status is not treated as an error.

shaka.media.EmeManager.KEY_STATUS_ERROR_MAP_ = {
// usable, output-downscaled, and status-pending do not result in errors.
'output-restricted': 'The required output protection is not available.',
// This has been removed from the EME spec and deprecated, but some browsers
// may still use it.
'output-not-allowed': 'The required output protection is not available.',

@@ -692,0 +719,0 @@ 'expired': 'A required key has expired and the content cannot be decrypted.',

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

function(results) {
if (!this.video_) {
// We got destroyed.
return;
}
var previousStreamInfo = this.streamInfo_;

@@ -232,0 +237,0 @@

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

/** @private {number} */
this.seekRangeStart_ = 0;
/** @private {?number} */

@@ -126,3 +129,3 @@ this.watchdogTimer_ = null;

*/
goog.define('GIT_VERSION', 'v1.4.1-debug');
goog.define('GIT_VERSION', 'v1.4.2-debug');

@@ -286,2 +289,4 @@

this.videoSource_.setRestrictions(this.restrictions_);
this.eventManager_.listen(this.videoSource_, 'seekrangechanged',
this.onSeekRangeChanged_.bind(this));
this.emeManager_ = new shaka.media.EmeManager(

@@ -422,3 +427,2 @@ this, this.video_, this.videoSource_);

}
this.cancelRewindTimer_();
};

@@ -428,2 +432,13 @@

/**
* Handler for seek range events.
*
* @param {!Event} event
* @private
*/
shaka.player.Player.prototype.onSeekRangeChanged_ = function(event) {
this.seekRangeStart_ = event['start'];
};
/**
* Gets updated stats about the player.

@@ -889,9 +904,13 @@ *

shaka.asserts.assert(rate < 0);
var rewindOffset =
shaka.player.Player.REWIND_UPDATE_INTERVAL_ * Math.abs(rate);
if (this.video_.buffered.length &&
this.video_.buffered.start(0) + rewindOffset < this.video_.currentTime) {
var offset = ((Date.now() - startWallTime) / 1000) * rate;
this.video_.currentTime = startVideoTime + offset;
this.rewindTimer_ = null;
var offset = ((Date.now() - startWallTime) / 1000) * rate;
var fudge = this.isLive() ? 1 : 0.05;
if (this.video_.currentTime < this.seekRangeStart_ + fudge) {
// Hit the beginning (or near enough), so pause.
this.video_.pause();
} else {
var goal = Math.max(this.seekRangeStart_, startVideoTime + offset);
this.video_.currentTime = goal;
var callback = this.onRewindTimer_.bind(

@@ -901,4 +920,2 @@ this, startVideoTime, startWallTime, rate);

callback, shaka.player.Player.REWIND_UPDATE_INTERVAL_ * 1000);
} else {
this.video_.pause();
}

@@ -1001,3 +1018,3 @@ };

*/
shaka.player.Player.REWIND_UPDATE_INTERVAL_ = 0.1;
shaka.player.Player.REWIND_UPDATE_INTERVAL_ = 0.25;

@@ -1004,0 +1021,0 @@

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

// really know that either:
'initDataTypes': cfg.initDataTypes
'initDataTypes': cfg.initDataTypes,
'sessionTypes': ['temporary']
};

@@ -241,2 +242,3 @@

newCfg.persistentState = 'required';
newCfg.sessionTypes = ['persistent-license'];
} else {

@@ -609,3 +611,3 @@ success = false;

if (code == MediaKeyError['MEDIA_KEYERR_OUTPUT']) {
this.updateKeyStatus_('output-not-allowed');
this.updateKeyStatus_('output-restricted');
} else if (systemCode == 1) {

@@ -612,0 +614,0 @@ this.updateKeyStatus_('expired');

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

goog.require('shaka.player.DrmSchemeInfo');
goog.require('shaka.util.ArrayUtils');
goog.require('shaka.util.FakeEvent');

@@ -345,2 +346,3 @@ goog.require('shaka.util.FakeEventTarget');

sessionIds = shaka.util.ArrayUtils.removeDuplicates(sessionIds);
var groupInfo = {

@@ -471,3 +473,5 @@ 'group_id': groupId,

var requestSegment = this.requestSegment_.bind(this, reference);
var appendSegment = this.appendSegment_.bind(this, reference, state);
var isLast = (i == segmentIndex.length() - 1);
var appendSegment = this.appendSegment_.bind(this, reference, state,
isLast);
// Cast as workaround for closure compiler issue. Complier seems to think

@@ -499,2 +503,3 @@ // this is returning a Promise.<Promise.<ArrayBuffer>>

* current stream being inserted.
* @param {boolean} isLast True for the last segment in a stream.
* @param {!ArrayBuffer} segment The current segment of the stream.

@@ -506,2 +511,3 @@ * @return {!Promise}

state,
isLast,
segment) {

@@ -521,4 +527,3 @@ var p = new shaka.util.PublicPromise();

var size = state.segment.byteLength;
if (size >= shaka.util.ContentDatabase.TARGET_SEGMENT_SIZE_ ||
ref.endTime == null) {
if (size >= shaka.util.ContentDatabase.TARGET_SEGMENT_SIZE_ || isLast) {
var data = {

@@ -636,2 +641,5 @@ 'stream_id': state.streamId,

function(groupInfo) {
groupInfo['session_ids'] =
shaka.util.ArrayUtils.removeDuplicates(groupInfo['session_ids']);
if (!groupInfo.hasOwnProperty('duration') &&

@@ -638,0 +646,0 @@ !groupInfo.hasOwnProperty('key_system')) {

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

@@ -6,0 +6,0 @@ "author": "Google",

@@ -199,2 +199,26 @@ /**

// Bug #157:
it('stores a stream with an explicit end time', function(done) {
var references = [
new shaka.media.SegmentReference(0, 100, 6, null, new goog.Uri(url))
];
var index = new shaka.media.SegmentIndex(references);
streamInfo.segmentIndexSource = {
create: function() { return Promise.resolve(index); }
};
p.then(function() {
return db.insertStream_(streamInfo, index, testInitData, 1, 0);
}).then(function(streamId) {
return db.retrieveStreamIndex(streamId);
}).then(function(streamIndex) {
expect(streamIndex.references.length).toEqual(1);
expect(streamIndex.references[0]).toMatchReference(
{ start_time: 0, end_time: 100 });
done();
}).catch(function(err) {
fail(err);
done();
});
});
it('throws an error when trying to store an invalid stream', function(done) {

@@ -201,0 +225,0 @@ p.then(function() {

@@ -547,2 +547,25 @@ /**

});
it('plays in reverse past the buffered area', function(done) {
var timestamp = 10;
// Start in the second segment.
player.load(newSource(plainManifest)).then(function() {
video.currentTime = timestamp;
video.play();
return waitForMovement(video, eventManager);
}).then(function() {
expect(video.buffered.length).toBe(1);
expect(video.buffered.start(0)).toBeGreaterThan(5);
player.setPlaybackRate(-3.0);
return waitForMovement(video, eventManager);
}).then(function() {
return delay(4.0);
}).then(function() {
expect(video.currentTime).toBeLessThan(0.1);
done();
}).catch(function(error) {
fail(error);
done();
});
});
});

@@ -549,0 +572,0 @@

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

goog.addDependency('../../../lib/util/clock.js', ['shaka.util.Clock'], []);
goog.addDependency('../../../lib/util/content_database.js', ['shaka.util.ContentDatabase'], ['shaka.asserts', 'shaka.media.SegmentIndex', 'shaka.media.SegmentReference', 'shaka.media.StreamInfo', 'shaka.player.DrmSchemeInfo', 'shaka.util.FakeEvent', 'shaka.util.FakeEventTarget', 'shaka.util.IBandwidthEstimator', 'shaka.util.PublicPromise', 'shaka.util.RangeRequest', 'shaka.util.TypedBind']);
goog.addDependency('../../../lib/util/content_database.js', ['shaka.util.ContentDatabase'], ['shaka.asserts', 'shaka.media.SegmentIndex', 'shaka.media.SegmentReference', 'shaka.media.StreamInfo', 'shaka.player.DrmSchemeInfo', 'shaka.util.ArrayUtils', 'shaka.util.FakeEvent', 'shaka.util.FakeEventTarget', 'shaka.util.IBandwidthEstimator', 'shaka.util.PublicPromise', 'shaka.util.RangeRequest', 'shaka.util.TypedBind']);
goog.addDependency('../../../lib/util/data_view_reader.js', ['shaka.util.DataViewReader'], ['shaka.asserts']);

@@ -59,0 +59,0 @@ goog.addDependency('../../../lib/util/ebml_parser.js', ['shaka.util.EbmlElement', 'shaka.util.EbmlParser'], []);

@@ -37,3 +37,3 @@ <!DOCTYPE html>

// Construct a DashVideoSource to represent the DASH manifest.
var mpdUrl = 'http://turtle-tube.appspot.com/t/t2/dash.mpd';
var mpdUrl = 'https://turtle-tube.appspot.com/t/t2/dash.mpd';
var estimator = new shaka.util.EWMABandwidthEstimator();

@@ -40,0 +40,0 @@ var source = new shaka.player.DashVideoSource(mpdUrl, null, estimator);

@@ -38,3 +38,3 @@ <!DOCTYPE html>

// Construct a DashVideoSource to represent the DASH manifest.
var mpdUrl = 'http://turtle-tube.appspot.com/t/t2/dash.mpd';
var mpdUrl = 'https://turtle-tube.appspot.com/t/t2/dash.mpd';
var estimator = new shaka.util.EWMABandwidthEstimator();

@@ -41,0 +41,0 @@ var source = new shaka.player.DashVideoSource(mpdUrl, null, estimator);

@@ -38,3 +38,3 @@ <!DOCTYPE html>

// Construct a DashVideoSource to represent the DASH manifest.
var mpdUrl = 'http://turtle-tube.appspot.com/t/t2/dash.mpd';
var mpdUrl = 'https://turtle-tube.appspot.com/t/t2/dash.mpd';
var estimator = new shaka.util.EWMABandwidthEstimator();

@@ -41,0 +41,0 @@ var source = new shaka.player.DashVideoSource(mpdUrl, null, estimator);

@@ -38,3 +38,3 @@ <!DOCTYPE html>

// a callback to interpret the ContentProtection elements.
var mpdUrl = 'http://turtle-tube.appspot.com/t/e6/dash.mpd';
var mpdUrl = 'https://turtle-tube.appspot.com/t/e6/dash.mpd';
var estimator = new shaka.util.EWMABandwidthEstimator();

@@ -63,3 +63,3 @@ var source = new shaka.player.DashVideoSource(mpdUrl,

// you would run your own front-end service for this.
var licenseServerUrl = 'http://widevine-proxy.appspot.com/proxy';
var licenseServerUrl = 'https://widevine-proxy.appspot.com/proxy';

@@ -66,0 +66,0 @@ // The EME key system identifier for Widevine.

@@ -78,3 +78,3 @@ <!DOCTYPE html>

<img id="t1"
src="http://turtle-tube.appspot.com/t/t1/thumb.png"
src="https://turtle-tube.appspot.com/t/t1/thumb.png"
onclick="onImageClick(this)"><br>

@@ -86,3 +86,3 @@ <i>cute green sea turtle in Ko'olina Hawai'i</i><br>

<img id="t2"
src="http://turtle-tube.appspot.com/t/t2/thumb.png"
src="https://turtle-tube.appspot.com/t/t2/thumb.png"
onclick="onImageClick(this)"><br>

@@ -96,3 +96,3 @@ <i>Endangered Ocean: Sea Turtles</i><br>

<img id="t3"
src="http://turtle-tube.appspot.com/t/t3/thumb.png"
src="https://turtle-tube.appspot.com/t/t3/thumb.png"
onclick="onImageClick(this)"><br>

@@ -104,3 +104,3 @@ <i>sea turtles exercise: bent arms</i><br>

<img id="t4"
src="http://turtle-tube.appspot.com/t/t4/thumb.png"
src="https://turtle-tube.appspot.com/t/t4/thumb.png"
onclick="onImageClick(this)"><br>

@@ -114,3 +114,3 @@ <i>sea turtles exercise: straight arms</i><br>

<img id="t5"
src="http://turtle-tube.appspot.com/t/t5/thumb.png"
src="https://turtle-tube.appspot.com/t/t5/thumb.png"
onclick="onImageClick(this)"><br>

@@ -122,3 +122,3 @@ <i>Using robots to reveal secrets of walking baby sea turtles</i><br>

<img id="e6"
src="http://turtle-tube.appspot.com/t/e6/thumb.png"
src="https://turtle-tube.appspot.com/t/e6/thumb.png"
onclick="onImageClick(this)"><br>

@@ -133,3 +133,3 @@ <i>kitten vs sea turtle</i><br>

<video id="video"
poster="http://turtle-tube.appspot.com/poster.jpg"
poster="https://turtle-tube.appspot.com/poster.jpg"
crossorigin="anonymous"

@@ -185,3 +185,3 @@ controls autoplay>

// a callback to interpret the ContentProtection elements (if any).
var mpdUrl = 'http://turtle-tube.appspot.com/t/' + image.id + '/dash.mpd';
var mpdUrl = 'https://turtle-tube.appspot.com/t/' + image.id + '/dash.mpd';
var source = new shaka.player.DashVideoSource(mpdUrl,

@@ -213,3 +213,3 @@ interpretContentProtection,

// you would run your own front-end service for this.
var licenseServerUrl = 'http://widevine-proxy.appspot.com/proxy';
var licenseServerUrl = 'https://widevine-proxy.appspot.com/proxy';

@@ -216,0 +216,0 @@ // The EME key system identifier for Widevine.

@@ -98,3 +98,3 @@ <!DOCTYPE html>

<img id="t1"
src="http://turtle-tube.appspot.com/t/t1/thumb.png"
src="https://turtle-tube.appspot.com/t/t1/thumb.png"
onclick="onImageClick(this)"><br>

@@ -106,3 +106,3 @@ <i>cute green sea turtle in Ko'olina Hawai'i</i><br>

<img id="t2"
src="http://turtle-tube.appspot.com/t/t2/thumb.png"
src="https://turtle-tube.appspot.com/t/t2/thumb.png"
onclick="onImageClick(this)"><br>

@@ -116,3 +116,3 @@ <i>Endangered Ocean: Sea Turtles</i><br>

<img id="t3"
src="http://turtle-tube.appspot.com/t/t3/thumb.png"
src="https://turtle-tube.appspot.com/t/t3/thumb.png"
onclick="onImageClick(this)"><br>

@@ -124,3 +124,3 @@ <i>sea turtles exercise: bent arms</i><br>

<img id="t4"
src="http://turtle-tube.appspot.com/t/t4/thumb.png"
src="https://turtle-tube.appspot.com/t/t4/thumb.png"
onclick="onImageClick(this)"><br>

@@ -134,3 +134,3 @@ <i>sea turtles exercise: straight arms</i><br>

<img id="t5"
src="http://turtle-tube.appspot.com/t/t5/thumb.png"
src="https://turtle-tube.appspot.com/t/t5/thumb.png"
onclick="onImageClick(this)"><br>

@@ -142,3 +142,3 @@ <i>Using robots to reveal secrets of walking baby sea turtles</i><br>

<img id="e6"
src="http://turtle-tube.appspot.com/t/e6/thumb.png"
src="https://turtle-tube.appspot.com/t/e6/thumb.png"
onclick="onImageClick(this)"><br>

@@ -153,3 +153,3 @@ <i>kitten vs sea turtle</i><br>

<video id="video"
poster="http://turtle-tube.appspot.com/poster.jpg"
poster="https://turtle-tube.appspot.com/poster.jpg"
crossorigin="anonymous"

@@ -159,3 +159,3 @@ controls autoplay>

</video>
<img id="hd" src="http://turtle-tube.appspot.com/hd.png">
<img id="hd" src="https://turtle-tube.appspot.com/hd.png">
<div id="errorOverlay"></div>

@@ -262,3 +262,3 @@ </div>

// a callback to interpret the ContentProtection elements (if any).
var mpdUrl = 'http://turtle-tube.appspot.com/t/' + image.id + '/dash.mpd';
var mpdUrl = 'https://turtle-tube.appspot.com/t/' + image.id + '/dash.mpd';
var source = new shaka.player.DashVideoSource(mpdUrl,

@@ -290,3 +290,3 @@ interpretContentProtection,

// you would run your own front-end service for this.
var licenseServerUrl = 'http://widevine-proxy.appspot.com/proxy';
var licenseServerUrl = 'https://widevine-proxy.appspot.com/proxy';

@@ -293,0 +293,0 @@ // The EME key system identifier for Widevine.

@@ -85,3 +85,3 @@ <!DOCTYPE html>

// Store content from MPD url.
var mpdUrl = 'http://turtle-tube.appspot.com/t/t2/dash.mpd';
var mpdUrl = 'https://turtle-tube.appspot.com/t/t2/dash.mpd';
var preferredLanguage = 'en-US';

@@ -88,0 +88,0 @@ return offlineSource.store(

@@ -85,3 +85,3 @@ <!DOCTYPE html>

// Store content from MPD url.
var mpdUrl = 'http://turtle-tube.appspot.com/t/t2/dash.mpd';
var mpdUrl = 'https://turtle-tube.appspot.com/t/t2/dash.mpd';
var preferredLanguage = 'en-US';

@@ -88,0 +88,0 @@ return offlineSource.store(

@@ -85,3 +85,3 @@ <!DOCTYPE html>

// Store content from MPD url.
var mpdUrl = 'http://turtle-tube.appspot.com/t/t2/dash.mpd';
var mpdUrl = 'https://turtle-tube.appspot.com/t/t2/dash.mpd';
var preferredLanguage = 'en-US';

@@ -88,0 +88,0 @@ return offlineSource.store(

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 not supported yet

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