Add tv page posters with preload

This commit is contained in:
Sam Carlton 2021-05-15 18:28:51 -05:00
parent 5cfcd5a7aa
commit 7b004ea590
3 changed files with 51 additions and 17 deletions

View file

@ -172,18 +172,6 @@ class LiteYTEmbed extends HTMLElement {
// Computed methods
posterSources = () => {
const webpSource = {
...this.video.thumbnail,
srcset: this.video.thumbnail.srcset.replaceAll('ytimg.com/vi/', 'ytimg.com/vi_webp/').replace(/.png|.jpg|.jpeg/g, '.webp')
}
return {
webp: webpSource,
jpeg: this.video.thumbnail
}
}
frameId = () => {
return `youtube-player-${this.video.id}-${this._uid}`
}