Make method work with node 14

This commit is contained in:
Sam Carlton 2021-09-04 16:12:12 -05:00
parent 0f8da129d3
commit 9110bfa9b8

View file

@ -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 {