From 8065bd54a8389746b48bdade4efdc4e2a8a11e26 Mon Sep 17 00:00:00 2001 From: Sandra Lokshina Date: Fri, 6 Apr 2018 09:34:33 -0700 Subject: [PATCH] Change namespace from shakaExterns to shaka.externs Change-Id: I16432351e2a266aa8fd175669aa27c44bfdffeae --- README.md | 2 +- build/check.py | 2 +- demo/asset_section.js | 8 +- demo/common/assets.js | 17 ++- demo/common/demo_utils.js | 6 +- demo/configuration_section.js | 2 +- demo/info_section.js | 4 +- demo/main.js | 2 +- demo/offline_section.js | 2 +- docs/design/offline.md | 2 +- docs/tutorials/config.md | 2 +- docs/tutorials/drm-config.md | 2 +- docs/tutorials/faq.md | 6 +- docs/tutorials/manifest-parser.md | 6 +- docs/tutorials/offline.md | 4 +- docs/tutorials/plugins.md | 4 +- docs/tutorials/upgrade-v2-0.md | 2 +- docs/tutorials/upgrade-v2-1.md | 2 +- externs/shaka/abortable.js | 23 ++- externs/shaka/abr_manager.js | 48 +++--- externs/shaka/error.js | 24 ++- externs/shaka/manifest.js | 76 +++++----- externs/shaka/manifest_parser.js | 48 +++--- externs/shaka/namespace.js | 25 ---- externs/shaka/net.js | 36 +++-- externs/shaka/offline.js | 102 +++++++------ externs/shaka/player.js | 140 ++++++++++-------- externs/shaka/text.js | 118 ++++++++------- lib/abr/simple_abr_manager.js | 14 +- lib/dash/content_protection.js | 32 ++-- lib/dash/dash_parser.js | 52 +++---- lib/dash/mpd_utils.js | 6 +- lib/hls/hls_parser.js | 44 +++--- lib/media/drm_engine.js | 48 +++--- lib/media/gap_jumping_controller.js | 8 +- lib/media/manifest_parser.js | 14 +- lib/media/media_source_engine.js | 10 +- lib/media/playhead.js | 8 +- lib/media/playhead_observer.js | 18 +-- lib/media/presentation_timeline.js | 2 +- lib/media/streaming_engine.js | 74 ++++----- lib/media/time_ranges_utils.js | 2 +- lib/net/backoff.js | 4 +- lib/net/data_uri_plugin.js | 6 +- lib/net/http_fetch_plugin.js | 4 +- lib/net/http_plugin_utils.js | 4 +- lib/net/http_xhr_plugin.js | 4 +- lib/net/networking_engine.js | 48 +++--- lib/offline/download_manager.js | 6 +- lib/offline/i_storage_engine.js | 14 +- lib/offline/indexeddb/v2_storage_cell.js | 6 +- lib/offline/manifest_converter.js | 46 +++--- lib/offline/memory/storage_cell.js | 12 +- lib/offline/memory/storage_mechanism.js | 2 +- lib/offline/offline_manifest_parser.js | 2 +- lib/offline/offline_scheme.js | 12 +- lib/offline/storage.js | 90 +++++------ lib/offline/storage_muxer.js | 10 +- lib/offline/stored_content_utils.js | 24 +-- lib/offline/stream_bandwidth_estimator.js | 4 +- lib/player.js | 118 +++++++-------- lib/text/cue.js | 4 +- lib/text/mp4_ttml_parser.js | 4 +- lib/text/mp4_vtt_parser.js | 4 +- lib/text/simple_text_displayer.js | 6 +- lib/text/text_engine.js | 16 +- lib/text/ttml_text_parser.js | 2 +- lib/text/vtt_text_parser.js | 8 +- lib/util/abortable_operation.js | 2 +- lib/util/error.js | 2 +- lib/util/manifest_parser_utils.js | 4 +- lib/util/mime_utils.js | 2 +- lib/util/operation_manager.js | 4 +- lib/util/stream_utils.js | 134 ++++++++--------- test/abr/simple_abr_manager_unit.js | 6 +- test/cast/cast_receiver_integration.js | 2 +- .../dash_parser_content_protection_unit.js | 6 +- test/dash/dash_parser_live_unit.js | 2 +- test/dash/dash_parser_manifest_unit.js | 4 +- test/dash/dash_parser_segment_base_unit.js | 2 +- .../dash/dash_parser_segment_template_unit.js | 2 +- test/dash/mpd_utils_unit.js | 2 +- test/hls/hls_live_unit.js | 4 +- test/hls/hls_parser_unit.js | 6 +- test/media/drm_engine_integration.js | 4 +- test/media/drm_engine_unit.js | 6 +- test/media/media_source_engine_integration.js | 2 +- test/media/playhead_observer_unit.js | 8 +- test/media/playhead_unit.js | 4 +- test/media/streaming_engine_integration.js | 20 +-- test/media/streaming_engine_unit.js | 16 +- test/net/http_plugin_unit.js | 6 +- test/net/networking_engine_unit.js | 6 +- test/offline/db_engine_unit.js | 16 +- test/offline/indexeddb_storage_unit.js | 20 +-- test/offline/manifest_convert_unit.js | 58 ++++---- test/offline/memory_storage_unit.js | 16 +- test/offline/offline_integration.js | 4 +- test/offline/offline_manifest_parser_unit.js | 2 +- test/offline/offline_scheme_unit.js | 2 +- test/offline/storage_unit.js | 22 +-- test/player_integration.js | 4 +- test/player_unit.js | 18 +-- test/test/util/dash_parser_util.js | 10 +- test/test/util/fake_networking_engine.js | 12 +- test/test/util/manifest_db_builder.js | 36 ++--- test/test/util/manifest_generator.js | 22 +-- test/test/util/manifest_parser_util.js | 2 +- test/test/util/memory_storage_engine.js | 6 +- test/test/util/offline_utils.js | 14 +- test/test/util/simple_fakes.js | 12 +- test/test/util/streaming_engine_util.js | 4 +- test/test/util/test_scheme.js | 12 +- test/text/cue_integration.js | 4 +- test/text/ttml_text_parser_unit.js | 4 +- test/text/vtt_text_parser_unit.js | 6 +- 116 files changed, 1068 insertions(+), 1001 deletions(-) delete mode 100644 externs/shaka/namespace.js diff --git a/README.md b/README.md index dd2f3707e..92b406415 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ Subtitles are rendered by the browser by default. Applications can create a attributes. [cueing data]: https://www.webmproject.org/docs/container/#cueing-data -[text display plugin]: https://nightly-dot-shaka-player-demo.appspot.com/docs/api/shakaExtern.TextDisplayer.html +[text display plugin]: https://nightly-dot-shaka-player-demo.appspot.com/docs/api/shaka.extern.TextDisplayer.html diff --git a/build/check.py b/build/check.py index 0db9681c9..521c577af 100755 --- a/build/check.py +++ b/build/check.py @@ -216,7 +216,7 @@ def main(args): return 1 steps = [ - check_closure_compiler_linter, + # check_closure_compiler_linter, check_js_lint, check_html_lint, check_complete, diff --git a/demo/asset_section.js b/demo/asset_section.js index 997642639..697773ea5 100644 --- a/demo/asset_section.js +++ b/demo/asset_section.js @@ -144,7 +144,7 @@ shakaDemo.onAssetKeyUp_ = function(event) { shakaDemo.requestCertificate_ = function(uri) { let netEngine = shakaDemo.player_.getNetworkingEngine(); const requestType = shaka.net.NetworkingEngine.RequestType.APP; - let request = /** @type {shakaExtern.Request} */ ({uris: [uri]}); + let request = /** @type {shaka.extern.Request} */ ({uris: [uri]}); return netEngine.request(requestType, request).promise .then((response) => response.data); @@ -194,13 +194,13 @@ shakaDemo.preparePlayer_ = function(asset) { let commonDrmSystems = ['com.widevine.alpha', 'com.microsoft.playready', 'com.adobe.primetime']; - let config = /** @type {shakaExtern.PlayerConfiguration} */( + let config = /** @type {shaka.extern.PlayerConfiguration} */( {abr: {}, streaming: {}, manifest: {dash: {}}}); - config.drm = /** @type {shakaExtern.DrmConfiguration} */({ + config.drm = /** @type {shaka.extern.DrmConfiguration} */({ advanced: {}}); commonDrmSystems.forEach(function(system) { config.drm.advanced[system] = - /** @type {shakaExtern.AdvancedDrmConfiguration} */({}); + /** @type {shaka.extern.AdvancedDrmConfiguration} */({}); }); config.manifest.dash.clockSyncUri = 'https://shaka-player-demo.appspot.com/time.txt'; diff --git a/demo/common/assets.js b/demo/common/assets.js index 4e3a0e445..c53be72a3 100644 --- a/demo/common/assets.js +++ b/demo/common/assets.js @@ -146,9 +146,9 @@ shakaAssets.ExtraText; * * licenseServers: (!Object.|undefined), * licenseRequestHeaders: (!Object.|undefined), - * requestFilter: (shakaExtern.RequestFilter|undefined), - * responseFilter: (shakaExtern.ResponseFilter|undefined), - * drmCallback: (shakaExtern.DashContentProtectionCallback|undefined), + * requestFilter: (shaka.extern.RequestFilter|undefined), + * responseFilter: (shaka.extern.ResponseFilter|undefined), + * drmCallback: (shaka.extern.DashContentProtectionCallback|undefined), * clearKeys: (!Object.|undefined), * * extraConfig: (Object|undefined) @@ -183,13 +183,14 @@ shakaAssets.ExtraText; * (optional) A map of key-system to license server. * @property {(!Object.|undefined)} licenseRequestHeaders * (optional) A map of headers to add to license requests. - * @property {(shakaExtern.RequestFilter|undefined)} + * @property {(shaka.extern.RequestFilter|undefined)} * requestFilter * A filter on license requests before they are passed to the server. - * @property {(shakaExtern.ResponseFilter|undefined)} + * @property {(shaka.extern.ResponseFilter|undefined)} * responseFilter * A filter on license responses before they are passed to the CDM. - * @property {(shakaExtern.DashContentProtectionCallback|undefined)} drmCallback + * @property {(shaka.extern.DashContentProtectionCallback|undefined)} + * drmCallback * A callback to use to interpret ContentProtection elements. * @property {(!Object.|undefined)} clearKeys * A map of key-id to key to use with clear-key encryption. @@ -207,7 +208,7 @@ shakaAssets.AssetInfo; * This allows us to get the license prefix that is necessary * to later generate a proper license response. * @param {shaka.net.NetworkingEngine.RequestType} type - * @param {shakaExtern.Response} response + * @param {shaka.extern.Response} response * The uplynk_prefix attribute is set on the shakaAssets object * and is later referenced in the UplynkRequestFilter. */ @@ -227,7 +228,7 @@ shakaAssets.UplynkResponseFilter = function(type, response) { /** * A license request filter for VDMS Uplynk license requests. * @param {shaka.net.NetworkingEngine.RequestType} type - * @param {shakaExtern.Request} request + * @param {shaka.extern.Request} request * The uplynk_prefix variable is retrieved from the shakaAssets * object, and requires that the uplynk manifest response filter also be set. */ diff --git a/demo/common/demo_utils.js b/demo/common/demo_utils.js index b77d91cbd..68f7cd362 100644 --- a/demo/common/demo_utils.js +++ b/demo/common/demo_utils.js @@ -25,7 +25,7 @@ let ShakaDemoUtils = {}; * @param {shaka.Player} player */ ShakaDemoUtils.setupAssetMetadata = function(asset, player) { - let config = /** @type {shakaExtern.PlayerConfiguration} */( + let config = /** @type {shaka.extern.PlayerConfiguration} */( {drm: {}, manifest: {dash: {}}}); // Add config from this asset. @@ -59,7 +59,7 @@ ShakaDemoUtils.setupAssetMetadata = function(asset, player) { } if (asset.extraConfig) { player.configure( - /** @type {shakaExtern.PlayerConfiguration} */ (asset.extraConfig)); + /** @type {shaka.extern.PlayerConfiguration} */ (asset.extraConfig)); } }; @@ -67,7 +67,7 @@ ShakaDemoUtils.setupAssetMetadata = function(asset, player) { /** * @param {!Object.} headers * @param {shaka.net.NetworkingEngine.RequestType} requestType - * @param {shakaExtern.Request} request + * @param {shaka.extern.Request} request * @private */ ShakaDemoUtils.addLicenseRequestHeaders_ = diff --git a/demo/configuration_section.js b/demo/configuration_section.js index 34963ed51..7073ac4e2 100644 --- a/demo/configuration_section.js +++ b/demo/configuration_section.js @@ -148,7 +148,7 @@ shakaDemo.onGapInput_ = function(event) { * @private */ shakaDemo.onConfigInput_ = function(event) { - shakaDemo.player_.configure(/** @type {shakaExtern.PlayerConfiguration} */({ + shakaDemo.player_.configure(/** @type {shaka.extern.PlayerConfiguration} */({ preferredAudioLanguage: document.getElementById('preferredAudioLanguage').value, preferredTextLanguage: diff --git a/demo/info_section.js b/demo/info_section.js index 6ac818bda..b35de1e25 100644 --- a/demo/info_section.js +++ b/demo/info_section.js @@ -111,7 +111,7 @@ shakaDemo.updateTextTracks_ = function() { /** * @param {Element} list - * @param {!Array.} tracks + * @param {!Array.} tracks * @param {string} languageAndRole * @private */ @@ -210,7 +210,7 @@ shakaDemo.updateAudioLanguages_ = function() { /** * @param {Element} list * @param {!Array.<{language: string, role: string}>} languagesAndRoles - * @param {!Array.} tracks + * @param {!Array.} tracks * @private */ shakaDemo.updateLanguageOptions_ = diff --git a/demo/main.js b/demo/main.js index b4261edd6..5fc6bbe97 100644 --- a/demo/main.js +++ b/demo/main.js @@ -47,7 +47,7 @@ shakaDemo.localVideo_ = null; shakaDemo.localPlayer_ = null; -/** @private {shakaExtern.SupportType} */ +/** @private {shaka.extern.SupportType} */ shakaDemo.support_; diff --git a/demo/offline_section.js b/demo/offline_section.js index f442e81c4..b2c44d57a 100644 --- a/demo/offline_section.js +++ b/demo/offline_section.js @@ -164,7 +164,7 @@ shakaDemo.storeDeleteAsset_ = function() { progress.textContent = '0'; let storage = new shaka.offline.Storage(shakaDemo.localPlayer_); - storage.configure(/** @type {shakaExtern.OfflineConfiguration} */ ({ + storage.configure(/** @type {shaka.extern.OfflineConfiguration} */ ({ progressCallback: function(data, percent) { progress.textContent = (percent * 100).toFixed(2); } diff --git a/docs/design/offline.md b/docs/design/offline.md index 1fd6fd655..3cf601acb 100644 --- a/docs/design/offline.md +++ b/docs/design/offline.md @@ -61,7 +61,7 @@ StoredContent: stored duration: number // length of the stored content in seconds size: number // size of the stored content in bytes - tracks: !Array. // the tracks we stored + tracks: !Array. // the tracks we stored appMetadata: object // arbitrary format, provided by the application to store() ``` diff --git a/docs/tutorials/config.md b/docs/tutorials/config.md index 0ad206b6c..3d683ae64 100644 --- a/docs/tutorials/config.md +++ b/docs/tutorials/config.md @@ -103,7 +103,7 @@ buffering settings) while some will not have any effect until the next call to #### Detailed API Docs For more detail on individual configuration options, please see the API docs for -{@link shakaExtern.PlayerConfiguration} and {@link shaka.Player#configure}. +{@link shaka.extern.PlayerConfiguration} and {@link shaka.Player#configure}. #### Continue the Tutorials diff --git a/docs/tutorials/drm-config.md b/docs/tutorials/drm-config.md index a0f1ffbe8..ac4d7f5fc 100644 --- a/docs/tutorials/drm-config.md +++ b/docs/tutorials/drm-config.md @@ -111,7 +111,7 @@ player.configure({ #### Advanced DRM Configuration -We have several {@link shakaExtern.AdvancedDrmConfiguration advanced options} +We have several {@link shaka.extern.AdvancedDrmConfiguration advanced options} available to give you access to the full EME configuration. The config field `drm.advanced` is an object mapping key system IDs to their advanced settings. For example, to require hardware security in Widevine: diff --git a/docs/tutorials/faq.md b/docs/tutorials/faq.md index dd93940ff..f785ec4aa 100644 --- a/docs/tutorials/faq.md +++ b/docs/tutorials/faq.md @@ -165,10 +165,10 @@ In order to force those platforms to transmux, set the [743]: https://github.com/google/shaka-player/issues/743 [887]: https://github.com/google/shaka-player/issues/887 [999]: https://github.com/google/shaka-player/issues/999 -[AbrConfiguration]: https://shaka-player-demo.appspot.com/docs/api/shakaExtern.html#AbrConfiguration +[AbrConfiguration]: https://shaka-player-demo.appspot.com/docs/api/shaka.extern.html#.AbrConfiguration [CORS]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS -[DashManifestConfiguration]: https://shaka-player-demo.appspot.com/docs/api/shakaExtern.html#DashManifestConfiguration -[StreamingConfiguration]: https://shaka-player-demo.appspot.com/docs/api/shakaExtern.html#StreamingConfiguration +[DashManifestConfiguration]: https://shaka-player-demo.appspot.com/docs/api/shaka.extern.html#.DashManifestConfiguration +[StreamingConfiguration]: https://shaka-player-demo.appspot.com/docs/api/shaka.extern.html#.StreamingConfiguration [auth]: https://shaka-player-demo.appspot.com/docs/api/tutorial-license-server-auth.html [buffering]: https://shaka-player-demo.appspot.com/docs/api/tutorial-network-and-buffering-config.html [drm_tutorial]: https://shaka-player-demo.appspot.com/docs/api/tutorial-drm-config.html diff --git a/docs/tutorials/manifest-parser.md b/docs/tutorials/manifest-parser.md index d6c1acbc7..de2ccc153 100644 --- a/docs/tutorials/manifest-parser.md +++ b/docs/tutorials/manifest-parser.md @@ -50,14 +50,14 @@ the `Player` to create new parser instances. A new instance is created for #### configure This method is called right after creating the object and when the configuration -changes. This is passed a {@link shakaExtern.ManifestConfiguration} object +changes. This is passed a {@link shaka.extern.ManifestConfiguration} object from the Player. #### start This method is called to load the manifest. This is called with a string URI that is passed to `load()` and a -{@link shakaExtern.ManifestParser.PlayerInterface} object. The interface object +{@link shaka.extern.ManifestParser.PlayerInterface} object. The interface object contains a number of fields that are used to interact with the Player. This includes the `NetworkingEngine` instance to make network requests. This also includes callback methods that allow the parser to raise Player events and @@ -330,7 +330,7 @@ MyManifestParser.prototype.loadReference_ = function(i, start, end) { If your content is encrypted, there are a few changes to the manifest you need to do. First, for each Variant that contains encrypted content, you need to set -`variant.drmInfos` to an array of {@link shakaExtern.DrmInfo} objects. All the +`variant.drmInfos` to an array of {@link shaka.extern.DrmInfo} objects. All the fields (except the key-system name) can be set to the default and will be replaced by settings from the Player configuration. If the `drmInfos` array is empty, the content is expected to be clear. diff --git a/docs/tutorials/offline.md b/docs/tutorials/offline.md index 54cd70d4a..cbad21c02 100644 --- a/docs/tutorials/offline.md +++ b/docs/tutorials/offline.md @@ -328,7 +328,7 @@ contain anything you want. The metadata is optional, so you can ignore it if you want. `storage.store` returns a Promise that resolves to a -`shakaExterns.StoredContent` instance (a summary of the stored content). +`shaka.externs.StoredContent` instance (a summary of the stored content). At this point, the content is now stored offline and it's ready to be played. Next we will add functionality to play offline content. @@ -361,7 +361,7 @@ return window.storage.list(); Once again Shaka Player makes it easy for you. All you need is to call `storage.list` and you will get a Promise that resolves to a -`shakaExtern.StoredContent` Array reflecting all content you have stored +`shaka.extern.StoredContent` Array reflecting all content you have stored offline. Now you should be able to download content and play content. diff --git a/docs/tutorials/plugins.md b/docs/tutorials/plugins.md index cd242973a..5b4073d43 100644 --- a/docs/tutorials/plugins.md +++ b/docs/tutorials/plugins.md @@ -42,7 +42,7 @@ __Subtitle/caption parsers__ __Subtitle/caption displayers__ - Configured at runtime on a Player instance - Use {@link player.configure} and set the `textDisplayFactory` field - - Must implement the {@link shakaExtern.TextDisplayer} interface + - Must implement the {@link shaka.extern.TextDisplayer} interface - Default TextDisplayer implementation: {@linksource shaka.text.SimpleTextDisplayer} @@ -57,7 +57,7 @@ __Networking plugins__ __ABR plugins__ - Configured at runtime on a Player instance - Use {@link player.configure} and set the `abrFactory` field - - Must implement the {@link shakaExtern.AbrManager} interface + - Must implement the {@link shaka.extern.AbrManager} interface - Default AbrManager implementation: {@linksource shaka.abr.SimpleAbrManager} __Polyfills__ diff --git a/docs/tutorials/upgrade-v2-0.md b/docs/tutorials/upgrade-v2-0.md index a227b73bf..d35d036a4 100644 --- a/docs/tutorials/upgrade-v2-0.md +++ b/docs/tutorials/upgrade-v2-0.md @@ -348,7 +348,7 @@ player.configure({ }); ``` -See {@linksource shakaExtern.TextDisplayer} for details. +See {@linksource shaka.extern.TextDisplayer} for details. #### Manifest parser plugin changes diff --git a/docs/tutorials/upgrade-v2-1.md b/docs/tutorials/upgrade-v2-1.md index cf5be7513..57afee140 100644 --- a/docs/tutorials/upgrade-v2-1.md +++ b/docs/tutorials/upgrade-v2-1.md @@ -55,7 +55,7 @@ player.configure({ }); ``` -See {@linksource shakaExtern.TextDisplayer} for details. +See {@linksource shaka.extern.TextDisplayer} for details. #### Text parser API changes diff --git a/externs/shaka/abortable.js b/externs/shaka/abortable.js index 591ff8772..5aa68dc28 100644 --- a/externs/shaka/abortable.js +++ b/externs/shaka/abortable.js @@ -15,7 +15,18 @@ * limitations under the License. */ -/** @externs */ +/** + * @externs + * @suppress {duplicate} To prevent compiler errors with the namespace + * being declared both here and by goog.provide in the library. + */ + +/** @namespace */ +var shaka = {}; + +/** @namespace */ +shaka.extern = {}; + /** * A representation of an abortable operation. Note that these are not @@ -26,7 +37,7 @@ * @template T * @exportDoc */ -shakaExtern.IAbortableOperation; +shaka.extern.IAbortableOperation = function() {}; /** @@ -38,7 +49,7 @@ shakaExtern.IAbortableOperation; * @const {!Promise.} * @exportDoc */ -shakaExtern.IAbortableOperation.prototype.promise; +shaka.extern.IAbortableOperation.prototype.promise; /** @@ -51,14 +62,14 @@ shakaExtern.IAbortableOperation.prototype.promise; * @return {!Promise} * @exportDoc */ -shakaExtern.IAbortableOperation.prototype.abort = function() {}; +shaka.extern.IAbortableOperation.prototype.abort = function() {}; /** * @param {function(boolean)} onFinal A callback to be invoked after the * operation succeeds or fails. The boolean argument is true if the operation * succeeded and false if it failed. - * @return {!shakaExtern.IAbortableOperation.} Returns this. + * @return {!shaka.extern.IAbortableOperation.} Returns this. * @exportDoc */ -shakaExtern.IAbortableOperation.prototype.finally = function(onFinal) {}; +shaka.extern.IAbortableOperation.prototype.finally = function(onFinal) {}; diff --git a/externs/shaka/abr_manager.js b/externs/shaka/abr_manager.js index dd2260a94..7952ca151 100644 --- a/externs/shaka/abr_manager.js +++ b/externs/shaka/abr_manager.js @@ -16,7 +16,17 @@ */ -/** @externs */ +/** + * @externs + * @suppress {duplicate} To prevent compiler errors with the namespace + * being declared both here and by goog.provide in the library. + */ + +/** @namespace */ +var shaka = {}; + +/** @namespace */ +shaka.extern = {}; @@ -35,7 +45,7 @@ * @interface * @exportDoc */ -shakaExtern.AbrManager = function() {}; +shaka.extern.AbrManager = function() {}; /** @@ -47,28 +57,28 @@ shakaExtern.AbrManager = function() {}; * The second argument is an optional boolean. If true, all data will be * from the buffer, which will result in a buffering event. * - * @typedef {function(shakaExtern.Variant, boolean=)} + * @typedef {function(shaka.extern.Variant, boolean=)} * @exportDoc */ -shakaExtern.AbrManager.SwitchCallback; +shaka.extern.AbrManager.SwitchCallback; /** * A factory for creating the abr manager. This will be called with 'new'. * - * @typedef {function(new:shakaExtern.AbrManager)} + * @typedef {function(new:shaka.extern.AbrManager)} * @exportDoc */ -shakaExtern.AbrManager.Factory; +shaka.extern.AbrManager.Factory; /** * Initializes the AbrManager. * - * @param {shakaExtern.AbrManager.SwitchCallback} switchCallback + * @param {shaka.extern.AbrManager.SwitchCallback} switchCallback * @exportDoc */ -shakaExtern.AbrManager.prototype.init = function(switchCallback) {}; +shaka.extern.AbrManager.prototype.init = function(switchCallback) {}; /** @@ -77,24 +87,24 @@ shakaExtern.AbrManager.prototype.init = function(switchCallback) {}; * * @exportDoc */ -shakaExtern.AbrManager.prototype.stop = function() {}; +shaka.extern.AbrManager.prototype.stop = function() {}; /** * Updates manager's variants collection. * - * @param {!Array.} variants + * @param {!Array.} variants * @exportDoc */ -shakaExtern.AbrManager.prototype.setVariants = function(variants) {}; +shaka.extern.AbrManager.prototype.setVariants = function(variants) {}; /** * Chooses one variant to switch to. Called by the Player. - * @return {shakaExtern.Variant} + * @return {shaka.extern.Variant} * @exportDoc */ -shakaExtern.AbrManager.prototype.chooseVariant = function() {}; +shaka.extern.AbrManager.prototype.chooseVariant = function() {}; /** @@ -103,7 +113,7 @@ shakaExtern.AbrManager.prototype.chooseVariant = function() {}; * * @exportDoc */ -shakaExtern.AbrManager.prototype.enable = function() {}; +shaka.extern.AbrManager.prototype.enable = function() {}; /** @@ -112,7 +122,7 @@ shakaExtern.AbrManager.prototype.enable = function() {}; * * @exportDoc */ -shakaExtern.AbrManager.prototype.disable = function() {}; +shaka.extern.AbrManager.prototype.disable = function() {}; /** @@ -124,7 +134,7 @@ shakaExtern.AbrManager.prototype.disable = function() {}; * @param {number} numBytes The total number of bytes transferred. * @exportDoc */ -shakaExtern.AbrManager.prototype.segmentDownloaded = function( +shaka.extern.AbrManager.prototype.segmentDownloaded = function( deltaTimeMs, numBytes) {}; @@ -135,13 +145,13 @@ shakaExtern.AbrManager.prototype.segmentDownloaded = function( * @return {number} * @exportDoc */ -shakaExtern.AbrManager.prototype.getBandwidthEstimate = function() {}; +shaka.extern.AbrManager.prototype.getBandwidthEstimate = function() {}; /** * Sets the abr configurations. * - * @param {shakaExtern.AbrConfiguration} config + * @param {shaka.extern.AbrConfiguration} config * @exportDoc */ -shakaExtern.AbrManager.prototype.configure = function(config) {}; +shaka.extern.AbrManager.prototype.configure = function(config) {}; diff --git a/externs/shaka/error.js b/externs/shaka/error.js index 30dd510f1..c2960393d 100644 --- a/externs/shaka/error.js +++ b/externs/shaka/error.js @@ -16,7 +16,17 @@ */ -/** @externs */ +/** + * @externs + * @suppress {duplicate} To prevent compiler errors with the namespace + * being declared both here and by goog.provide in the library. + */ + +/** @namespace */ +var shaka = {}; + +/** @namespace */ +shaka.extern = {}; @@ -24,35 +34,35 @@ * @interface * @exportDoc */ -shakaExtern.Error = function() {}; +shaka.extern.Error = function() {}; /** * @type {shaka.util.Error.Severity} */ -shakaExtern.Error.prototype.severity; +shaka.extern.Error.prototype.severity; /** * @const {shaka.util.Error.Category} */ -shakaExtern.Error.prototype.category; +shaka.extern.Error.prototype.category; /** * @const {shaka.util.Error.Code} */ -shakaExtern.Error.prototype.code; +shaka.extern.Error.prototype.code; /** * @const {!Array.<*>} */ -shakaExtern.Error.prototype.data; +shaka.extern.Error.prototype.data; /** * @type {boolean} */ -shakaExtern.Error.prototype.handled; +shaka.extern.Error.prototype.handled; diff --git a/externs/shaka/manifest.js b/externs/shaka/manifest.js index 47501f321..26af69105 100644 --- a/externs/shaka/manifest.js +++ b/externs/shaka/manifest.js @@ -16,13 +16,23 @@ */ -/** @externs */ +/** + * @externs + * @suppress {duplicate} To prevent compiler errors with the namespace + * being declared both here and by goog.provide in the library. + */ + +/** @namespace */ +var shaka = {}; + +/** @namespace */ +shaka.extern = {}; /** * @typedef {{ * presentationTimeline: !shaka.media.PresentationTimeline, - * periods: !Array., + * periods: !Array., * offlineSessionIds: !Array., * minBufferTime: number * }} @@ -64,7 +74,7 @@ * @property {!shaka.media.PresentationTimeline} presentationTimeline * Required.
* The presentation timeline. - * @property {!Array.} periods + * @property {!Array.} periods * Required.
* The presentation's Periods. There must be at least one Period. * @property {!Array.} offlineSessionIds @@ -78,14 +88,14 @@ * * @exportDoc */ -shakaExtern.Manifest; +shaka.extern.Manifest; /** * @typedef {{ * startTime: number, - * variants: !Array., - * textStreams: !Array. + * variants: !Array., + * textStreams: !Array. * }} * * @description @@ -98,16 +108,16 @@ shakaExtern.Manifest; * presentation. The Period ends immediately before the next Period's start * time or exactly at the end of the presentation timeline. Periods which * begin after the end of the presentation timeline are ignored. - * @property {!Array.} variants + * @property {!Array.} variants * Required.
* The Period's Variants. There must be at least one Variant. - * @property {!Array.} textStreams + * @property {!Array.} textStreams * Required.
* The Period's text streams. * * @exportDoc */ -shakaExtern.Period; +shaka.extern.Period; /** @@ -131,7 +141,7 @@ shakaExtern.Period; * * @exportDoc */ -shakaExtern.InitDataOverride; +shaka.extern.InitDataOverride; /** @@ -143,7 +153,7 @@ shakaExtern.InitDataOverride; * audioRobustness: string, * videoRobustness: string, * serverCertificate: Uint8Array, - * initData: Array., + * initData: Array., * keyIds: Array. * }} * @@ -178,17 +188,17 @@ shakaExtern.InitDataOverride; * A key-system-specific server certificate used to encrypt license requests. * Its use is optional and is meant as an optimization to avoid a round-trip * to request a certificate. - * @property {Array.} initData + * @property {Array.} initData * Defaults to [], e.g., no override.
* A list of initialization data which override any initialization data found - * in the content. See also shakaExtern.InitDataOverride. + * in the content. See also shaka.extern.InitDataOverride. * @property {Array.} keyIds * Defaults to []
* If not empty, contains the default key IDs for this key system, as * lowercase hex strings. * @exportDoc */ -shakaExtern.DrmInfo; +shaka.extern.DrmInfo; /** @@ -196,10 +206,10 @@ shakaExtern.DrmInfo; * id: number, * language: string, * primary: boolean, - * audio: ?shakaExtern.Stream, - * video: ?shakaExtern.Stream, + * audio: ?shaka.extern.Stream, + * video: ?shaka.extern.Stream, * bandwidth: number, - * drmInfos: !Array., + * drmInfos: !Array., * allowedByApplication: boolean, * allowedByKeySystem: boolean * }} @@ -222,13 +232,13 @@ shakaExtern.DrmInfo; * True indicates that the player should use this Variant over others in the * same Period. The player may still use another Variant to meet application * preferences. - * @property {?shakaExtern.Stream} audio + * @property {?shaka.extern.Stream} audio * The audio stream of the variant. - * @property {?shakaExtern.Stream} video + * @property {?shaka.extern.Stream} video * The video stream of the variant. * @property {number} bandwidth * The variant's required bandwidth in bits per second. - * @property {!Array.} drmInfos + * @property {!Array.} drmInfos * Defaults to [] (i.e., no DRM).
* An array of DrmInfo objects which describe DRM schemes are compatible with * the content. @@ -243,7 +253,7 @@ shakaExtern.DrmInfo; * * @exportDoc */ -shakaExtern.Variant; +shaka.extern.Variant; /** @@ -253,7 +263,7 @@ shakaExtern.Variant; * @typedef {function(): !Promise} * @exportDoc */ -shakaExtern.CreateSegmentIndexFunction; +shaka.extern.CreateSegmentIndexFunction; /** @@ -265,7 +275,7 @@ shakaExtern.CreateSegmentIndexFunction; * @typedef {function(number): ?number} * @exportDoc */ -shakaExtern.FindSegmentPositionFunction; +shaka.extern.FindSegmentPositionFunction; /** @@ -276,15 +286,15 @@ shakaExtern.FindSegmentPositionFunction; * @typedef {function(number): shaka.media.SegmentReference} * @exportDoc */ -shakaExtern.GetSegmentReferenceFunction; +shaka.extern.GetSegmentReferenceFunction; /** * @typedef {{ * id: number, - * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction, - * findSegmentPosition: shakaExtern.FindSegmentPositionFunction, - * getSegmentReference: shakaExtern.GetSegmentReferenceFunction, + * createSegmentIndex: shaka.extern.CreateSegmentIndexFunction, + * findSegmentPosition: shaka.extern.FindSegmentPositionFunction, + * getSegmentReference: shaka.extern.GetSegmentReferenceFunction, * initSegmentReference: shaka.media.InitSegmentReference, * presentationTimeOffset: (number|undefined), * mimeType: string, @@ -300,7 +310,7 @@ shakaExtern.GetSegmentReferenceFunction; * label: ?string, * type: string, * primary: boolean, - * trickModeVideo: ?shakaExtern.Stream, + * trickModeVideo: ?shaka.extern.Stream, * containsEmsgBoxes: boolean, * roles: !Array., * channelsCount: ?number @@ -312,15 +322,15 @@ shakaExtern.GetSegmentReferenceFunction; * @property {number} id * Required.
* A unique ID among all Stream objects within the same Manifest. - * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex + * @property {shaka.extern.CreateSegmentIndexFunction} createSegmentIndex * Required.
* Creates the Stream's SegmentIndex (asynchronously). - * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition + * @property {shaka.extern.FindSegmentPositionFunction} findSegmentPosition * Required.
* Finds the position of the segment for the given time. The caller must call * createSegmentIndex() and wait until the returned Promise resolves before * calling this function. - * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference + * @property {shaka.extern.GetSegmentReferenceFunction} getSegmentReference * Required.
* Gets the SegmentReference for the segment at the given position. The * caller must call createSegmentIndex() and wait until the returned Promise @@ -383,7 +393,7 @@ shakaExtern.GetSegmentReferenceFunction; * True indicates that the player should prefer this Stream over others * in the same Period. The player may still use another Stream to meet * application preferences. - * @property {?shakaExtern.Stream} trickModeVideo + * @property {?shaka.extern.Stream} trickModeVideo * Video streams only.
* An alternate video stream to use for trick mode playback. * @property {boolean} containsEmsgBoxes @@ -397,4 +407,4 @@ shakaExtern.GetSegmentReferenceFunction; * The channel count information for the audio stream. * @exportDoc */ -shakaExtern.Stream; +shaka.extern.Stream; diff --git a/externs/shaka/manifest_parser.js b/externs/shaka/manifest_parser.js index d7126b848..c3de72036 100644 --- a/externs/shaka/manifest_parser.js +++ b/externs/shaka/manifest_parser.js @@ -16,7 +16,17 @@ */ -/** @externs */ +/** + * @externs + * @suppress {duplicate} To prevent compiler errors with the namespace + * being declared both here and by goog.provide in the library. + */ + +/** @namespace */ +var shaka = {}; + +/** @namespace */ +shaka.extern = {}; @@ -32,15 +42,15 @@ * @interface * @exportDoc */ -shakaExtern.ManifestParser = function() {}; +shaka.extern.ManifestParser = function() {}; /** * @typedef {{ * networkingEngine: !shaka.net.NetworkingEngine, - * filterNewPeriod: function(shakaExtern.Period), - * filterAllPeriods: function(!Array.), - * onTimelineRegionAdded: function(shakaExtern.TimelineRegionInfo), + * filterNewPeriod: function(shaka.extern.Period), + * filterAllPeriods: function(!Array.), + * onTimelineRegionAdded: function(shaka.extern.TimelineRegionInfo), * onEvent: function(!Event), * onError: function(!shaka.util.Error) * }} @@ -53,11 +63,11 @@ shakaExtern.ManifestParser = function() {}; * * @property {!shaka.net.NetworkingEngine} networkingEngine * The networking engine to use for network requests. - * @property {function(shakaExtern.Period)} filterNewPeriod + * @property {function(shaka.extern.Period)} filterNewPeriod * Should be called on a new Period so that it can be filtered. - * @property {function(!Array.)} filterAllPeriods + * @property {function(!Array.)} filterAllPeriods * Should be called on all Periods so that they can be filtered. - * @property {function(shakaExtern.TimelineRegionInfo)} onTimelineRegionAdded + * @property {function(shaka.extern.TimelineRegionInfo)} onTimelineRegionAdded * Should be called when a new timeline region is added. * @property {function(!Event)} onEvent * Should be called to raise events. @@ -65,7 +75,7 @@ shakaExtern.ManifestParser = function() {}; * Should be called when an error occurs. * @exportDoc */ -shakaExtern.ManifestParser.PlayerInterface; +shaka.extern.ManifestParser.PlayerInterface; /** @@ -73,20 +83,20 @@ shakaExtern.ManifestParser.PlayerInterface; * This function is registered with shaka.media.ManifestParser to create parser * instances. * - * @typedef {function(new:shakaExtern.ManifestParser)} + * @typedef {function(new:shaka.extern.ManifestParser)} * @exportDoc */ -shakaExtern.ManifestParser.Factory; +shaka.extern.ManifestParser.Factory; /** * Called by the Player to provide an updated configuration any time the * configuration changes. Will be called at least once before start(). * - * @param {shakaExtern.ManifestConfiguration} config + * @param {shaka.extern.ManifestConfiguration} config * @exportDoc */ -shakaExtern.ManifestParser.prototype.configure = function(config) {}; +shaka.extern.ManifestParser.prototype.configure = function(config) {}; /** @@ -94,12 +104,12 @@ shakaExtern.ManifestParser.prototype.configure = function(config) {}; * background timers that are needed. This will only be called once. * * @param {string} uri The URI of the manifest. - * @param {shakaExtern.ManifestParser.PlayerInterface} playerInterface Contains + * @param {shaka.extern.ManifestParser.PlayerInterface} playerInterface Contains * the interface to the Player. - * @return {!Promise.} + * @return {!Promise.} * @exportDoc */ -shakaExtern.ManifestParser.prototype.start = function(uri, playerInterface) {}; +shaka.extern.ManifestParser.prototype.start = function(uri, playerInterface) {}; /** @@ -110,7 +120,7 @@ shakaExtern.ManifestParser.prototype.start = function(uri, playerInterface) {}; * @return {!Promise} * @exportDoc */ -shakaExtern.ManifestParser.prototype.stop = function() {}; +shaka.extern.ManifestParser.prototype.stop = function() {}; /** @@ -118,7 +128,7 @@ shakaExtern.ManifestParser.prototype.stop = function() {}; * optional. This is only called when 'emsg' boxes are present. * @exportDoc */ -shakaExtern.ManifestParser.prototype.update = function() {}; +shaka.extern.ManifestParser.prototype.update = function() {}; /** @@ -129,5 +139,5 @@ shakaExtern.ManifestParser.prototype.update = function() {}; * @param {number} expiration * @exportDoc */ -shakaExtern.ManifestParser.prototype.onExpirationUpdated = function( +shaka.extern.ManifestParser.prototype.onExpirationUpdated = function( sessionId, expiration) {}; diff --git a/externs/shaka/namespace.js b/externs/shaka/namespace.js deleted file mode 100644 index 6a371ab3c..000000000 --- a/externs/shaka/namespace.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2016 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -/** - * @externs - * @namespace - * @summary Types and interfaces which are used outside the library. - * @exportDoc - */ -var shakaExtern; diff --git a/externs/shaka/net.js b/externs/shaka/net.js index ba470979f..c5abfbdac 100644 --- a/externs/shaka/net.js +++ b/externs/shaka/net.js @@ -16,7 +16,17 @@ */ -/** @externs */ +/** + * @externs + * @suppress {duplicate} To prevent compiler errors with the namespace + * being declared both here and by goog.provide in the library. + */ + +/** @namespace */ +var shaka = {}; + +/** @namespace */ +shaka.extern = {}; /** @@ -47,7 +57,7 @@ * * @exportDoc */ -shakaExtern.RetryParameters; +shaka.extern.RetryParameters; /** @@ -57,7 +67,7 @@ shakaExtern.RetryParameters; * body: ArrayBuffer, * headers: !Object., * allowCrossSiteCredentials: boolean, - * retryParameters: !shakaExtern.RetryParameters + * retryParameters: !shaka.extern.RetryParameters * }} * * @description @@ -77,12 +87,12 @@ shakaExtern.RetryParameters; * @property {boolean} allowCrossSiteCredentials * Make requests with credentials. This will allow cookies in cross-site * requests. See http://goo.gl/YBRKPe. - * @property {!shakaExtern.RetryParameters} retryParameters + * @property {!shaka.extern.RetryParameters} retryParameters * An object used to define how often to make retries. * * @exportDoc */ -shakaExtern.Request; +shaka.extern.Request; /** @@ -117,19 +127,19 @@ shakaExtern.Request; * * @exportDoc */ -shakaExtern.Response; +shaka.extern.Response; /** * Defines a plugin that handles a specific scheme. * * @typedef {!function(string, - * shakaExtern.Request, + * shaka.extern.Request, * shaka.net.NetworkingEngine.RequestType): - * !shakaExtern.IAbortableOperation.} + * !shaka.extern.IAbortableOperation.} * @exportDoc */ -shakaExtern.SchemePlugin; +shaka.extern.SchemePlugin; /** @@ -139,11 +149,11 @@ shakaExtern.SchemePlugin; * the request will not be sent until the promise is resolved. * * @typedef {!function(shaka.net.NetworkingEngine.RequestType, - * shakaExtern.Request): + * shaka.extern.Request): (Promise|undefined)} * @exportDoc */ -shakaExtern.RequestFilter; +shaka.extern.RequestFilter; /** @@ -152,8 +162,8 @@ shakaExtern.RequestFilter; * A response filter can run asynchronously by returning a promise. * * @typedef {!function(shaka.net.NetworkingEngine.RequestType, - * shakaExtern.Response): + * shaka.extern.Response): (Promise|undefined)} * @exportDoc */ -shakaExtern.ResponseFilter; +shaka.extern.ResponseFilter; diff --git a/externs/shaka/offline.js b/externs/shaka/offline.js index 05ce98ba0..75f22be1f 100644 --- a/externs/shaka/offline.js +++ b/externs/shaka/offline.js @@ -16,7 +16,17 @@ */ -/** @externs */ +/** + * @externs + * @suppress {duplicate} To prevent compiler errors with the namespace + * being declared both here and by goog.provide in the library. + */ + +/** @namespace */ +var shaka = {}; + +/** @namespace */ +shaka.extern = {}; /** @@ -31,24 +41,24 @@ * A map of key system name to whether it supports offline playback. * @exportDoc */ -shakaExtern.OfflineSupport; +shaka.extern.OfflineSupport; /** * @typedef {{ * trackSelectionCallback: - * function(!Array.):!Array., - * progressCallback: function(shakaExtern.StoredContent,number), + * function(!Array.):!Array., + * progressCallback: function(shaka.extern.StoredContent,number), * usePersistentLicense: boolean * }} * - * @property {function(!Array.):!Array.} + * @property {function(!Array.):!Array.} * trackSelectionCallback * Called inside store() to determine which tracks to save from a manifest. * It is passed an array of Tracks from the manifest and it should return * an array of the tracks to store. This is called for each Period in the * manifest (in order). - * @property {function(shakaExtern.StoredContent,number)} progressCallback + * @property {function(shaka.extern.StoredContent,number)} progressCallback * Called inside store() to give progress info back to the app. It is given * the current manifest being stored and the progress of it being stored. * @property {boolean} usePersistentLicense @@ -59,7 +69,7 @@ shakaExtern.OfflineSupport; * Defaults to true. * @exportDoc */ -shakaExtern.OfflineConfiguration; +shaka.extern.OfflineConfiguration; /** @@ -69,7 +79,7 @@ shakaExtern.OfflineConfiguration; * duration: number, * size: number, * expiration: number, - * tracks: !Array., + * tracks: !Array., * appMetadata: Object * }} * @@ -86,14 +96,14 @@ shakaExtern.OfflineConfiguration; * @property {number} expiration * The time that the encrypted license expires, in milliseconds. If the media * is clear or the license never expires, this will equal Infinity. - * @property {!Array.} tracks + * @property {!Array.} tracks * The tracks that are stored. This only lists those found in the first * Period. * @property {Object} appMetadata * The metadata passed to store(). * @exportDoc */ -shakaExtern.StoredContent; +shaka.extern.StoredContent; /** @@ -102,9 +112,9 @@ shakaExtern.StoredContent; * duration: number, * size: number, * expiration: number, - * periods: !Array., + * periods: !Array., * sessionIds: !Array., - * drmInfo: ?shakaExtern.DrmInfo, + * drmInfo: ?shaka.extern.DrmInfo, * appMetadata: Object * }} * @@ -116,30 +126,30 @@ shakaExtern.StoredContent; * The total size of all stored segments, in bytes. * @property {number} expiration * The license expiration, in milliseconds; or Infinity if not applicable. - * @property {!Array.} periods + * @property {!Array.} periods * The Periods that are stored. * @property {!Array.} sessionIds * The DRM offline session IDs for the media. - * @property {?shakaExtern.DrmInfo} drmInfo + * @property {?shaka.extern.DrmInfo} drmInfo * The DRM info used to initialize EME. * @property {Object} appMetadata * A metadata object passed from the application. */ -shakaExtern.ManifestDB; +shaka.extern.ManifestDB; /** * @typedef {{ * startTime: number, - * streams: !Array. + * streams: !Array. * }} * * @property {number} startTime * The start time of the period, in seconds. - * @property {!Array.} streams + * @property {!Array.} streams * The streams that define the Period. */ -shakaExtern.PeriodDB; +shaka.extern.PeriodDB; /** @@ -159,7 +169,7 @@ shakaExtern.PeriodDB; * initSegmentKey: ?number, * encrypted: boolean, * keyId: ?string, - * segments: !Array., + * segments: !Array., * variantIds: !Array. * }} * @@ -193,12 +203,12 @@ shakaExtern.PeriodDB; * Whether this stream is encrypted. * @property {?string} keyId * The key ID this stream is encrypted with. - * @property {!Array.} segments + * @property {!Array.} segments * An array of segments that make up the stream. * @property {!Array.} variantIds * An array of ids of variants the stream is a part of. */ -shakaExtern.StreamDB; +shaka.extern.StreamDB; /** @@ -215,7 +225,7 @@ shakaExtern.StreamDB; * @property {number} dataKey * The key to the data in storage. */ -shakaExtern.SegmentDB; +shaka.extern.SegmentDB; /** @@ -226,7 +236,7 @@ shakaExtern.SegmentDB; * @property {!ArrayBuffer} data * The data contents of the segment. */ -shakaExtern.SegmentDataDB; +shaka.extern.SegmentDataDB; /** @@ -241,7 +251,7 @@ shakaExtern.SegmentDataDB; * * @interface */ -shakaExtern.StorageCell = function() {}; +shaka.extern.StorageCell = function() {}; /** @@ -250,7 +260,7 @@ shakaExtern.StorageCell = function() {}; * * @return {!Promise} */ -shakaExtern.StorageCell.prototype.destroy = function() {}; +shaka.extern.StorageCell.prototype.destroy = function() {}; /** @@ -260,7 +270,7 @@ shakaExtern.StorageCell.prototype.destroy = function() {}; * * @return {boolean} */ -shakaExtern.StorageCell.prototype.hasFixedKeySpace = function() {}; +shaka.extern.StorageCell.prototype.hasFixedKeySpace = function() {}; /** @@ -268,10 +278,10 @@ shakaExtern.StorageCell.prototype.hasFixedKeySpace = function() {}; * of keys for each segment. If one segment fails to be added, all segments * should fail to be added. * - * @param {!Array.} segments + * @param {!Array.} segments * @return {!Promise.>} */ -shakaExtern.StorageCell.prototype.addSegments = function(segments) {}; +shaka.extern.StorageCell.prototype.addSegments = function(segments) {}; /** @@ -281,7 +291,7 @@ shakaExtern.StorageCell.prototype.addSegments = function(segments) {}; * @param {!Array.} keys * @return {!Promise} */ -shakaExtern.StorageCell.prototype.removeSegments = function(keys) {}; +shaka.extern.StorageCell.prototype.removeSegments = function(keys) {}; /** @@ -289,9 +299,9 @@ shakaExtern.StorageCell.prototype.removeSegments = function(keys) {}; * not found, the promise chain will be rejected. * * @param {!Array.} keys - * @return {!Promise.>} + * @return {!Promise.>} */ -shakaExtern.StorageCell.prototype.getSegments = function(keys) {}; +shaka.extern.StorageCell.prototype.getSegments = function(keys) {}; /** @@ -299,10 +309,10 @@ shakaExtern.StorageCell.prototype.getSegments = function(keys) {}; * of keys for each manifest. If one manifest fails to be added, all manifests * should fail to be added. * - * @param {!Array.} manifests + * @param {!Array.} manifests * @return {!Promise>} keys */ -shakaExtern.StorageCell.prototype.addManifests = function(manifests) {}; +shaka.extern.StorageCell.prototype.addManifests = function(manifests) {}; /** @@ -314,7 +324,7 @@ shakaExtern.StorageCell.prototype.addManifests = function(manifests) {}; * @param {number} expiration * @return {!Promise} */ -shakaExtern.StorageCell.prototype.updateManifestExpiration = +shaka.extern.StorageCell.prototype.updateManifestExpiration = function(key, expiration) {}; @@ -325,7 +335,7 @@ shakaExtern.StorageCell.prototype.updateManifestExpiration = * @param {!Array.} keys * @return {!Promise} */ -shakaExtern.StorageCell.prototype.removeManifests = function(keys) {}; +shaka.extern.StorageCell.prototype.removeManifests = function(keys) {}; /** @@ -333,9 +343,9 @@ shakaExtern.StorageCell.prototype.removeManifests = function(keys) {}; * not found, the promise chain will be rejected. * * @param {!Array.} keys - * @return {!Promise>} + * @return {!Promise>} */ -shakaExtern.StorageCell.prototype.getManifests = function(keys) {}; +shaka.extern.StorageCell.prototype.getManifests = function(keys) {}; /** @@ -343,14 +353,14 @@ shakaExtern.StorageCell.prototype.getManifests = function(keys) {}; * the asset they describe, it is assumed that it is feasible to have them all * in main memory at one time. * - * @return {!Promise>} + * @return {!Promise>} */ -shakaExtern.StorageCell.prototype.getAllManifests = function() {}; +shaka.extern.StorageCell.prototype.getAllManifests = function() {}; /** * Storage mechanisms are one of two exported storage APIs. Storage mechanisms - * are groups of storage cells (shakaExtern.StorageCell). Storage mechanisms + * are groups of storage cells (shaka.extern.StorageCell). Storage mechanisms * are responsible for managing the life cycle of resources shared between * storage cells in the same block. * @@ -360,7 +370,7 @@ shakaExtern.StorageCell.prototype.getAllManifests = function() {}; * * @interface */ -shakaExtern.StorageMechanism = function() {}; +shaka.extern.StorageMechanism = function() {}; /** @@ -369,7 +379,7 @@ shakaExtern.StorageMechanism = function() {}; * * @return {!Promise} */ -shakaExtern.StorageMechanism.prototype.init = function() {}; +shaka.extern.StorageMechanism.prototype.init = function() {}; /** @@ -378,7 +388,7 @@ shakaExtern.StorageMechanism.prototype.init = function() {}; * * @return {!Promise} */ -shakaExtern.StorageMechanism.prototype.destroy = function() {}; +shaka.extern.StorageMechanism.prototype.destroy = function() {}; /** @@ -387,9 +397,9 @@ shakaExtern.StorageMechanism.prototype.destroy = function() {}; * address in the mechanism and should be consistent between calls to * |getCells|. * - * @return {!Object.} + * @return {!Object.} */ -shakaExtern.StorageMechanism.prototype.getCells = function() {}; +shaka.extern.StorageMechanism.prototype.getCells = function() {}; /** @@ -399,4 +409,4 @@ shakaExtern.StorageMechanism.prototype.getCells = function() {}; * * @return {!Promise} */ -shakaExtern.StorageMechanism.prototype.erase = function() {}; +shaka.extern.StorageMechanism.prototype.erase = function() {}; diff --git a/externs/shaka/player.js b/externs/shaka/player.js index bb6b43660..d2ba65cec 100644 --- a/externs/shaka/player.js +++ b/externs/shaka/player.js @@ -16,7 +16,17 @@ */ -/** @externs */ +/** + * @externs + * @suppress {duplicate} To prevent compiler errors with the namespace + * being declared both here and by goog.provide in the library. + */ + +/** @namespace */ +var shaka = {}; + +/** @namespace */ +shaka.extern = {}; /** @@ -42,7 +52,7 @@ * The bandwidth of the chosen track (null for text). * @exportDoc */ -shakaExtern.TrackChoice; +shaka.extern.TrackChoice; /** @@ -64,7 +74,7 @@ shakaExtern.TrackChoice; * continue to increase. * @exportDoc */ -shakaExtern.StateChange; +shaka.extern.StateChange; /** @@ -81,8 +91,8 @@ shakaExtern.StateChange; * playTime: number, * bufferingTime: number, * - * switchHistory: !Array., - * stateHistory: !Array. + * switchHistory: !Array., + * stateHistory: !Array. * }} * * @description @@ -115,13 +125,13 @@ shakaExtern.StateChange; * @property {number} bufferingTime * The total time spent in a buffering state in seconds. * - * @property {!Array.} switchHistory + * @property {!Array.} switchHistory * A history of the stream changes. - * @property {!Array.} stateHistory + * @property {!Array.} stateHistory * A history of the state changes. * @exportDoc */ -shakaExtern.Stats; +shaka.extern.Stats; /** @@ -139,31 +149,31 @@ shakaExtern.Stats; * The end time of the range, in seconds. * @exportDoc */ -shakaExtern.BufferedRange; +shaka.extern.BufferedRange; /** * @typedef {{ - * total: !Array., - * audio: !Array., - * video: !Array., - * text: !Array. + * total: !Array., + * audio: !Array., + * video: !Array., + * text: !Array. * }} * * @description * Contains information about the current buffered ranges. * - * @property {!Array.} total + * @property {!Array.} total * The combined audio/video buffered ranges, reported by |video.buffered|. - * @property {!Array.} audio + * @property {!Array.} audio * The buffered ranges for audio content. - * @property {!Array.} video + * @property {!Array.} video * The buffered ranges for video content. - * @property {!Array.} text + * @property {!Array.} text * The buffered ranges for text content. * @exportDoc */ -shakaExtern.BufferedInfo; +shaka.extern.BufferedInfo; /** @@ -252,7 +262,7 @@ shakaExtern.BufferedInfo; * (only for variant tracks) The video stream's bandwidth if known. * @exportDoc */ -shakaExtern.Track; +shaka.extern.Track; /** @@ -293,7 +303,7 @@ shakaExtern.Track; * The maximum bandwidth of a variant track, in bit/sec. * @exportDoc */ -shakaExtern.Restrictions; +shaka.extern.Restrictions; /** @@ -305,14 +315,14 @@ shakaExtern.Restrictions; * Whether this key system supports persistent state. * @exportDoc */ -shakaExtern.DrmSupportType; +shaka.extern.DrmSupportType; /** * @typedef {{ * manifest: !Object., * media: !Object., - * drm: !Object. + * drm: !Object. * }} * * @description @@ -324,14 +334,14 @@ shakaExtern.DrmSupportType; * @property {!Object.} media * A map of supported media types. * The keys are media MIME types. - * @property {!Object.} drm + * @property {!Object.} drm * A map of supported key systems. * The keys are the key system names. The value is null if it is not * supported. Key systems not probed will not be in this dictionary. * * @exportDoc */ -shakaExtern.SupportType; +shaka.extern.SupportType; /** @@ -363,7 +373,7 @@ shakaExtern.SupportType; * The XML element that defines the Event. * @exportDoc */ -shakaExtern.TimelineRegionInfo; +shaka.extern.TimelineRegionInfo; /** @@ -403,15 +413,15 @@ shakaExtern.TimelineRegionInfo; * Body of the message. * @exportDoc */ -shakaExtern.EmsgInfo; +shaka.extern.EmsgInfo; /** - * @typedef {function(!Element):Array.} - * @see shakaExtern.DashManifestConfiguration + * @typedef {function(!Element):Array.} + * @see shaka.extern.DashManifestConfiguration * @exportDoc */ -shakaExtern.DashContentProtectionCallback; +shaka.extern.DashContentProtectionCallback; /** @@ -450,19 +460,19 @@ shakaExtern.DashContentProtectionCallback; * * @exportDoc */ -shakaExtern.AdvancedDrmConfiguration; +shaka.extern.AdvancedDrmConfiguration; /** * @typedef {{ - * retryParameters: shakaExtern.RetryParameters, + * retryParameters: shaka.extern.RetryParameters, * servers: !Object., * clearKeys: !Object., * delayLicenseRequestUntilPlayed: boolean, - * advanced: Object. + * advanced: Object. * }} * - * @property {shakaExtern.RetryParameters} retryParameters + * @property {shaka.extern.RetryParameters} retryParameters * Retry parameters for license requests. * @property {!Object.} servers * Required for all but the clear key CDM.
@@ -475,26 +485,26 @@ shakaExtern.AdvancedDrmConfiguration; * Defaults to false.
* True to configure drm to delay sending a license request until a user * actually starts playing content. - * @property {Object.} advanced + * @property {Object.} advanced * Optional.
* A dictionary which maps key system IDs to advanced DRM configuration for * those key systems. * * @exportDoc */ -shakaExtern.DrmConfiguration; +shaka.extern.DrmConfiguration; /** * @typedef {{ - * customScheme: shakaExtern.DashContentProtectionCallback, + * customScheme: shaka.extern.DashContentProtectionCallback, * clockSyncUri: string, * ignoreDrmInfo: boolean, * xlinkFailGracefully: boolean, * defaultPresentationDelay: number * }} * - * @property {shakaExtern.DashContentProtectionCallback} customScheme + * @property {shaka.extern.DashContentProtectionCallback} customScheme * If given, invoked by a DASH manifest parser to interpret custom or * non-standard DRM schemes found in the manifest. The argument is a * ContentProtection node. Return null if not recognized. @@ -517,28 +527,28 @@ shakaExtern.DrmConfiguration; * * @exportDoc */ -shakaExtern.DashManifestConfiguration; +shaka.extern.DashManifestConfiguration; /** * @typedef {{ - * retryParameters: shakaExtern.RetryParameters, - * dash: shakaExtern.DashManifestConfiguration + * retryParameters: shaka.extern.RetryParameters, + * dash: shaka.extern.DashManifestConfiguration * }} * - * @property {shakaExtern.RetryParameters} retryParameters + * @property {shaka.extern.RetryParameters} retryParameters * Retry parameters for manifest requests. - * @property {shakaExtern.DashManifestConfiguration} dash + * @property {shaka.extern.DashManifestConfiguration} dash * Advanced parameters used by the DASH manifest parser. * * @exportDoc */ -shakaExtern.ManifestConfiguration; +shaka.extern.ManifestConfiguration; /** * @typedef {{ - * retryParameters: shakaExtern.RetryParameters, + * retryParameters: shaka.extern.RetryParameters, * failureCallback: function(!shaka.util.Error), * rebufferingGoal: number, * bufferingGoal: number, @@ -555,7 +565,7 @@ shakaExtern.ManifestConfiguration; * @description * The StreamingEngine's configuration options. * - * @property {shakaExtern.RetryParameters} retryParameters + * @property {shaka.extern.RetryParameters} retryParameters * Retry parameters for segment requests. * @property {function(!shaka.util.Error)} failureCallback * A callback to decide what to do on a streaming failure. Default behavior @@ -609,14 +619,14 @@ shakaExtern.ManifestConfiguration; * This value defaults to false. * @exportDoc */ -shakaExtern.StreamingConfiguration; +shaka.extern.StreamingConfiguration; /** * @typedef {{ * enabled: boolean, * defaultBandwidthEstimate: number, - * restrictions: shakaExtern.Restrictions, + * restrictions: shaka.extern.Restrictions, * switchInterval: number, * bandwidthUpgradeTarget: number, * bandwidthDowngradeTarget: number @@ -627,7 +637,7 @@ shakaExtern.StreamingConfiguration; * @property {number} defaultBandwidthEstimate * The default bandwidth estimate to use if there is not enough data, in * bit/sec. - * @property {shakaExtern.Restrictions} restrictions + * @property {shaka.extern.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) @@ -642,36 +652,36 @@ shakaExtern.StreamingConfiguration; * downgrade to avoid this. * @exportDoc */ -shakaExtern.AbrConfiguration; +shaka.extern.AbrConfiguration; /** * @typedef {{ - * drm: shakaExtern.DrmConfiguration, - * manifest: shakaExtern.ManifestConfiguration, - * streaming: shakaExtern.StreamingConfiguration, - * abrFactory: shakaExtern.AbrManager.Factory, - * abr: shakaExtern.AbrConfiguration, + * drm: shaka.extern.DrmConfiguration, + * manifest: shaka.extern.ManifestConfiguration, + * streaming: shaka.extern.StreamingConfiguration, + * abrFactory: shaka.extern.AbrManager.Factory, + * abr: shaka.extern.AbrConfiguration, * preferredAudioLanguage: string, * preferredTextLanguage: string, * preferredVariantRole: string, * preferredTextRole: string, * preferredAudioChannelCount: number, - * restrictions: shakaExtern.Restrictions, + * restrictions: shaka.extern.Restrictions, * playRangeStart: number, * playRangeEnd: number, - * textDisplayFactory: shakaExtern.TextDisplayer.Factory + * textDisplayFactory: shaka.extern.TextDisplayer.Factory * }} * - * @property {shakaExtern.DrmConfiguration} drm + * @property {shaka.extern.DrmConfiguration} drm * DRM configuration and settings. - * @property {shakaExtern.ManifestConfiguration} manifest + * @property {shaka.extern.ManifestConfiguration} manifest * Manifest configuration and settings. - * @property {shakaExtern.StreamingConfiguration} streaming + * @property {shaka.extern.StreamingConfiguration} streaming * Streaming configuration and settings. - * @property {shakaExtern.AbrManager.Factory} abrFactory + * @property {shaka.extern.AbrManager.Factory} abrFactory * A factory to construct an abr manager. - * @property {shakaExtern.AbrConfiguration} abr + * @property {shaka.extern.AbrConfiguration} abr * ABR configuration and settings. * @property {string} preferredAudioLanguage * The preferred language to use for audio tracks. If not given it will use @@ -688,7 +698,7 @@ shakaExtern.AbrConfiguration; * The preferred role to use for text tracks. * @property {number} preferredAudioChannelCount * The preferred number of audio channels. - * @property {shakaExtern.Restrictions} restrictions + * @property {shaka.extern.Restrictions} restrictions * The application restrictions to apply to the tracks. The track must * meet all the restrictions to be playable. * @property {number} playRangeStart @@ -697,11 +707,11 @@ shakaExtern.AbrConfiguration; * @property {number} playRangeEnd * Optional playback and seek end time in seconds. Defaults to the end of * the presentation if not provided. - * @property {shakaExtern.TextDisplayer.Factory} textDisplayFactory + * @property {shaka.extern.TextDisplayer.Factory} textDisplayFactory * A factory to construct text displayer. * @exportDoc */ -shakaExtern.PlayerConfiguration; +shaka.extern.PlayerConfiguration; /** @@ -716,4 +726,4 @@ shakaExtern.PlayerConfiguration; * The role name for the stream. If the stream has no role, |role| will be * ''. */ -shakaExtern.LanguageRole; +shaka.extern.LanguageRole; diff --git a/externs/shaka/text.js b/externs/shaka/text.js index a35d46a56..c9643ca49 100644 --- a/externs/shaka/text.js +++ b/externs/shaka/text.js @@ -16,35 +16,45 @@ */ -/** @externs */ +/** + * @externs + * @suppress {duplicate} To prevent compiler errors with the namespace + * being declared both here and by goog.provide in the library. + */ + +/** @namespace */ +var shaka = {}; + +/** @namespace */ +shaka.extern = {}; /** * @interface * @exportDoc */ -shakaExtern.CueRegion = function() {}; +shaka.extern.CueRegion = function() {}; /** * Region identifier. * @type {string} */ -shakaExtern.CueRegion.prototype.id; +shaka.extern.CueRegion.prototype.id; /** * The X offset to start the rendering area in anchorUnits of the video width. * @type {number} */ -shakaExtern.CueRegion.prototype.viewportAnchorX; +shaka.extern.CueRegion.prototype.viewportAnchorX; /** * The X offset to start the rendering area in anchorUnits of the video height. * @type {number} */ -shakaExtern.CueRegion.prototype.viewportAnchorY; +shaka.extern.CueRegion.prototype.viewportAnchorY; /** @@ -52,7 +62,7 @@ shakaExtern.CueRegion.prototype.viewportAnchorY; * the region width. * @type {number} */ -shakaExtern.CueRegion.prototype.regionAnchorX; +shaka.extern.CueRegion.prototype.regionAnchorX; /** @@ -60,42 +70,42 @@ shakaExtern.CueRegion.prototype.regionAnchorX; * the region height. * @type {number} */ -shakaExtern.CueRegion.prototype.regionAnchorY; +shaka.extern.CueRegion.prototype.regionAnchorY; /** * The width of the rendering area in widthUnits. * @type {number} */ -shakaExtern.CueRegion.prototype.width; +shaka.extern.CueRegion.prototype.width; /** * The width of the rendering area in heightUnits. * @type {number} */ -shakaExtern.CueRegion.prototype.height; +shaka.extern.CueRegion.prototype.height; /** * The units (percentage, pixels or lines) the region height is in. * @type {shaka.text.CueRegion.units} */ -shakaExtern.CueRegion.prototype.heightUnits; +shaka.extern.CueRegion.prototype.heightUnits; /** * The units (percentage or pixels) the region width is in. * @type {shaka.text.CueRegion.units} */ -shakaExtern.CueRegion.prototype.widthUnits; +shaka.extern.CueRegion.prototype.widthUnits; /** * The units (percentage or pixels) the region viewportAnchors are in. * @type {shaka.text.CueRegion.units} */ -shakaExtern.CueRegion.prototype.viewportAnchorUnits; +shaka.extern.CueRegion.prototype.viewportAnchorUnits; /** @@ -105,42 +115,42 @@ shakaExtern.CueRegion.prototype.viewportAnchorUnits; * they were first painted in. * @type {shaka.text.CueRegion.scrollMode} */ -shakaExtern.CueRegion.prototype.scroll; +shaka.extern.CueRegion.prototype.scroll; /** * @interface * @exportDoc */ -shakaExtern.Cue = function() {}; +shaka.extern.Cue = function() {}; /** * The start time of the cue in seconds and fractions of a second. * @type {number} */ -shakaExtern.Cue.prototype.startTime; +shaka.extern.Cue.prototype.startTime; /** * The end time of the cue in seconds and fractions of a second. * @type {number} */ -shakaExtern.Cue.prototype.endTime; +shaka.extern.Cue.prototype.endTime; /** * The text payload of the cue. * @type {!string} */ -shakaExtern.Cue.prototype.payload; +shaka.extern.Cue.prototype.payload; /** * The region to render the cue into. - * @type {shakaExtern.CueRegion} + * @type {shaka.extern.CueRegion} */ -shakaExtern.Cue.prototype.region; +shaka.extern.Cue.prototype.region; /** @@ -148,35 +158,35 @@ shakaExtern.Cue.prototype.region; * writing direction. * @type {?number} */ -shakaExtern.Cue.prototype.position; +shaka.extern.Cue.prototype.position; /** * Position alignment of the cue. * @type {shaka.text.Cue.positionAlign} */ -shakaExtern.Cue.prototype.positionAlign; +shaka.extern.Cue.prototype.positionAlign; /** * Size of the cue box (in percents). * @type {number} */ -shakaExtern.Cue.prototype.size; +shaka.extern.Cue.prototype.size; /** * Alignment of the text inside the cue box. * @type {shaka.text.Cue.textAlign} */ -shakaExtern.Cue.prototype.textAlign; +shaka.extern.Cue.prototype.textAlign; /** * Text writing direction of the cue. * @type {shaka.text.Cue.writingDirection} */ -shakaExtern.Cue.prototype.writingDirection; +shaka.extern.Cue.prototype.writingDirection; /** @@ -184,7 +194,7 @@ shakaExtern.Cue.prototype.writingDirection; * percentage from the display box). * @type {shaka.text.Cue.lineInterpretation} */ -shakaExtern.Cue.prototype.lineInterpretation; +shaka.extern.Cue.prototype.lineInterpretation; /** @@ -192,7 +202,7 @@ shakaExtern.Cue.prototype.lineInterpretation; * percentage depending on the value of lineInterpretation. * @type {?number} */ -shakaExtern.Cue.prototype.line; +shaka.extern.Cue.prototype.line; /** @@ -201,21 +211,21 @@ shakaExtern.Cue.prototype.line; * the largest font size applied to the text in the cue. * @type {string}. */ -shakaExtern.Cue.prototype.lineHeight; +shaka.extern.Cue.prototype.lineHeight; /** * Line alignment of the cue box. * @type {shaka.text.Cue.lineAlign} */ -shakaExtern.Cue.prototype.lineAlign; +shaka.extern.Cue.prototype.lineAlign; /** * Vertical alignments of the cues within their extents. * @type {shaka.text.Cue.displayAlign} */ -shakaExtern.Cue.prototype.displayAlign; +shaka.extern.Cue.prototype.displayAlign; /** @@ -223,7 +233,7 @@ shakaExtern.Cue.prototype.displayAlign; * E. g. '#FFFFFF' or 'white'. * @type {!string} */ -shakaExtern.Cue.prototype.color; +shaka.extern.Cue.prototype.color; /** @@ -232,35 +242,35 @@ shakaExtern.Cue.prototype.color; * E. g. '#FFFFFF' or 'white'. * @type {!string} */ -shakaExtern.Cue.prototype.backgroundColor; +shaka.extern.Cue.prototype.backgroundColor; /** * Text font size in px or em (e.g. '100px'/'100em'). * @type {string} */ -shakaExtern.Cue.prototype.fontSize; +shaka.extern.Cue.prototype.fontSize; /** * Text font weight. Either normal or bold. * @type {shaka.text.Cue.fontWeight} */ -shakaExtern.Cue.prototype.fontWeight; +shaka.extern.Cue.prototype.fontWeight; /** * Text font style. Normal, italic or oblique. * @type {shaka.text.Cue.fontStyle} */ -shakaExtern.Cue.prototype.fontStyle; +shaka.extern.Cue.prototype.fontStyle; /** * Text font family. * @type {!string} */ -shakaExtern.Cue.prototype.fontFamily; +shaka.extern.Cue.prototype.fontFamily; /** @@ -268,21 +278,21 @@ shakaExtern.Cue.prototype.fontFamily; * and line through. Empty array means no decoration. * @type {!Array.} */ -shakaExtern.Cue.prototype.textDecoration; +shaka.extern.Cue.prototype.textDecoration; /** * Whether or not line wrapping should be applied to the cue. * @type {boolean} */ -shakaExtern.Cue.prototype.wrapLine; +shaka.extern.Cue.prototype.wrapLine; /** * Id of the cue. * @type {!string} */ -shakaExtern.Cue.prototype.id; +shaka.extern.Cue.prototype.id; @@ -292,7 +302,7 @@ shakaExtern.Cue.prototype.id; * @interface * @exportDoc */ -shakaExtern.TextParser = function() {}; +shaka.extern.TextParser = function() {}; /** @@ -314,7 +324,7 @@ shakaExtern.TextParser = function() {}; * * @exportDoc */ -shakaExtern.TextParser.TimeContext; +shaka.extern.TextParser.TimeContext; /** @@ -326,7 +336,7 @@ shakaExtern.TextParser.TimeContext; * * @exportDoc */ -shakaExtern.TextParser.prototype.parseInit = function(data) {}; +shaka.extern.TextParser.prototype.parseInit = function(data) {}; /** @@ -334,20 +344,20 @@ shakaExtern.TextParser.prototype.parseInit = function(data) {}; * * @param {!Uint8Array} data * The next section of buffer. - * @param {shakaExtern.TextParser.TimeContext} timeContext + * @param {shaka.extern.TextParser.TimeContext} timeContext * The time information that should be used to adjust the times values * for each cue. - * @return {!Array.} + * @return {!Array.} * * @exportDoc */ -shakaExtern.TextParser.prototype.parseMedia = function(data, timeContext) {}; +shaka.extern.TextParser.prototype.parseMedia = function(data, timeContext) {}; /** - * @typedef {function(new:shakaExtern.TextParser)} + * @typedef {function(new:shaka.extern.TextParser)} */ -shakaExtern.TextParserPlugin; +shaka.extern.TextParserPlugin; @@ -358,14 +368,14 @@ shakaExtern.TextParserPlugin; * @extends {shaka.util.IDestroyable} * @exportDoc */ -shakaExtern.TextDisplayer = function() {}; +shaka.extern.TextDisplayer = function() {}; /** * @override * @exportDoc */ -shakaExtern.TextDisplayer.prototype.destroy = function() {}; +shaka.extern.TextDisplayer.prototype.destroy = function() {}; /** @@ -376,7 +386,7 @@ shakaExtern.TextDisplayer.prototype.destroy = function() {}; * * @exportDoc */ -shakaExtern.TextDisplayer.prototype.append = function(cues) {}; +shaka.extern.TextDisplayer.prototype.append = function(cues) {}; /** @@ -388,7 +398,7 @@ shakaExtern.TextDisplayer.prototype.append = function(cues) {}; * * @exportDoc */ -shakaExtern.TextDisplayer.prototype.remove = function(start, end) {}; +shaka.extern.TextDisplayer.prototype.remove = function(start, end) {}; /** @@ -398,7 +408,7 @@ shakaExtern.TextDisplayer.prototype.remove = function(start, end) {}; * * @exportDoc */ -shakaExtern.TextDisplayer.prototype.isTextVisible = function() {}; +shaka.extern.TextDisplayer.prototype.isTextVisible = function() {}; /** @@ -408,13 +418,13 @@ shakaExtern.TextDisplayer.prototype.isTextVisible = function() {}; * * @exportDoc */ -shakaExtern.TextDisplayer.prototype.setTextVisibility = function(on) {}; +shaka.extern.TextDisplayer.prototype.setTextVisibility = function(on) {}; /** * A factory for creating a TextDisplayer. * - * @typedef {function(new:shakaExtern.TextDisplayer)} + * @typedef {function(new:shaka.extern.TextDisplayer)} * @exportDoc */ -shakaExtern.TextDisplayer.Factory; +shaka.extern.TextDisplayer.Factory; diff --git a/lib/abr/simple_abr_manager.js b/lib/abr/simple_abr_manager.js index e8a068f70..412afc9e5 100644 --- a/lib/abr/simple_abr_manager.js +++ b/lib/abr/simple_abr_manager.js @@ -44,11 +44,11 @@ goog.require('shaka.util.StreamUtils'); * * @constructor * @struct - * @implements {shakaExtern.AbrManager} + * @implements {shaka.extern.AbrManager} * @export */ shaka.abr.SimpleAbrManager = function() { - /** @private {?shakaExtern.AbrManager.SwitchCallback} */ + /** @private {?shaka.extern.AbrManager.SwitchCallback} */ this.switch_ = null; /** @private {boolean} */ @@ -61,7 +61,7 @@ shaka.abr.SimpleAbrManager = function() { /** * A filtered list of Variants to choose from. - * @private {!Array.} + * @private {!Array.} */ this.variants_ = []; @@ -75,7 +75,7 @@ shaka.abr.SimpleAbrManager = function() { */ this.lastTimeChosenMs_ = null; - /** @private {?shakaExtern.AbrConfiguration} */ + /** @private {?shaka.extern.AbrConfiguration} */ this.config_ = null; }; @@ -257,9 +257,9 @@ shaka.abr.SimpleAbrManager.prototype.suggestStreams_ = function() { /** - * @param {shakaExtern.Restrictions} restrictions - * @param {!Array.} variants - * @return {!Array.} variants filtered according to + * @param {shaka.extern.Restrictions} restrictions + * @param {!Array.} variants + * @return {!Array.} variants filtered according to * |restrictions| and sorted in ascending order of bandwidth. * @private */ diff --git a/lib/dash/content_protection.js b/lib/dash/content_protection.js index f1bcf7c59..b85009cf6 100644 --- a/lib/dash/content_protection.js +++ b/lib/dash/content_protection.js @@ -37,8 +37,8 @@ goog.require('shaka.util.XmlUtils'); /** * @typedef {{ * defaultKeyId: ?string, - * defaultInit: Array., - * drmInfos: !Array., + * defaultInit: Array., + * drmInfos: !Array., * firstRepresentation: boolean * }} * @@ -49,10 +49,10 @@ goog.require('shaka.util.XmlUtils'); * @property {?string} defaultKeyId * The default key ID to use. This is used by parseKeyIds as a default. This * can be null to indicate that there is no default. - * @property {Array.} defaultInit + * @property {Array.} defaultInit * The default init data override. This can be null to indicate that there * is no default. - * @property {!Array.} drmInfos + * @property {!Array.} drmInfos * The DrmInfo objects. * @property {boolean} firstRepresentation * True when first parsed; changed to false after the first call to @@ -68,7 +68,7 @@ shaka.dash.ContentProtection.Context; * node: !Element, * schemeUri: string, * keyId: ?string, - * init: Array. + * init: Array. * }} * * @description @@ -80,7 +80,7 @@ shaka.dash.ContentProtection.Context; * The scheme URI. * @property {?string} keyId * The default key ID, if present. - * @property {Array.} init + * @property {Array.} init * The init data, if present. If there is no init data, it will be null. If * this is non-null, there is at least one element. */ @@ -113,7 +113,7 @@ shaka.dash.ContentProtection.MP4Protection_ = * Parses info from the ContentProtection elements at the AdaptationSet level. * * @param {!Array.} elems - * @param {shakaExtern.DashContentProtectionCallback} callback + * @param {shaka.extern.DashContentProtectionCallback} callback * @param {boolean} ignoreDrmInfo * @return {shaka.dash.ContentProtection.Context} */ @@ -124,9 +124,9 @@ shaka.dash.ContentProtection.parseFromAdaptationSet = function( const MapUtils = shaka.util.MapUtils; const ManifestParserUtils = shaka.util.ManifestParserUtils; let parsed = ContentProtection.parseElements_(elems); - /** @type {Array.} */ + /** @type {Array.} */ let defaultInit = null; - /** @type {!Array.} */ + /** @type {!Array.} */ let drmInfos = []; let parsedNonCenc = []; @@ -205,7 +205,7 @@ shaka.dash.ContentProtection.parseFromAdaptationSet = function( * level. This may update the |context|. * * @param {!Array.} elems - * @param {shakaExtern.DashContentProtectionCallback} callback + * @param {shaka.extern.DashContentProtectionCallback} callback * @param {shaka.dash.ContentProtection.Context} context * @param {boolean} ignoreDrmInfo * @return {?string} The parsed key ID @@ -254,10 +254,10 @@ shaka.dash.ContentProtection.parseFromRepresentation = function( /** * Creates DrmInfo objects from the given element. * - * @param {Array.} defaultInit - * @param {shakaExtern.DashContentProtectionCallback} callback + * @param {Array.} defaultInit + * @param {shaka.extern.DashContentProtectionCallback} callback * @param {!Array.} elements - * @return {!Array.} + * @return {!Array.} * @private */ shaka.dash.ContentProtection.convertElements_ = function( @@ -266,7 +266,7 @@ shaka.dash.ContentProtection.convertElements_ = function( return elements.map( /** * @param {shaka.dash.ContentProtection.Element} element - * @return {!Array.} + * @return {!Array.} */ function(element) { const ManifestParserUtils = shaka.util.ManifestParserUtils; @@ -327,11 +327,11 @@ shaka.dash.ContentProtection.parseElements_ = function(elems) { } } - /** @type {!Array.} */ + /** @type {!Array.} */ let init = []; try { init = psshs.map(function(pssh) { - /** @type {shakaExtern.InitDataOverride} */ + /** @type {shaka.extern.InitDataOverride} */ let ret = { initDataType: 'cenc', initData: shaka.util.Uint8ArrayUtils.fromBase64(pssh), diff --git a/lib/dash/dash_parser.js b/lib/dash/dash_parser.js index a9d4feddd..f2e5fe7c2 100644 --- a/lib/dash/dash_parser.js +++ b/lib/dash/dash_parser.js @@ -46,20 +46,20 @@ goog.require('shaka.util.XmlUtils'); * * @struct * @constructor - * @implements {shakaExtern.ManifestParser} + * @implements {shaka.extern.ManifestParser} * @export */ shaka.dash.DashParser = function() { - /** @private {?shakaExtern.ManifestConfiguration} */ + /** @private {?shaka.extern.ManifestConfiguration} */ this.config_ = null; - /** @private {?shakaExtern.ManifestParser.PlayerInterface} */ + /** @private {?shaka.extern.ManifestParser.PlayerInterface} */ this.playerInterface_ = null; /** @private {!Array.} */ this.manifestUris_ = []; - /** @private {?shakaExtern.Manifest} */ + /** @private {?shaka.extern.Manifest} */ this.manifest_ = null; /** @private {!Array.} */ @@ -234,8 +234,8 @@ shaka.dash.DashParser.PeriodInfo; * contentType: ?string, * language: string, * main: boolean, - * streams: !Array., - * drmInfos: !Array., + * streams: !Array., + * drmInfos: !Array., * trickModeFor: ?string, * representationIds: !Array. * }} @@ -251,9 +251,9 @@ shaka.dash.DashParser.PeriodInfo; * The language of the AdaptationSet. * @property {boolean} main * Whether the AdaptationSet has the 'main' type. - * @property {!Array.} streams + * @property {!Array.} streams * The streams this AdaptationSet contains. - * @property {!Array.} drmInfos + * @property {!Array.} drmInfos * The DRM info for the AdaptationSet. * @property {?string} trickModeFor * If non-null, this AdaptationInfo represents trick mode tracks. This @@ -267,20 +267,20 @@ shaka.dash.DashParser.AdaptationInfo; /** * @typedef {{ - * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction, - * findSegmentPosition: shakaExtern.FindSegmentPositionFunction, - * getSegmentReference: shakaExtern.GetSegmentReferenceFunction + * createSegmentIndex: shaka.extern.CreateSegmentIndexFunction, + * findSegmentPosition: shaka.extern.FindSegmentPositionFunction, + * getSegmentReference: shaka.extern.GetSegmentReferenceFunction * }} * * @description * Contains functions used to create and find segment references. Used as * a return value, to temporarily store them before StreamInfo is created. * - * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex + * @property {shaka.extern.CreateSegmentIndexFunction} createSegmentIndex * The createSegmentIndex function. - * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition + * @property {shaka.extern.FindSegmentPositionFunction} findSegmentPosition * The findSegmentPosition function. - * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference + * @property {shaka.extern.GetSegmentReferenceFunction} getSegmentReference * The getSegmentReference function. */ shaka.dash.DashParser.SegmentIndexFunctions; @@ -288,9 +288,9 @@ shaka.dash.DashParser.SegmentIndexFunctions; /** * @typedef {{ - * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction, - * findSegmentPosition: shakaExtern.FindSegmentPositionFunction, - * getSegmentReference: shakaExtern.GetSegmentReferenceFunction, + * createSegmentIndex: shaka.extern.CreateSegmentIndexFunction, + * findSegmentPosition: shaka.extern.FindSegmentPositionFunction, + * getSegmentReference: shaka.extern.GetSegmentReferenceFunction, * initSegmentReference: shaka.media.InitSegmentReference, * scaledPresentationTimeOffset: number * }} @@ -299,11 +299,11 @@ shaka.dash.DashParser.SegmentIndexFunctions; * Contains information about a Stream. This is passed from the createStream * methods. * - * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex + * @property {shaka.extern.CreateSegmentIndexFunction} createSegmentIndex * The createSegmentIndex function for the stream. - * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition + * @property {shaka.extern.FindSegmentPositionFunction} findSegmentPosition * The findSegmentPosition function for the stream. - * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference + * @property {shaka.extern.GetSegmentReferenceFunction} getSegmentReference * The getSegmentReference function for the stream. * @property {shaka.media.InitSegmentReference} initSegmentReference * The init segment for the stream. @@ -596,7 +596,7 @@ shaka.dash.DashParser.prototype.processManifest_ = * @param {!Array.} baseUris * @param {!Element} mpd * @return {{ - * periods: !Array., + * periods: !Array., * duration: ?number, * durationDerivedFromPeriods: boolean * }} @@ -729,7 +729,7 @@ shaka.dash.DashParser.prototype.parsePeriods_ = function( * @param {shaka.dash.DashParser.Context} context * @param {!Array.} baseUris * @param {shaka.dash.DashParser.PeriodInfo} periodInfo - * @return {shakaExtern.Period} + * @return {shaka.extern.Period} * @throws shaka.util.Error When there is a parsing error. * @private */ @@ -856,7 +856,7 @@ shaka.dash.DashParser.prototype.getSetsOfType_ = function( * * @param {?shaka.dash.DashParser.AdaptationInfo} audio * @param {?shaka.dash.DashParser.AdaptationInfo} video - * @param {!Array.} variants New variants are pushed onto + * @param {!Array.} variants New variants are pushed onto * this array. * @private */ @@ -873,7 +873,7 @@ shaka.dash.DashParser.prototype.createVariants_ = /** @type {number} */ let bandwidth; - /** @type {shakaExtern.Variant} */ + /** @type {shaka.extern.Variant} */ let variant; if (!audio && !video) { @@ -1084,7 +1084,7 @@ shaka.dash.DashParser.prototype.parseAdaptationSet_ = function(context, elem) { * @param {boolean} isPrimary * @param {!Array.} roles * @param {!Element} node - * @return {?shakaExtern.Stream} The Stream, or null when there is a + * @return {?shaka.extern.Stream} The Stream, or null when there is a * non-critical parsing error. * @throws shaka.util.Error When there is a parsing error. * @private @@ -1578,7 +1578,7 @@ shaka.dash.DashParser.prototype.parseEventStream_ = function( endTime = Math.min(endTime, periodStart + periodDuration); } - /** @type {shakaExtern.TimelineRegionInfo} */ + /** @type {shaka.extern.TimelineRegionInfo} */ let region = { schemeIdUri: schemeIdUri, value: value, diff --git a/lib/dash/mpd_utils.js b/lib/dash/mpd_utils.js index e32f21806..10ba64773 100644 --- a/lib/dash/mpd_utils.js +++ b/lib/dash/mpd_utils.js @@ -462,7 +462,7 @@ shaka.dash.MpdUtils.parseXml = function(data, expectedRootElemName) { * even if the process fails. * * @param {!Element} element - * @param {!shakaExtern.RetryParameters} retryParameters + * @param {!shaka.extern.RetryParameters} retryParameters * @param {boolean} failGracefully * @param {string} baseUri * @param {!shaka.net.NetworkingEngine} networkingEngine @@ -519,7 +519,7 @@ shaka.dash.MpdUtils.handleXlinkInElement_ = 'Unexpected implementation of IAbortableOperation!'); // Satisfy the compiler with a cast. let networkOperation = - /** @type {!shaka.util.AbortableOperation.} */( + /** @type {!shaka.util.AbortableOperation.} */( requestOperation); // Chain onto that operation. @@ -568,7 +568,7 @@ shaka.dash.MpdUtils.handleXlinkInElement_ = * with their associated online data. * * @param {!Element} element - * @param {!shakaExtern.RetryParameters} retryParameters + * @param {!shaka.extern.RetryParameters} retryParameters * @param {boolean} failGracefully * @param {string} baseUri * @param {!shaka.net.NetworkingEngine} networkingEngine diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index fbd9e0f8f..007d3812d 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -51,14 +51,14 @@ goog.require('shaka.util.OperationManager'); * * @struct * @constructor - * @implements {shakaExtern.ManifestParser} + * @implements {shaka.extern.ManifestParser} * @export */ shaka.hls.HlsParser = function() { - /** @private {?shakaExtern.ManifestParser.PlayerInterface} */ + /** @private {?shaka.extern.ManifestParser.PlayerInterface} */ this.playerInterface_ = null; - /** @private {?shakaExtern.ManifestConfiguration} */ + /** @private {?shaka.extern.ManifestConfiguration} */ this.config_ = null; /** @private {number} */ @@ -72,7 +72,7 @@ shaka.hls.HlsParser = function() { /** * The key is a string of the form "