diff --git a/components-nuxt/video/player.vue b/components-nuxt/video/player.vue index 9f02ca7..234a02e 100644 --- a/components-nuxt/video/player.vue +++ b/components-nuxt/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 {