Set thumbnail for YouTube option

This commit is contained in:
Korbs 2024-11-30 15:56:08 -05:00
parent eb9f6baca5
commit 66b259a105

View file

@ -12,6 +12,7 @@ const {
AudioAttributes,
ShowBackAndForward,
BigPlayButton = false,
YouTube = false,
YouTubeQuality = '137',
@ -43,6 +44,7 @@ if (YouTube === true) {
// 1080p = 137
// 720p = 302
// Dash Audio = 251
var YTThumbnail = 'https://i.ytimg.com/vi/' + WatchId +'/maxresdefault.jpg'
var YTVideo = 'https://' + Invidious +'/latest_version?id=' + WatchId + '&itag=' + YouTubeQuality
var YTAudio = 'https://' + Invidious +'/latest_version?id=' + WatchId + '&itag=251'
} else if (YouTube === false) {
@ -55,7 +57,7 @@ import './Styles/Iconoir.css'
---
<div class="video-container" id={"zorn-player-" + PlayerName}>
<video class="main-video" {VideoAttributes} disableremoteplayback src={YouTube ? YTVideo : Video} poster={Poster} preload="auto"></video>
<video class="main-video" {VideoAttributes} disableremoteplayback src={YouTube ? YTVideo : Video} poster={YouTube ? YTThumbnail : Poster} preload="auto"></video>
{Audio ? <audio class="main-audio"><source {AudioAttributes} src={YouTube ? YTAudio : Audio} type="audio/mp3"/></audio> : null }
{Audio ? <Sync PlayerName={PlayerName}/> : null }
{Milieu ?
@ -69,6 +71,11 @@ import './Styles/Iconoir.css'
:
null
}
{BigPlayButton ?
<button class="big-present-button"><i class="iconoir-play-solid"></i></button>
:
null
}
{SettingsMenu ?
<Controls ShowBackAndForward={ShowBackAndForward} PlayerName={PlayerName} Live={Live}>
<button id="open-zorn-settings-button" onclick="OpenZornMenu()"><i class="iconoir-settings"></i></button>
@ -81,7 +88,7 @@ import './Styles/Iconoir.css'
:
<Controls ShowBackAndForward={ShowBackAndForward} PlayerName={PlayerName} Live={Live}/>
}
<Controller PlayerName={PlayerName}/>
<Controller PlayerName={PlayerName} BigPlayButton={BigPlayButton}/>
<Seek PlayerName={PlayerName}/>
</div>