Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
perrycbrown
Channel Surfer

Question about accessing several videos' info within a Video playlist

After I have created a playlist and assigned it to a Video node, how do I access the info of each video within the playlist, as the playlist moves from video 1, to video 2, to video 3, etc. ?

I'm already watching the Video.contentIndex field :
m.Video.ObserveField("contentIndex", "OnPlaylistIndexChange")


...but when I examine m.Video or m.Video.content within sub OnPlayListIndexChange( ), I'm not seeing anything that looks like a listing of the individual videos within the playlist.

I need to know the individual videos' info so I can log tracking info to Boxcast, where the vids originate, and thus track each video within the playlist separately in Boxcast.

Thanks for any help...
0 Kudos
2 REPLIES 2
norcaljohnny
Roku Guru

Re: Question about accessing several videos' info within a Video playlist

Not sure what all info you need but you can use something as simple as..

sub OnPlaylistIndexChange()
  print m.Video.content
end sub



Which will return something similar to this.


  <Component: roSGNode:ContentNode> =
  {
      change: <Component: roAssociativeArray>
      focusable: false
      focusedChild: <Component: roInvalid>
      id: ""
      HDPOSTERURL: "https://archive.org/download/TheBobNewhartShow/TheBobNewhartShow.thumbs%2FThe%20Bob%20Newhart%20Show%20-%20Season%201%2FThe%20Bob%20Newhart%20Show%20s01e01%20-%20Fly%20the%20Unfriendly%20Skies_001463.jpg"
      SHORTDESCRIPTIONLINE1: ""
      STREAMFORMAT: "mp4"
      TITLE: "2 The Bob Newhart Show - Season 1 The Bob Newhart Show s01e01 - Fly the Unfriendly Skies"
      URL: "https://archive.org/download/TheBobNewhartShow/The%20Bob%20Newhart%20Show%20-%20Season%201%2FThe%20Bob%20Newhart%20Show%20s01e01%20-%20Fly%20the%20Unfriendly%20Skies.mp4"
  }
0 Kudos

Re: Question about accessing several videos' info within a Video playlist

You need to access the children of m.video.content. I.e. m.video.content.getChild(m.video.contentIndex)
0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!