diff --git a/externs/mediakeys.js b/externs/mediakeys.js index 8183a3175a..100f203da0 100644 --- a/externs/mediakeys.js +++ b/externs/mediakeys.js @@ -114,8 +114,8 @@ MediaKeyStatusMap.prototype.entries = function() {}; /** - * The functor is called with each value. - * @param {function(string)} fn + * The functor is called with each value and key. + * @param {function(string, BufferSource)} fn */ MediaKeyStatusMap.prototype.forEach = function(fn) {}; diff --git a/lib/player/stats.js b/lib/player/stats.js index 160c499010..f565c6c072 100644 --- a/lib/player/stats.js +++ b/lib/player/stats.js @@ -97,7 +97,7 @@ shaka.player.Stats = function() { * Bandwidth history. Each timestamped value is a bandwidth measurement, in * bits per second. * - * @type {!Array.>} + * @type {!Array.>} * @expose */ this.bandwidthHistory = []; @@ -106,8 +106,8 @@ shaka.player.Stats = function() { * StreamInfo history. Each timestamped value is a stream chosen * by the player. * - * @type {!Array.>} + * @type {!Array.>} * @expose */ this.streamHistory = []; diff --git a/lib/polyfill/patchedmediakeys_20140218.js b/lib/polyfill/patchedmediakeys_20140218.js index a4326fcd3a..65fe081a51 100644 --- a/lib/polyfill/patchedmediakeys_20140218.js +++ b/lib/polyfill/patchedmediakeys_20140218.js @@ -781,10 +781,7 @@ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. }; -/** - * Array entry 0 is the key, 1 is the value. - * @return {Iterator.>} - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. entries = function() { var fakeKeyId = @@ -798,22 +795,18 @@ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. }; -/** - * The functor is called with each value. - * @param {function(string)} fn - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. forEach = function(fn) { if (this.status_) { - fn(this.status_); + var fakeKeyId = + shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.KEY_ID_; + fn(this.status_, fakeKeyId); } }; -/** - * @param {!BufferSource} keyId - * @return {string|undefined} - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. get = function(keyId) { if (this.has(keyId)) { @@ -823,10 +816,7 @@ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. }; -/** - * @param {!BufferSource} keyId - * @return {boolean} - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. has = function(keyId) { var fakeKeyId = @@ -839,9 +829,7 @@ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. }; -/** - * @return {Iterator.} - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. keys = function() { var fakeKeyId = @@ -855,9 +843,7 @@ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. }; -/** - * @return {Iterator.} - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v20140218.MediaKeyStatusMap.prototype. values = function() { /** @type {!Array.} */ diff --git a/lib/polyfill/patchedmediakeys_v01b.js b/lib/polyfill/patchedmediakeys_v01b.js index 71c1daa0b6..60fdfa6bfb 100644 --- a/lib/polyfill/patchedmediakeys_v01b.js +++ b/lib/polyfill/patchedmediakeys_v01b.js @@ -133,9 +133,8 @@ shaka.polyfill.PatchedMediaKeys.v01b.setMediaKeys = function(mediaKeys) { */ shaka.polyfill.PatchedMediaKeys.v01b.getVideoElement_ = function() { var videos = document.getElementsByTagName('video'); - /** @type {!HTMLVideoElement} */ var tmpVideo = videos.length ? videos[0] : document.createElement('video'); - return tmpVideo; + return /** @type {!HTMLVideoElement} */(tmpVideo); }; @@ -923,10 +922,7 @@ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.getStatus = }; -/** - * Array entry 0 is the key, 1 is the value. - * @override - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.entries = function() { var fakeKeyId = @@ -940,22 +936,18 @@ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.entries = }; -/** - * The functor is called with each value. - * @param {function(string)} fn - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.forEach = function(fn) { if (this.status_) { - fn(this.status_); + var fakeKeyId = + shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.KEY_ID_; + fn(this.status_, fakeKeyId); } }; -/** - * @param {BufferSource} keyId - * @return {string|undefined} - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.get = function(keyId) { if (this.has(keyId)) { @@ -965,10 +957,7 @@ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.get = }; -/** - * @param {BufferSource} keyId - * @return {boolean} - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.has = function(keyId) { var fakeKeyId = @@ -981,9 +970,7 @@ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.has = }; -/** - * @override - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.keys = function() { var fakeKeyId = @@ -997,9 +984,7 @@ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.keys = }; -/** - * @override - */ +/** @override */ shaka.polyfill.PatchedMediaKeys.v01b.MediaKeyStatusMap.prototype.values = function() { /** @type {!Array.} */ diff --git a/lib/polyfill/promise.js b/lib/polyfill/promise.js index aa489c402f..5aba2ae0be 100644 --- a/lib/polyfill/promise.js +++ b/lib/polyfill/promise.js @@ -62,7 +62,12 @@ shaka.polyfill.Promise = function(opt_callback) { }; -/** @typedef {{ promise: !shaka.polyfill.Promise, callback: function(*) }} */ +/** + * @typedef {{ + * promise: !shaka.polyfill.Promise, + * callback: (function(*)|undefined) + * }} + */ shaka.polyfill.Promise.Child; diff --git a/lib/util/content_database.js b/lib/util/content_database.js index 19130d2a1c..83f190a730 100644 --- a/lib/util/content_database.js +++ b/lib/util/content_database.js @@ -125,9 +125,8 @@ shaka.util.ContentDatabase.StreamIndex; /** * @typedef {{ - * index: number, * start_time: number, - * end_time: number, + * end_time: ?number, * start_byte: number, * url: string * }}