Forum Discussion

Gbenga's avatar
Gbenga
Reel Rookie
3 years ago

Hi, please how do i get start time and end time of a video in the roku development. Thank you

Hi, please how do i get start time and end time of a video in the roku development. Thank you

3 Replies

  • Hi, sounds like you might need some help getting started on this one as it's not often as simple as ...a.b.c etc ... there are complexities to this player!

     

    suggest you first accept an invite to the very helpful Roku Developers Slack channel where if you post in the #general channel you should find a helpful community there.

     

    https://join.slack.com/t/rokudevelopers/shared_invite/zt-22n9u11c1-zoqCczrSTRiMxid4kWBPRA

     

    These links may be a bit too deep too quickly but there are certain events we can listen for like

     

    https://developer.roku.com/en-gb/docs/references/brightscript/events/rovideoplayerevent.md

    isPlaybackPosition() as Boolean

     

    to notify of position changed.

     

    you can also enable the UI in the player which shows the progress bar, which I think will also have progress events as the video progresses

     

    also

     

    GetIndex() as Integer
    Returns current position in the stream (in seconds) from the beginning.

     

    also

     

    GetInfo() as Object
    Returns an roAssociativeArray array with the following key-value pairs:

    Member Type Value
    ClipIdx Integer The zero starting index of the item in the content list this event is related to
    ClipPos Integer The player position relative to the start of the clip in milliseconds

     

    also

     

    https://developer.roku.com/en-gb/docs/references/scenegraph/media-playback-nodes/video.md

    duration time 0 READ_ONLY The duration of the video being played, specified in seconds. This becomes valid when playback begins and may change if the video is dynamic content, such as a live event.

     

     

    as I said it's pretty heavy going even for simple stuff ... hope that helps

     

    Phil

    • Gbenga's avatar
      Gbenga
      Reel Rookie

      Thank you so much Phil, i really do appreciate. i will do as suggested and dully give you an update.
      thank you