gomad
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2018
03:42 AM
Video node progressive download indicator
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
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
6 REPLIES 6
tim_beynart
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2018
08:55 AM
Re: Video node progressive download indicator
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
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2018
11:47 PM
Re: Video node progressive download indicator
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.
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.

24i
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018
02:52 AM
Re: Video node progressive download indicator
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
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
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2018
04:50 AM
Re: Video node progressive download indicator
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
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2018
09:00 AM
Re: Video node progressive download indicator
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.
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.
chaklasiyanikun
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020
06:30 AM
Re: Video node progressive download indicator
@tim_beynart wrote: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
I did this trick which is @tim_beynart said for display a video buffering percentage. But, when 100% of buffering is done, status.percentage line APK was crashed. Does anyone know why crashed here and any solution for this?