From c602aa9de82f3299ae10c5661f1518a47235de3d Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 4 Sep 2021 16:12:12 -0500 Subject: [PATCH] Make method work with node 14 --- components/video/player.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/video/player.vue b/components/video/player.vue index 4cfa35a..db09248 100644 --- a/components/video/player.vue +++ b/components/video/player.vue @@ -150,9 +150,12 @@ export default { }, computed: { posterSources () { + const standardYTPath = 'ytimg.com/vi/' + const standardYTPathRegex = new RegExp(standardYTPath, 'g'); + const webpSource = { ...this.video.thumbnail, - srcset: this.video.thumbnail.srcset.replaceAll('ytimg.com/vi/', 'ytimg.com/vi_webp/').replace(/.png|.jpg|.jpeg/g, '.webp') + srcset: this.video.thumbnail.srcset.replace(standardYTPathRegex, 'ytimg.com/vi_webp/').replace(/.png|.jpg|.jpeg/g, '.webp') } return {