Skip to content

Commit

Permalink
build: add goog.require for compiler upgrade (Part 6)
Browse files Browse the repository at this point in the history
Change-Id: I9b92f9432a8d6bfe0d9d48c76ab1ce74a9994e0f
  • Loading branch information
michellezhuogg committed Oct 16, 2020
1 parent 0eb3b62 commit 81a487a
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 16 deletions.
5 changes: 5 additions & 0 deletions demo/asset_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
goog.provide('shakaDemo.AssetCard');


goog.require('goog.asserts');
goog.require('shakaDemo.MessageIds');
goog.require('shakaDemo.Tooltips');
goog.requireType('ShakaDemoAssetInfo');

/**
* Creates and contains an MDL card that presents info about the given asset.
* @final
Expand Down
1 change: 1 addition & 0 deletions demo/cast_receiver/receiver_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

goog.require('goog.asserts');
goog.require('ShakaDemoAssetInfo');


/**
Expand Down
5 changes: 5 additions & 0 deletions demo/common/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
*/


/**
* @fileoverview
* @suppress {missingRequire}
*/

goog.provide('ShakaDemoAssetInfo');

goog.require('shakaDemo.MessageIds');
Expand Down
5 changes: 5 additions & 0 deletions demo/common/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
* SPDX-License-Identifier: Apache-2.0
*/

/**
* @fileoverview
* @suppress {missingRequire}
*/

goog.require('ShakaDemoAssetInfo');
goog.require('shakaDemo.MessageIds');


// Types and enums {{{
Expand Down
24 changes: 11 additions & 13 deletions demo/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@

goog.provide('shakaDemo.Config');

goog.require('goog.asserts');
goog.require('shakaDemo.BoolInput');
goog.require('shakaDemo.DatalistInput');
goog.require('shakaDemo.InputContainer');
goog.require('shakaDemo.Main');
goog.require('shakaDemo.MessageIds');
goog.require('shakaDemo.NumberInput');
goog.require('shakaDemo.SelectInput');
goog.require('shakaDemo.TextInput');
goog.requireType('shakaDemo.Input');

/** @type {?shakaDemo.Config} */
let shakaDemoConfig;
Expand Down Expand Up @@ -108,18 +118,6 @@ shakaDemo.Config = class {
componentHandler.upgradeDom();
}

/** @return {!shaka.extern.AdvancedDrmConfiguration} */
static emptyAdvancedConfiguration() {
return {
distinctiveIdentifierRequired: false,
persistentStateRequired: false,
videoRobustness: '',
audioRobustness: '',
serverCertificate: new Uint8Array(0),
individualizationServer: '',
};
}

/** @private */
addDrmSection_() {
const MessageIds = shakaDemo.MessageIds;
Expand Down Expand Up @@ -148,7 +146,7 @@ shakaDemo.Config = class {
// Add in any common drmSystem not currently in advanced.
for (const drmSystem of shakaDemo.Main.commonDrmSystems) {
if (!(drmSystem in advanced)) {
advanced[drmSystem] = shakaDemo.Config.emptyAdvancedConfiguration();
advanced[drmSystem] = shakaDemo.Main.defaultAdvancedDrmConfig();
}
}
// Set the robustness.
Expand Down
7 changes: 7 additions & 0 deletions demo/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
goog.provide('shakaDemo.Custom');


goog.require('ShakaDemoAssetInfo');
goog.require('shakaDemo.AssetCard');
goog.require('shakaDemo.InputContainer');
goog.require('shakaDemo.Main');
goog.require('shakaDemo.MessageIds');
goog.require('shakaDemo.TextInput');

/** @type {?shakaDemo.Custom} */
let shakaDemoCustom;

Expand Down
4 changes: 4 additions & 0 deletions demo/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
goog.provide('shakaDemo.Front');


goog.require('shakaDemo.AssetCard');
goog.require('shakaDemo.MessageIds');
goog.requireType('ShakaDemoAssetInfo');

/** @type {?shakaDemo.Front} */
let shakaDemoFront;

Expand Down
3 changes: 3 additions & 0 deletions demo/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ goog.provide('shakaDemo.NumberInput');
goog.provide('shakaDemo.SelectInput');
goog.provide('shakaDemo.TextInput');

goog.require('shakaDemo.MessageIds');
goog.requireType('shakaDemo.InputContainer');

/**
* Creates and contains the MDL elements of a type of input.
*/
Expand Down
3 changes: 3 additions & 0 deletions demo/input_container.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
goog.provide('shakaDemo.InputContainer');


goog.require('shakaDemo.Tooltips');
goog.requireType('shakaDemo.MessageIds');

/**
* Creates elements for containing inputs. It represents a single "section" of
* input.
Expand Down
19 changes: 18 additions & 1 deletion demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

goog.provide('shakaDemo.Main');

goog.require('ShakaDemoAssetInfo');
goog.require('goog.asserts');
goog.require('shakaDemo.CloseButton');
goog.require('shakaDemo.MessageIds');
goog.require('shakaDemo.Utils');

/**
* Shaka Player demo, main section.
Expand Down Expand Up @@ -898,7 +903,7 @@ shakaDemo.Main = class {
if (advanced) {
for (const drmSystem of shakaDemo.Main.commonDrmSystems) {
if (!advanced[drmSystem]) {
advanced[drmSystem] = shakaDemo.Config.emptyAdvancedConfiguration();
advanced[drmSystem] = shakaDemo.Main.defaultAdvancedDrmConfig();
}
if ('videoRobustness' in params) {
advanced[drmSystem].videoRobustness = params['videoRobustness'];
Expand Down Expand Up @@ -1701,6 +1706,18 @@ shakaDemo.Main = class {
this.showPlayer_();
}
}

/** @return {!shaka.extern.AdvancedDrmConfiguration} */
static defaultAdvancedDrmConfig() {
return {
distinctiveIdentifierRequired: false,
persistentStateRequired: false,
videoRobustness: '',
audioRobustness: '',
serverCertificate: new Uint8Array(0),
individualizationServer: '',
};
}
};


Expand Down
7 changes: 7 additions & 0 deletions demo/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
goog.provide('shakaDemo.Search');


goog.require('shakaDemo.AssetCard');
goog.require('shakaDemo.BoolInput');
goog.require('shakaDemo.InputContainer');
goog.require('shakaDemo.MessageIds');
goog.require('shakaDemo.SelectInput');
goog.requireType('ShakaDemoAssetInfo');

/** @type {?shakaDemo.Search} */
let shakaDemoSearch;

Expand Down
1 change: 1 addition & 0 deletions demo/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

goog.provide('shakaDemo.Tooltips');

goog.requireType('shakaDemo.MessageIds');

/**
* Creates and contains a tooltip.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"esprima": "^4.0.1",
"fastestsmallesttextencoderdecoder": "^1.0.22",
"fontfaceonload": "^1.0.2",
"google-closure-compiler-java": "^20200517.0.0",
"google-closure-library": "^20200517.0.0",
"google-closure-compiler-java": "^20200719.0.0",
"google-closure-library": "^20200719.0.0",
"htmlhint": "^0.11.0",
"jasmine-ajax": "^4.0.0",
"jimp": "^0.11.0",
Expand Down

0 comments on commit 81a487a

Please sign in to comment.