jf-roku/components/extras/ExtrasItem.brs

38 lines
1.0 KiB
Plaintext
Raw Normal View History

sub init()
m.posterImg = m.top.findNode("posterImg")
m.name = m.top.findNode("pLabel")
m.role = m.top.findNode("subTitle")
end sub
sub showContent()
if m.top.itemContent <> invalid
cont = m.top.itemContent
m.name.text = cont.labelText
m.name.maxWidth = cont.imageWidth
2023-02-11 17:13:47 +00:00
m.role.maxWidth = cont.imageWidth
m.posterImg.uri = cont.posterUrl
m.posterImg.width = cont.imageWidth
m.role.Text = cont.subTitle
else
2022-04-26 02:18:12 +00:00
m.role.text = tr("Unknown")
m.posterImg.uri = "pkg:/images/baseline_person_white_48dp.png"
end if
end sub
sub focusChanged()
2023-01-31 17:27:00 +00:00
if m.top.itemHasFocus = true
m.name.repeatCount = -1
2023-02-08 15:29:44 +00:00
m.role.repeatCount = -1
2023-01-31 17:27:00 +00:00
else
m.name.repeatCount = 0
2023-02-08 15:29:44 +00:00
m.role.repeatCount = 0
2023-01-31 17:27:00 +00:00
end if
if m.global.device.isAudioGuideEnabled = true
txt2Speech = CreateObject("roTextToSpeech")
txt2Speech.Flush()
txt2Speech.Say(m.name.text)
txt2Speech.Say(m.role.text)
end if
end sub