Hello - I’m wondering if its possible to get the meta data from a video. I’ve seen that this appears possible for audiostreams and images but nothing on videos. If it is not possible, is there some method of establishing how long a video is? I wish to display a playback progress bar. I know how to get the playback position from video event messages. I would like to display this as a ratio of the total video time.
Unfortunately there’s nothing exposed to BrightScript that gives this information. Even though the roVideoScreen has it, it doesn’t make it available anywhere, as far as I’ve found. You’ll need to rely on getting the metadata from someplace else, or trying to parse it from the file headers directly. In my custom roVideoPlayer implementations, I’ve opted to just show current playback time, if the overall length isn’t provided, and show a full playback progress bar if it is.
There’s an event (type 7) that is sent at the start of play and contains the duration of the video. It doesn’t seem to be documented, so I’m not sure if it’s plumbed all the way up to Brightscript.
–Mark
“RokuMarkn” wrote:
There’s an event (type 7) that is sent at the start of play and contains the duration of the video. It doesn’t seem to be documented, so I’m not sure if it’s plumbed all the way up to Brightscript.–Mark
Hi Mark,
Can you describe how can we capture that event type 7?
Thanks.
“csPlay” wrote:
“RokuMarkn” wrote:
There’s an event (type 7) that is sent at the start of play and contains the duration of the video. It doesn’t seem to be documented, so I’m not sure if it’s plumbed all the way up to Brightscript.–Mark
Hi Mark,Can you describe how can we capture that event type 7?
Thanks.
It’s not exposed to Brightscript currently, so you can’t capture it. Hopefully Mark will have better news concerning that, as it would come in extremely handy, particularly for custom video players.
That’s correct, it’s not currently available to Brightscript. There is a pending enhancement request to implement it, but I don’t know when that will be released.
–Mark
Does that mean that if we use the component rovideoplayer, there is no way of knowing the full duration untill the end of the stream? (assuming we do not have a metadata for that specific stream)
“csPlay” wrote:
Does that mean that if we use the component rovideoplayer, there is no way of knowing the full duration untill the end of the stream? (assuming we do not have a metadata for that specific stream)
That is correct. For non-Live HLS, I parse the M3U8 playlist to calculate the length. For MP4, without metadata, there’s nothing to work with.
Is this still true? Not exposed to brightscript yet?
In 5.0 and later firmware, there is ifVideoPlayer.GetPlaybackDuration.
http://sdkdocs.roku.com/display/sdkdoc/ … nasInteger
–Mark
Thanks, unfortunately I’m working with roVideoScreen and no roVideoPlayer
Just out of curiosity, what would you do with the video duration on an roVideoScreen?
–Mark
I’m working on an analytics plugin that determines the % of video watched. To do that, I need to know the total duration. Rather than report it in the metadata, it would be nice of the SDK exposed it.
Sorry for the stupid question, but do I need to have SDK version 5 on my PC to use GetPlaybackDuration() (if so when will it be available/where can I get it)?
My Roku has SW version 5.0 (Build: 7070) but whenever I try to call GetPlaybackDuration I’m getting the following error:
Member function not found in BrightScript Component or interface. (runtime error &hf4) in …/pkg:/source/xyz
Thanks for your help
Patrick
Sorry about that, it looks like our documentation is a little ahead of our releases this time. That function is not available in 5.0 but will be available in a future release.
–Mark
Thanks for the clarification, Mark!
Is there a rough estimate when the function will be available?
Thanks again!
Patrick
“PatrickH” wrote:
Thanks for the clarification, Mark!
Is there a rough estimate when the function will be available?
I guess not… ![]()
