I am creating a SDK channel following the Roku published video courses using the Roku developers templates given on Github. I’ve sideloaded the channel to my Roku device and reached the debugging process using Visual Studio Code program. I currently have category-based videos and series on my channel and I’ve noticed the channel freezing when I attempt to play one of the videos in some my categories/series and I keep getting a type mismatch error on line 21 of my EpisodeScreen.brs for if (categoryIndex - 1) = m.categoryList.jumpToItem
sub OnListItemFocused(event as Object) ' invoked when episode is focused
focusedItem = event.GetData() ' index of episode
' index of season which contains focused episode
categoryIndex = m.itemToSection[focusedItem]
' change focused item in seasons list
if (categoryIndex - 1) = m.categoryList.jumpToItem
m.categoryList.animateToItem = categoryIndex
else if not m.categoryList.IsInFocusChain()
m.categoryList.jumpToItem = categoryIndex
end if
end sub
The Debugging console generes this report:
Current Function:
016: sub OnListItemFocused(event as Object) ’ invoked when episode is focused
017: focusedItem = event.GetData() ’ index of episode
018: ’ index of season which contains focused episode
019: categoryIndex = m.itemToSection[focusedItem]
020: ’ change focused item in seasons list
021:* if (categoryIndex - 1) = m.categoryList.jumpToItem
022: m.categoryList.animateToItem = categoryIndex
023: else if not m.categoryList.IsInFocusChain()
024: m.categoryList.jumpToItem = categoryIndex
025: end if
Source Digest(s):
pkg: dev 1.0.1 aa1859c8d20764eaf71363f84ec64ab3 Tattness TV
Type Mismatch. (runtime error &h18) in pkg:/components/EpisodesScreen/EpisodeScreen.brs(21)
Backtrace:
#0 Function onlistitemfocused(event As Object) As Void
file/line: pkg:/components/EpisodesScreen/EpisodeScreen.brs(21)
Local Variables:
event roSGNodeEvent refcnt=2
global Interface:ifGlobal
m roAssociativeArray refcnt=2 count:6
focuseditem roInt refcnt=1 val:-1 (&hFFFFFFFF)
categoryindex Invalid
vscodeloopkey
content
Threads:
ID Location Source Code
0 pkg:/source/main.brs(22) msg = wait(0, m.port)
1* …sodesScreen/EpisodeScreen.brs(21) if (categoryIndex - 1) = m.categoryList.jumpToItem
*selected
I am completely new to coding and know basics and am usually able to search to find answers but I seem to have not found the needed answer to solve this. Just to add that one of my series does appear and play the video. I do apologize but I do greatly appreciate the help and welcome any resources to help me or pointers. Thank you!!
