Add Channel support (#144)

* Add Channel support

* Cross fade

* add todo
This commit is contained in:
Brahim Hadriche authored and GitHub committed 2023-09-15 17:34:07 -04:00
1 parent 38a054a46a
commit f452bf23de
16 files changed
+347 -60

No files matched your search

@@ -13,44 +13,9 @@ function OnContentSet() as void
return
end if
m.authorLabel.text = content.author
SetSubCount(content.subCount)
m.thumbnail.uri = GetThumbnailUrl(content.authorThumbnails)
SetVideoCount(content.videoCount)
end function
function SetSubCount(subCount as integer)
subCountText = ""
if subCount = 1
subCountText = "1 subscriber"
else
subCountText = `${subCount} subscribers`
end if
m.subCountLabel.text = subCountText
end function
function SetVideoCount(videoCount as integer)
videoCountText = ""
if videoCount = 1
videoCountText = "1 video"
else
videoCountText = `${videoCount} videos`
end if
m.videoCountLabel.text = videoCountText
end function
function GetThumbnailUrl(videoThumbnails as object) as string
if videoThumbnails = invalid or videoThumbnails.Count() = 0
return ""
end if
url = videoThumbnails[videoThumbnails.Count() - 1].url
if url.startsWith("//")
url = "https:" + url
end if
return url
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.authorLabel.text = content._author
m.subCountLabel.text = content.subCountText
m.videoCountLabel.text = content.videoCountText
m.thumbnail.uri = content.thumbnail
end function
@@ -8,27 +8,29 @@
<children>
<LayoutGroup
itemSpacings="[24,5,5]">
<Poster
id="thumbnail"
loadDisplayMode="scaleToZoom"
width="200"
height="196">
</Poster>
<MaskGroup
masksize="[294,294]"
maskuri="pkg:/images/circle-mask-500.png">
<Poster
id="thumbnail"
width="196"
height="196" />
</MaskGroup>
<Label
id="authorLabel"
width="200"
width="196"
font="font:SmallestBoldSystemFont"
maxLines="2"
wrap="true" />
<Label
id="subCountLabel"
width="200"
width="196"
height="25"
font="font:SmallestSystemFont" />
<Label
id="videoCountLabel"
width="200"
width="196"
height="25"
font="font:SmallestSystemFont" />
</LayoutGroup>