Skip to content

Commit 94937d7

Browse files
yohannconGerrit Code Review
authored andcommitted
Changes to fix compile errors when using the upstream Closure compiler.
Change-Id: I57b4ae73bdb1980938c3a740904e18da46c6ba23
1 parent a41e643 commit 94937d7

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

externs/mediakeys.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ MediaKeySession.prototype.keyStatuses;
167167

168168
/**
169169
* @param {string} initDataType
170-
* @param {?BufferSource} initData
170+
* @param {!BufferSource} initData
171171
* @return {!Promise}
172172
*/
173173
MediaKeySession.prototype.generateRequest = function(initDataType, initData) {};

lib/media/eme_manager.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,9 @@ shaka.media.EmeManager.prototype.onEncrypted_ = function(event) {
498498
this.allSessionsPresumedReady_.reject(exception);
499499
return;
500500
}
501-
502-
var p = session.generateRequest(event.initDataType, event.initData);
501+
shaka.asserts.assert(event.initData);
502+
var p = session.generateRequest(event.initDataType,
503+
/** @type {!BufferSource} */(event.initData));
503504
this.requestGenerated_[initDataKey] = true;
504505

505506
p.catch(shaka.util.TypedBind(this,
@@ -603,8 +604,8 @@ shaka.media.EmeManager.prototype.onKeyStatusChange_ = function(event) {
603604
if (message) {
604605
var error = new Error(message);
605606
error.type = v.value;
606-
var event = shaka.util.FakeEvent.createErrorEvent(error);
607-
this.dispatchEvent(event);
607+
var errorEvent = shaka.util.FakeEvent.createErrorEvent(error);
608+
this.dispatchEvent(errorEvent);
608609
}
609610
}
610611
};

lib/player/player.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ shaka.player.Player.prototype.onError_ = function(event) {
412412

413413
var error = new Error(message);
414414
error.type = 'playback';
415-
var event = shaka.util.FakeEvent.createErrorEvent(error);
416-
this.dispatchEvent(event);
415+
var errorEvent = shaka.util.FakeEvent.createErrorEvent(error);
416+
this.dispatchEvent(errorEvent);
417417
};
418418

419419

@@ -977,13 +977,14 @@ shaka.player.Player.prototype.onWatchdogTimer_ = function() {
977977

978978
if (this.video_.ended || this.video_.seeking) return;
979979

980-
var buffered = this.video_.buffered;
980+
var bufferedProp = this.video_.buffered;
981981
// Counter-intuitively, the play head can advance audio-only while video is
982982
// buffering. |buffered| will show the intersection of buffered ranges for
983983
// both audio and video, so this is an accurate way to sense that we are
984984
// buffering. The 'stalled', 'waiting', and 'suspended' events do not work
985985
// for this purpose as of Chrome 38. Nor will video.readyState.
986-
var bufferEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;
986+
var bufferEnd =
987+
bufferedProp.length ? bufferedProp.end(bufferedProp.length - 1) : 0;
987988
var buffered = bufferEnd - this.video_.currentTime;
988989
var threshold = shaka.player.Player.UNDERFLOW_THRESHOLD_;
989990
var fudgedBufferEnd = bufferEnd + shaka.player.Player.BUFFERED_FUDGE_FACTOR_;

lib/polyfill/patchedmediakeys_v01b.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.getStatus =
920920

921921
/**
922922
* Array entry 0 is the key, 1 is the value.
923-
* @return {Iterator.<Array.<BufferSource|string>>}
923+
* @override
924924
*/
925925
shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.entries =
926926
function() {
@@ -977,7 +977,7 @@ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.has =
977977

978978

979979
/**
980-
* @return {Iterator.<BufferSource>}
980+
* @override
981981
*/
982982
shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.keys =
983983
function() {
@@ -993,7 +993,7 @@ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.keys =
993993

994994

995995
/**
996-
* @return {Iterator.<string>}
996+
* @override
997997
*/
998998
shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.values =
999999
function() {

0 commit comments

Comments
 (0)