Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
NexumTV
Level 7

Infinite requests in feed

12345
0 Kudos
5 Replies
renojim
Level 8

Re: Infinite requests in feed

What format are you videos? Assuming MPEG4, are they optimized for streaming (moov atom at beginning)?
0 Kudos
NexumTV
Level 7

Re: Infinite requests in feed

"renojim" wrote:
What format are you videos?  Assuming MPEG4, are they optimized for streaming (moov atom at beginning)?


Hello friend, they are mp4 videos, I did nothing to optimize them or something similar, the download of several internet pages where they already spoil so I guess and have already been optimized, however I happen in both mp4 and hls, and to Check it on the server, for example it is only 1 person and it appears that I try to connect 200, or 300 times and if I have limited a number of people from the tomb at all.

Any idea why that happens? regards
0 Kudos
Tyler_Smith
Level 7

Re: Infinite requests in feed

Can you provide the code where you execute your task?  My assumption is you are triggering the task over and over again either in a loop or from a observeField that is constantly triggered.
Tyler Smith
Senior Developer, REDspace
redspace.com
0 Kudos
NexumTV
Level 7

Re: Infinite requests in feed

"Tyler Smith" wrote:
Can you provide the code where you execute your task?  My assumption is you are triggering the task over and over again either in a loop or from a observeField that is constantly triggered.

Hello, I have this code to simply get the data of an xml with the items to be reproduced

contentxml = createObject("roXMLElement")
 readInternet = createObject("roUrlTransfer")
      readInternet.setUrl(m.top.contenturi)
      contentxml.parse(readInternet.GetToString())

      if contentxml.getName()="Content"
        for each item in contentxml.GetNamedElements("item")
          itemcontent = content.createChild("ContentNode")
          itemcontent.setFields(item.getAttributes())
        end for
      end if

It's a scene with labellist, where I do this to make the video component visible.

m.videolist.observeField("itemFocused", "setvideo")
m.videolist.observeField("itemSelected", "playvideo")

sub setvideo()
    if (m.preview.visible=true)
      videocontent = m.videolist.content.getChild(m.videolist.itemFocused)
      m.videoposter.uri = videocontent.hdposterurl
      m.videolist.setFocus(true)

      else if (m.preview.visible=false)

       videocontent = m.videolist.content.getChild(m.videolist.itemFocused)
       m.videoposter.uri = videocontent.hdposterurl
       m.videoinfo.text = videocontent.title
       m.video.content = videocontent
       m.preview.content= videocontent
       m.detalles.text = videocontent.description
       m.preview.control ="stop"
       m.preview.visible ="false"
       m.videoposter.visible="true"

      end if
    end sub

    sub playvideo()
      m.video.control = "play"
      m.video.visible = true
      m.video.setFocus(true)
      m.preview.control = "stop"
      m.preview.visible ="false"
      m.videoposter.visible="true"
    end sub
Thanks for the help, really try everything and I do not know what I'm wrong

I keep my reading file in a shared hosting and linke to my dedicated server and the VPS, all are "saturated" by so many requests but are not really spending resources, something like a ddos attack, and only happens when I reproduce the xml of Hosting.
0 Kudos
Tyler_Smith
Level 7

Re: Infinite requests in feed

So is the video request send over and over again or a request for your content uri?

I have a feeling that the function for your content feed is stuck in a loop.  What triggers this block?
contentxml = createObject("roXMLElement")
[font=-apple-system, Helvetica Neue, Helvetica, sans-serif] readInternet = createObject("roUrlTransfer")[/font]
[font=-apple-system, Helvetica Neue, Helvetica, sans-serif]      readInternet.setUrl(m.top.contenturi)[/font]
      contentxml.parse(readInternet.GetToString())
Tyler Smith
Senior Developer, REDspace
redspace.com
0 Kudos