diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 6b562bf646..556714c916 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -112,6 +112,13 @@ jobs: # Install a launcher that can execute a shell script to launch this npm install karma-script-launcher --save-dev + # Some CI images (self-hosted or otherwise) don't have the minimum Java + # version necessary for the compiler (Java 11). + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 11 + - name: Build Player run: python build/all.py diff --git a/lib/player.js b/lib/player.js index 18f88fe233..1c463a8267 100644 --- a/lib/player.js +++ b/lib/player.js @@ -2160,15 +2160,15 @@ shaka.Player = class extends shaka.util.FakeEventTarget { // Unless the user has already picked a variant, anyway, by calling // selectVariantTrack before this loading stage. let initialVariant = null; - const activeVariantTrack = this.getVariantTracks().find((t) => t.active); - if (!activeVariantTrack) { + const activeVariant = this.streamingEngine_.getCurrentVariant(); + if (!activeVariant) { initialVariant = this.chooseVariant_(); goog.asserts.assert(initialVariant, 'Must choose an initial variant!'); } // Lazy-load the stream, so we will have enough info to make the playhead. const createSegmentIndexPromises = []; - const toLazyLoad = activeVariantTrack || initialVariant; + const toLazyLoad = activeVariant || initialVariant; for (const stream of [toLazyLoad.video, toLazyLoad.audio]) { if (stream && !stream.segmentIndex) { createSegmentIndexPromises.push(stream.createSegmentIndex()); @@ -2189,7 +2189,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { this.startBufferManagement_(rebufferThreshold); // Now we can switch to the initial variant. - if (!activeVariantTrack) { + if (!activeVariant) { goog.asserts.assert(initialVariant, 'Must have choosen an initial variant!'); diff --git a/package-lock.json b/package-lock.json index 6c91fb336f..068770a561 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,9 +29,9 @@ "eslint-plugin-shaka-rules": "file:./build/eslint-plugin-shaka-rules", "esprima": "^4.0.1", "fontfaceonload": "^1.0.2", - "google-closure-compiler-java": "^20220301.0.0", - "google-closure-deps": "https://gitpkg.now.sh/google/closure-library/closure-deps?d7736da6", - "google-closure-library": "^20220301.0.0", + "google-closure-compiler-java": "^20221102.0.0", + "google-closure-deps": "^20221102.0.0", + "google-closure-library": "^20221102.0.0", "htmlhint": "^1.1.3", "jasmine-ajax": "^4.0.0", "jimp": "^0.16.1", @@ -4578,17 +4578,16 @@ "dev": true }, "node_modules/google-closure-compiler-java": { - "version": "20220301.0.0", - "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20220301.0.0.tgz", - "integrity": "sha512-kv5oaUI4xn3qWYWtRHRqbm314kesfeFlCxiFRcvBIx13mKfR0qvbOkgajLpSM6nb3voNM/E9MB9mfvHJ9XIXSg==", + "version": "20221102.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20221102.0.0.tgz", + "integrity": "sha512-feAsp8xVU+jJydBfVTRK4/9jHpNZOX9jbhFziDLd3xypFgjb1CLQ9SzohS1hqA97q8wYxalB6HXU4JdicmRmUA==", "dev": true }, "node_modules/google-closure-deps": { - "version": "20220301.0.0", - "resolved": "https://gitpkg.now.sh/google/closure-library/closure-deps?d7736da6", - "integrity": "sha512-OUmhEm8aXW+eUb+4QonusAl4wrXU+sUQ4joJ3zz4UjTNfJRyLF1ac5egw2vr6irg/tW8BsiZ3KL4FrNTsGCz0Q==", + "version": "20221102.0.0", + "resolved": "https://registry.npmjs.org/google-closure-deps/-/google-closure-deps-20221102.0.0.tgz", + "integrity": "sha512-6AOcHk8u5DNY/uhJLyHj0M4GLTkqAhscH7iH66QUxSiUlrg55PWdyaWQa4Jg15p4xUWNPf8NFBe6vIdwzwi0Hw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "minimatch": "^3.0.4", "yargs": "^16.2.0" @@ -4599,9 +4598,9 @@ } }, "node_modules/google-closure-library": { - "version": "20220301.0.0", - "resolved": "https://registry.npmjs.org/google-closure-library/-/google-closure-library-20220301.0.0.tgz", - "integrity": "sha512-GRRBfG80JPqkKkTxiRoVr/x4UmnPW2aeA72NH0zapPtrvSkAOCzfJFrdudLrAJJtXPdSE65+CkYrpZX8tP0mCQ==", + "version": "20221102.0.0", + "resolved": "https://registry.npmjs.org/google-closure-library/-/google-closure-library-20221102.0.0.tgz", + "integrity": "sha512-M5+LWPS99tMB9dOGpZjLT9CdIYpnwBZiwB+dCmZFOOvwJiOWytntzJ/a/hoNF6zxD15l3GWwRJiEkL636D6DRQ==", "dev": true }, "node_modules/graceful-fs": { @@ -12045,14 +12044,15 @@ "dev": true }, "google-closure-compiler-java": { - "version": "20220301.0.0", - "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20220301.0.0.tgz", - "integrity": "sha512-kv5oaUI4xn3qWYWtRHRqbm314kesfeFlCxiFRcvBIx13mKfR0qvbOkgajLpSM6nb3voNM/E9MB9mfvHJ9XIXSg==", + "version": "20221102.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20221102.0.0.tgz", + "integrity": "sha512-feAsp8xVU+jJydBfVTRK4/9jHpNZOX9jbhFziDLd3xypFgjb1CLQ9SzohS1hqA97q8wYxalB6HXU4JdicmRmUA==", "dev": true }, "google-closure-deps": { - "version": "https://gitpkg.now.sh/google/closure-library/closure-deps?d7736da6", - "integrity": "sha512-OUmhEm8aXW+eUb+4QonusAl4wrXU+sUQ4joJ3zz4UjTNfJRyLF1ac5egw2vr6irg/tW8BsiZ3KL4FrNTsGCz0Q==", + "version": "20221102.0.0", + "resolved": "https://registry.npmjs.org/google-closure-deps/-/google-closure-deps-20221102.0.0.tgz", + "integrity": "sha512-6AOcHk8u5DNY/uhJLyHj0M4GLTkqAhscH7iH66QUxSiUlrg55PWdyaWQa4Jg15p4xUWNPf8NFBe6vIdwzwi0Hw==", "dev": true, "requires": { "minimatch": "^3.0.4", @@ -12060,9 +12060,9 @@ } }, "google-closure-library": { - "version": "20220301.0.0", - "resolved": "https://registry.npmjs.org/google-closure-library/-/google-closure-library-20220301.0.0.tgz", - "integrity": "sha512-GRRBfG80JPqkKkTxiRoVr/x4UmnPW2aeA72NH0zapPtrvSkAOCzfJFrdudLrAJJtXPdSE65+CkYrpZX8tP0mCQ==", + "version": "20221102.0.0", + "resolved": "https://registry.npmjs.org/google-closure-library/-/google-closure-library-20221102.0.0.tgz", + "integrity": "sha512-M5+LWPS99tMB9dOGpZjLT9CdIYpnwBZiwB+dCmZFOOvwJiOWytntzJ/a/hoNF6zxD15l3GWwRJiEkL636D6DRQ==", "dev": true }, "graceful-fs": { diff --git a/package.json b/package.json index ff40d4c69f..19a51fc6b6 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,9 @@ "eslint-plugin-shaka-rules": "file:./build/eslint-plugin-shaka-rules", "esprima": "^4.0.1", "fontfaceonload": "^1.0.2", - "google-closure-compiler-java": "^20220301.0.0", - "google-closure-deps": "https://gitpkg.now.sh/google/closure-library/closure-deps?d7736da6", - "google-closure-library": "^20220301.0.0", + "google-closure-compiler-java": "^20221102.0.0", + "google-closure-deps": "^20221102.0.0", + "google-closure-library": "^20221102.0.0", "htmlhint": "^1.1.3", "jasmine-ajax": "^4.0.0", "jimp": "^0.16.1", diff --git a/third_party/closure-uri/uri.js b/third_party/closure-uri/uri.js index c0ab40beaa..24dccee407 100644 --- a/third_party/closure-uri/uri.js +++ b/third_party/closure-uri/uri.js @@ -798,7 +798,7 @@ goog.Uri.QueryData.prototype.add = function(key, value) { // Invalidate the cache. this.encodedQuery_ = null; - var values = this.keyMap_.hasOwnProperty(key) && this.keyMap_[key]; + var values = this.keyMap_.hasOwnProperty(key) ? this.keyMap_[key] : null; if (!values) { this.keyMap_[key] = (values = []); }