From 18c10540a3edd31a322f4f003bd1424c3cbc4cc2 Mon Sep 17 00:00:00 2001 From: Ame <“ajiiisai@protonmail.com”> Date: Thu, 6 Jan 2022 20:32:11 +0100 Subject: [PATCH 1/2] feat(vg-playback-button): add catch case for playback speed and descriptors --- .../vg-playback-button/vg-playback-button.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/ngx-videogular/controls/src/lib/components/vg-playback-button/vg-playback-button.component.ts b/libs/ngx-videogular/controls/src/lib/components/vg-playback-button/vg-playback-button.component.ts index 65f4e8a..765851f 100644 --- a/libs/ngx-videogular/controls/src/lib/components/vg-playback-button/vg-playback-button.component.ts +++ b/libs/ngx-videogular/controls/src/lib/components/vg-playback-button/vg-playback-button.component.ts @@ -101,6 +101,12 @@ export class VgPlaybackButtonComponent implements OnInit, OnDestroy { } updatePlaybackSpeed() { + this.playbackValues.forEach(playbackValue => { + if (playbackValue.length === 1) { + playbackValue += '.0'; + } + }); + this.playbackIndex = ++this.playbackIndex % this.playbackValues.length; if (this.target instanceof VgApiService) { From 492bd88169613ef96d505ddad272d9fbf6530722 Mon Sep 17 00:00:00 2001 From: Ame Date: Mon, 10 Jan 2022 15:45:16 +0100 Subject: [PATCH 2/2] Properly mutate values --- .../vg-playback-button/vg-playback-button.component.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/ngx-videogular/controls/src/lib/components/vg-playback-button/vg-playback-button.component.ts b/libs/ngx-videogular/controls/src/lib/components/vg-playback-button/vg-playback-button.component.ts index 765851f..26aee27 100644 --- a/libs/ngx-videogular/controls/src/lib/components/vg-playback-button/vg-playback-button.component.ts +++ b/libs/ngx-videogular/controls/src/lib/components/vg-playback-button/vg-playback-button.component.ts @@ -101,11 +101,11 @@ export class VgPlaybackButtonComponent implements OnInit, OnDestroy { } updatePlaybackSpeed() { - this.playbackValues.forEach(playbackValue => { - if (playbackValue.length === 1) { - playbackValue += '.0'; - } - }); + this.playbackValues.forEach((playbackValue, index) => { + if (playbackValue.length === 1) { + this.playbackValues[index] = playbackValue + '.0'; + } + }); this.playbackIndex = ++this.playbackIndex % this.playbackValues.length;