Video duration and currentTime

Hi Team,

We uploaded video in cloudflare using angular and now need to stream the video in the web page. We tried using both iframe and the angular streaming @cloudflare/stream-angular - npm as given in the docs. The video is streaming fine. But there is a requirement in our project to store the video progress percentage every 5 seconds in the DB. In the docs, they say we have properties like currentTime and duration. I tried to access similar to how we access them using HTML5 video element. However those properties value remain undefined. There is no code sample where those properties are accessed in the git code of that package as well. I used documentGetElementById to get the player element but of no use. Any support here would be highly appreciated.

This should be possible with the Stream Player SDK: https://developers.cloudflare.com/stream/viewing-videos/using-the-player-api

Happy to help further if you run into issues with the SDK.

1 Like