Background poster in dev player
This commit is contained in:
1 parent
38e8856b09
commit
37b3e88b93
3 files changed
+64
-17
No files matched your search
@@ -5,19 +5,25 @@ import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
|
||||
function VideoContentTaskDev(input as object) as object
|
||||
titleLabel = input.titleLabel
|
||||
secondaryTitleLabel = input.secondaryTitleLabel
|
||||
backgroundPoster = input.backgroundPoster
|
||||
contentNode = input.content
|
||||
invidiousNode = input.invidious
|
||||
|
||||
titleLabel.text = contentNode.title
|
||||
secondaryTitleLabel.text = contentNode.secondaryTitle
|
||||
|
||||
if StringUtils.IsNullOrEmpty(contentNode.videoId)
|
||||
videoId = contentNode.videoId
|
||||
|
||||
if StringUtils.IsNullOrEmpty(videoId)
|
||||
throw "Can't load video information: videoId is missing"
|
||||
end if
|
||||
|
||||
service = new Invidious.InvidiousService(invidiousNode)
|
||||
instance = service.GetInstance()
|
||||
|
||||
response = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation })
|
||||
backgroundPoster.uri = `${instance}/vi/${videoId}/maxresdefault.jpg`
|
||||
|
||||
response = service.GetVideoMetadata(videoId, { cancellation: m.top.cancellation })
|
||||
|
||||
if m.top.cancel
|
||||
return invalid
|
||||
|
||||
Reference in new issue
Block a user