From 63719739431512c05845b1c401e32d1b5cd53563 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 6 Jun 2022 03:41:13 +0100 Subject: [PATCH] Add optional chaining for sponsor segments. --- src/components/VideoPlayer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/VideoPlayer.vue b/src/components/VideoPlayer.vue index f136e97f..c5cdead4 100644 --- a/src/components/VideoPlayer.vue +++ b/src/components/VideoPlayer.vue @@ -559,7 +559,7 @@ export default { updateMarkers() { const markers = this.$refs.container.querySelector(".shaka-ad-markers"); const array = ["to right"]; - this.sponsors?.segments.forEach(segment => { + this.sponsors?.segments?.forEach(segment => { const start = (segment.segment[0] / this.video.duration) * 100; const end = (segment.segment[1] / this.video.duration) * 100;