From 151bdda36d60499f5cfdd4d5c6ebbe088025cd2a Mon Sep 17 00:00:00 2001 From: Rohan Gupta Date: Sat, 10 Dec 2022 14:47:14 +0530 Subject: [PATCH 1/5] fix(chapters): removed duplicate chapters by id (#4810) fixes https://github.com/shaka-project/shaka-player/issues/4750 Solved by creating a `Set` for filtering out deplicate elements. Need confirmation, Shouldn't we add an `assert` for `language` argument passed to https://github.com/shaka-project/shaka-player/blob/76f96b9fee2dc43b03f6803dd80c51fdc5b73a9e/lib/player.js#L4340-L4342 --- AUTHORS | 1 + CONTRIBUTORS | 1 + lib/player.js | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 701a828f33f..8ece9ded7ee 100644 --- a/AUTHORS +++ b/AUTHORS @@ -68,6 +68,7 @@ Prakash Robert Colantuoni Robert Galluccio Rodolphe Breton +Rohan Gupta Roi Lipman Roksolana Ivanyshyn Rostislav Hejduk diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 7e0989a110f..ca741e91ff0 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -100,6 +100,7 @@ Robert Colantuoni Robert Galluccio Rodolphe Breton Rohit Makasana +Rohan Gupta Roi Lipman Roksolana Ivanyshyn Rostislav Hejduk diff --git a/lib/player.js b/lib/player.js index 279782b61d0..7227db20879 100644 --- a/lib/player.js +++ b/lib/player.js @@ -4347,6 +4347,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { return []; } const chapters = []; + const uniqueChapters = new Set(); for (const chaptersTrack of chaptersTracksWithLanguage) { if (chaptersTrack && chaptersTrack.cues) { for (const cue of chaptersTrack.cues) { @@ -4361,7 +4362,10 @@ shaka.Player = class extends shaka.util.FakeEventTarget { startTime: cue.startTime, endTime: cue.endTime, }; - chapters.push(chapter); + if (!uniqueChapters.has(id)) { + chapters.push(chapter); + uniqueChapters.add(id); + } } } } From 715035cd27e73e123ddf29c9a1b86b1ef4fc5be1 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Sun, 11 Dec 2022 17:47:43 -0800 Subject: [PATCH 2/5] test: Catch and print info from unhandled global exceptions (#4814) Unhandled global exceptions already generate test failures, but this adds specific useful information, like stack traces, to those failures. See issue #4813 --- test/test/boot.js | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/test/test/boot.js b/test/test/boot.js index 4eb53b92e0f..7b4d7fea837 100644 --- a/test/test/boot.js +++ b/test/test/boot.js @@ -66,22 +66,40 @@ function failTestsOnNamespacedElementOrAttributeNames() { } /** - * Listen for unhandled Promise rejections (which may occur after a test) and - * convert them into test failures. + * Fail the current test on a given error, constructed with a given header and + * the full stack trace of the error. + * + * @param {string} messageHeader + * @param {!Error} error */ -function failTestsOnUnhandledRejections() { +function failOnError(messageHeader, error) { + let message = `${messageHeader}: ${error}`; + // Shaka errors have the stack trace in their toString() already, so don't + // add it again. For native errors, we need to see where it came from. + if (error && error.stack && !(error instanceof shaka.util.Error)) { + message += '\n' + error.stack; + } + fail(message); +} + +/** + * Listen for unhandled errors and Promise rejections (which may occur after a + * test) and convert them into test failures. + */ +function failTestsOnUnhandledErrors() { // https://developer.mozilla.org/en-US/docs/Web/Events/unhandledrejection window.addEventListener('unhandledrejection', (event) => { /** @type {?} */ const error = event.reason; - let message = 'Unhandled rejection in Promise: ' + error; + failOnError('Unhandled rejection in Promise', error); + }); - // Shaka errors have the stack trace in their toString() already, so don't - // add it again. For native errors, we need to see where it came from. - if (error && error.stack && !(error instanceof shaka.util.Error)) { - message += '\n' + error.stack; - } - fail(message); + // https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event + // https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent + window.addEventListener('error', (event) => { + /** @type {?} */ + const error = event['error']; + failOnError('Unhandled error', error); }); } @@ -392,7 +410,7 @@ function configureJasmineEnvironment() { function setupTestEnvironment() { failTestsOnFailedAssertions(); failTestsOnNamespacedElementOrAttributeNames(); - failTestsOnUnhandledRejections(); + failTestsOnUnhandledErrors(); disableScrollbars(); workAroundLegacyEdgePromiseIssues(); From 99da4ce7dea43ae67870acbcf708ed6479efa7cc Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Mon, 12 Dec 2022 18:04:49 -0800 Subject: [PATCH 3/5] fix(UI): Suppress error log from fullscreen button on desktop (#4823) Closes #4822 --- ui/controls.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/controls.js b/ui/controls.js index a1dd0889900..bfb99abc733 100644 --- a/ui/controls.js +++ b/ui/controls.js @@ -599,7 +599,11 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget { if (this.config_.forceLandscapeOnFullscreen && screen.orientation) { // Locking to 'landscape' should let it be either // 'landscape-primary' or 'landscape-secondary' as appropriate. - await screen.orientation.lock('landscape'); + // We ignore errors from this specific call, since it creates noise + // on desktop otherwise. + try { + await screen.orientation.lock('landscape'); + } catch (error) {} } } else { const video = /** @type {HTMLVideoElement} */(this.localVideo_); From c77f04973418cf4399de9315b4720d3230d5f520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Tue, 13 Dec 2022 06:46:00 +0100 Subject: [PATCH 4/5] docs: Update HLS Readme (#4819) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 65d9e925b73..fd058950ab1 100644 --- a/README.md +++ b/README.md @@ -135,10 +135,10 @@ HLS features supported: - CEA-608/708 captions - Encrypted content with PlayReady and Widevine - Encrypted content with FairPlay (Safari on macOS and iOS 13+ only) + - Key rotation - Raw AAC, MP3, etc (without an MP4 container) HLS features **not** supported: - - Key rotation: https://github.com/shaka-project/shaka-player/issues/917 - I-frame-only playlists: https://github.com/shaka-project/shaka-player/issues/742 - Low-latency streaming with blocking playlist reload From da0b81832198bc58f32d8ed2604617f4add08c55 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Mon, 12 Dec 2022 21:56:49 -0800 Subject: [PATCH 5/5] ci: Force update to Edge 108 (#4826) Since Edge 107 on Linux has an outdated CDM causing test failures, we have to force update to Edge 108 in GitHub Actions. Closes #4825 --- .github/workflows/build-and-test.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 556714c9164..0991d553a11 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -87,6 +87,19 @@ jobs: if: matrix.os == 'ubuntu-latest' && matrix.browser == 'Firefox' run: sudo apt -y update && sudo apt -y install ffmpeg + # Edge 107 fails DRM tests due to an outdated Widevine CDM. Force Edge + # to update to 108+. + - name: Upgrade Edge + if: matrix.os == 'ubuntu-latest' && matrix.browser == 'Edge' + run: | + # If it's Edge 107, update it. Otherwise, don't. This way, we don't + # break something later when Edge 108+ is available by default in + # GitHub Actions. + if apt show microsoft-edge-stable | grep -q '^Version: 107'; then + wget https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_108.0.1462.46-1_amd64.deb + sudo dpkg -i microsoft-edge-stable_108.0.1462.46-1_amd64.deb + fi + - name: Checkout code uses: actions/checkout@v3 with: