Your Digital Media Has Never Looked So Good

 
Meron
Topic Author
Posts: 2
Joined: Wed Nov 08, 2017 6:34 pm

Error Please help this code

Wed Nov 08, 2017 6:41 pm

hello, a warm greeting, I am new developing in roku, and I based on a code that was not developed by me, the problem is the following, with the recent update of roku OS8, it has stopped working, my live category , it's perfect, but where I put my videos by categories does not work, after the update of the roku.

Investigate a little, and note that many things changed from version os8, example
https://sdkdocs.roku.com/display/sdkdoc ... creenEvent

function GridScreen_run()

    this = m

    while true
        msg = wait(0, this._port)

        if msg = invalid then
            exit while
        end if

        if msg.isListItemSelected() then
            selected_list = msg.getIndex()
            selected_item = msg.getData()
            contentItem = this._lists[selected_list][selected_item]

            if contentItem.cid = "search" then
                this._search()
            elseif contentItem.ContentType = "series"
                this._beginWrapper()

                if selected_list = this.BUSCAR
                    searchTerm = this._lastSearch
                else
                    searchTerm = ""
                end if
                
                finished = this._watch(contentItem, this._titles[selected_list], searchTerm)

                this._endWrapper()
            elseif contentItem.ContentType = "episode"
                this._beginWrapper()

                if selected_list = this.BUSCAR
                    searchTerm = this._lastSearch
                else
                    searchTerm = ""
                end if

                SwatchNext:

                finished = this._watch(contentItem, this._titles[selected_list], searchTerm)
                    if finished and selected_item < this._lists[selected_list].count() - 1 then
                        selected_item = selected_item + 1
                        previousContentItem = contentItem
                        contentItem = this._lists[selected_list][selected_item]

                        playNext = this._interstitialScreen.show(contentItem, previousContentItem)

                        if playNext then
                            goto SwatchNext
                        end if
                    end if

                this._endWrapper()
            elseif contentItem.ContentType = "movie"
                this._beginWrapper()

                if selected_list = this.BUSCAR
                    searchTerm = this._lastSearch
                else
                    searchTerm = ""
                end if

                watchNext:

                finished = this._watch(contentItem, this._titles[selected_list], searchTerm)
                    if finished and selected_item < this._lists[selected_list].count() - 1 then
                        selected_item = selected_item + 1
                        previousContentItem = contentItem
                        contentItem = this._lists[selected_list][selected_item]

                        playNext = this._interstitialScreen.show(contentItem, previousContentItem)

                        if playNext then
                            goto watchNext
                        end if
                    end if

                this._endWrapper()
            elseif contentItem.ContentType = "live"
                finished = this._watch(contentItem, this._titles[selected_list], searchTerm)
                this._endWrapper()
            end if
        else if msg.isRemoteKeyPressed() then
            if msg.getIndex() = 10 then
                this._search()
            end if
        else if msg.isScreenClosed() then
            exit while
        end if
    end while
end function

function _GridScreen_watch(contentItem, fromList, searchTerm)

    this = m
    if contentItem.ContentType = "movie" or contentItem.ContentType = "episode"
        if isFinished(contentItem) then
            unMarkAsFinished(contentItem)
            for i = 0 to this._lists[this.VISTO].count() - 1
                if this._lists[this.VISTO][i].cid = contentItem.cid then
                    this._lists[this.VISTO].delete(i)
                    exit for
                end if
            end for
            if this._lists[this.VISTO].count() = 0 then
                this._screen.setListVisible(this.VISTO, false)
            end if
        endif

        finished = this._videoScreen.play(contentItem, fromList, searchTerm)
        lastWatched = contentItem["visto"]
        contentItem["visto"] = setLastWatched(contentItem)
        if contentItem.ContentType = "episode" then
            this._feed["visto"] = setLastWatched(this._feed)
        endif

        if finished then
            markAsFinished(contentItem)
        end if

        if lastWatched <> invalid then
            ' Remove vid from unwatched list
            for i = 0 to this._lists[this.VISTO].count() - 1
                if this._lists[this.VISTO][i].cid = contentItem.cid then
                    this._lists[this.VISTO].delete(i)
                    exit for
                end if
            end for
        end if

        ' Add vid to watched list
        if finished then
            yasta = false

            for y = 0 to this._lists[this.VISTO].count() -1
                if this._lists[this.VISTO][y].cid = contentItem.cid
                    yasta = true
                end if
            end for
            if not yasta then
                this._lists[this.VISTO].unshift(contentItem)
                this._screen.setContentList(this.VISTO, this._lists[this.VISTO])

                if this._lists[this.VISTO].count() = 1 then
                    this._screen.setListVisible(this.VISTO, true)
                end if
            endif
        else
            yasta = false

            for y = 0 to this._lists[this.VIENDO_AHORA].count() -1
                if this._lists[this.VIENDO_AHORA][y].cid = contentItem.cid
                    yasta = true
                end if
            end for
            if not yasta then
                this._lists[this.VIENDO_AHORA].unshift(contentItem)
                this._screen.setContentList(this.VIENDO_AHORA, this._lists[this.VIENDO_AHORA])

                if this._lists[this.VIENDO_AHORA].count() = 1 then
                    this._screen.setListVisible(this.VIENDO_AHORA, true)
                end if
            endif
        end if

        return finished
    else if contentItem.ContentType = "series"
        seriesgrid = GridScreen("serie", contentItem.cid)
        print "Running the grid Serie " contentItem.nombre
        seriesgrid.run()
    else if contentItem.ContentType = "live"
        finished = this._videoScreen.playlive(contentItem)
        return finished
    endif
end function
 
Meron
Topic Author
Posts: 2
Joined: Wed Nov 08, 2017 6:34 pm

Re: Error Please help this code

Wed Nov 08, 2017 6:47 pm

I can pay to help me in this problem, I urgently need a solution

Who is online

Users browsing this forum: No registered users and 24 guests