Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing Roku Device Crashed Issue with TimeGridView Component. #97

Open
chaklasiyanikunj opened this issue Mar 31, 2023 · 1 comment
Open

Comments

@chaklasiyanikunj
Copy link

Hello,

I used your TimeGridView Component.

  • Your sample is working perfectly with local data.
  • But, When I added my data in Chroot and Chrow files using roUrlTransfer. It's working fine. But, App Crashed when I performed the Fast Scroll.

ChRoot File

sub GetContent()
    ' Fetch URL From Browser

    rxfer = CreateObject("roUrlTransfer")

    m.channels = "http:/203.109.69.134:8687/api/DefaultAPI/?file=1_channelsname.json" ' Here File Call From Server

    rxfer.SetUrl(m.channels)
    raw = rxfer.GetToString()
    json = ParseJson(raw)

    rootChildren = {
        children: []
    } ' channels array

    for each channel in json

        ch = "http://203.109.69.134:8687/api/DefaultAPI/?file=" + channel + ".json" ' Here File Call From Server

        rxfer.SetUrl(ch)

        raw = rxfer.GetToString()

        channelJSON = ParseJson(raw)

        channelNode = CreateObject("roSGNode", "ContentNode")
        channelNode.title = channelJSON.channel.call_sign
        channelNode.hdposterurl = channelJSON.channel.call_sign_img  ' .EncodeUriComponent()
        channelNode.id = channelJSON.object_id

        channelNode.id = channelJSON.object_id.ToStr()

        channelNode.AddFields({
            HandlerConfigTimeGrid: {
                name: "CHRow"
            }
        })

        rootChildren.children.Push(channelNode)
    end for

    m.top.content.Update(rootChildren)
end sub

ChRow File

sub GetContent()

    id = m.top.content.id
    dt = CreateObject("roDateTime")
    now = dt.AsSeconds()

    static = "00:00:00"
    st = static.Split(":")

    dt.ToLocalTime()

    currenthour = dt.GetHours()

    diff = currenthour - st[0].ToInt()
    remain = diff * 60 * 60

    if (dt.GetMinutes() > 30)
        playStart = now - (now mod 1800) - (86400 + remain + ((dt.GetTimeZoneOffset() * 60) + 30 * 60))
    else
        playStart = now - (now mod 1800) - (86400 + remain + (dt.GetTimeZoneOffset() * 60))
    end if

    rxfer = CreateObject("roUrlTransfer")

    channels = "http://203.109.69.134:8687/api/DefaultAPI/?file=3_guide_" + id + ".json" ' Here File Call From Server

    rxfer.SetUrl(channels)

    raw = rxfer.GetToString()

    json = ParseJson(raw)

    programNodes = {
        children: []
    }

    for each program in json
        ' create a node for the program and set its me

        programNode = {}
        if program.title <> invalid and program.title <> ""
            programNode.title = program.title
            programNode.url = program.url
            programNode.text = program.text
            programNode.description = + program.description
            programNode.FHDPosterUrl = + program.HDPosterUrl
            programNode.HDPosterUrl = + program.FHDPosterUrl
            programNode.TitleSeason = + program.channel_description

            programNode.id = program.season_number

            programNode.ShortDescriptionLine1 = program.clipstart
            programNode.ShortDescriptionLine2 = program.clipend

            programNode.ReleaseDate = program.airing_details.datetime
        else if program.airing_details.show_title <> invalid and program.airing_details.show_title <> ""
            programNode.title = program.airing_details.show_title
        else
            programNode.title = "---"
        end if
        if program.season_number <> invalid and program.episode_number <> invalid
            programNode.description = "S" + program.season_number.ToStr() + " E" + program.episode_number.ToStr()
        end if

        programNode.playStart = playStart
        programNode.playDuration = program.airing_details.duration
        programNodes.children.Push(programNode)

        playstart += programNode.playDuration
    end for

    m.top.content.Update(programNodes)
end sub
  • It's like When I am in the first row and performing a scroll pressing a continuous down arrow. App Stuck and Restart the Roku Device or sometimes It's automatically Roku Device Restart.
  • At first, I thought It was a hardware-specific issue. But, I tested this with Roku Streaming Stick, Roku Express, Roku Premiere, and Roku Ulta. The same thing happened on all the devices.
  • It's difficult to find this with debugging the code. I checked many articles and blogs. But, I did not find anything.
  • I attached my App here. Can you please share with your dev team and find what is affected by the issue in Chroot and Chrow files for crashing the App?
  • Also, I attached the Sample => TimeGridView_App.zip with my data. It will helpful.
  • Can someone suggest to me what I am doing wrong here? It would be really appreciated.

Thank you,
With regards,
Nikunj

@RokuChris
Copy link
Contributor

Device reboots can be an indication of memory problems, especially on less capable devices. As a first step, I would suggest using Roku Resource Monitor or the Brightscript Profiler to better understand what's going on. https://devtools.web.roku.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants