mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Make method work with node 14
This commit is contained in:
parent
0f8da129d3
commit
9110bfa9b8
1 changed files with 4 additions and 1 deletions
|
|
@ -150,9 +150,12 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
posterSources () {
|
posterSources () {
|
||||||
|
const standardYTPath = 'ytimg.com/vi/'
|
||||||
|
const standardYTPathRegex = new RegExp(standardYTPath, 'g');
|
||||||
|
|
||||||
const webpSource = {
|
const webpSource = {
|
||||||
...this.video.thumbnail,
|
...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 {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue