Your Digital Media Has Never Looked So Good

 
gomad
Topic Author
Posts: 57
Joined: Wed Nov 29, 2017 4:07 am

Video node progressive download indicator

Wed Apr 18, 2018 3:42 am

Hi,
I am using a video node and trying to make a custom UI for the player. I wanted to show a progress bar with current progress and downloaded (buffered) segments (if any). I have a DASH/HLS content. How do i achieve this? I am getting the current position by observing the "position" field but not sure how to calculate/get the buffered data position, anyone?

regards,
gm
 
tim_beynart
Posts: 227
Joined: Wed Jul 15, 2015 8:30 am

Re: Video node progressive download indicator

Thu Apr 19, 2018 8:55 am

m.videoplayer.observeFieldScoped("bufferingStatus", "onBufferChanged")

sub onBufferChanged()
  ' log percentage buffered
  status = m.videoplayer.bufferingStatus
  ?  status.percentage
end sub

https://sdkdocs.roku.com/display/sdkdoc ... playFields
 
gomad
Topic Author
Posts: 57
Joined: Wed Nov 29, 2017 4:07 am

Re: Video node progressive download indicator

Mon Apr 23, 2018 11:47 pm

thanks, but this was not what i was looking for, i was thinking of something that is "pre-bufferred" or pre-dowloaded while playback is going on. 
So for e.g , the progress bar would look something like this : 
=======|____ 
where "===" is the actual progress of the video, "|" is the current position of playback and "____" is the pre-buffered stream content.
Hope this makes sense. This is seen in youtube, i am not sure how to implement in SG.
 
User avatar
24i
Posts: 37
Joined: Wed Feb 15, 2017 7:22 am

Re: Video node progressive download indicator

Tue Apr 24, 2018 2:52 am

Hi gomad,

We haven't done this before, but I do know that there are read-only fields like "streamingSegment" and "streamingSegment" on the video node. Maybe that helps?
Source: https://sdkdocs.roku.com/display/sdkdoc/Video
 
gomad
Topic Author
Posts: 57
Joined: Wed Nov 29, 2017 4:07 am

Re: Video node progressive download indicator

Wed Apr 25, 2018 4:50 am

I tried using those, these were giving increments based on streams segment values. It would have helped if i got the total segments in the stream at start of the playing itself, i could not find any fields that gave those. Its need to calculate the increment for drawing the progress.
 
tim_beynart
Posts: 227
Joined: Wed Jul 15, 2015 8:30 am

Re: Video node progressive download indicator

Wed Apr 25, 2018 9:00 am

Off the top of my head:
You can download the HLS manifest as a text file in parallel with the player. Parse it and perform calculations to figure out how many segments there are, and how long each one is.
Then you can use the "downloadedSegment" field to track which segments are in the buffer, and use the "streamingSegment" field to determine where the playhead is in the playlist.

Who is online

Users browsing this forum: No registered users and 3 guests