red5pro / streaming-html5

Testbed examples for Red5 Pro HTML SDK usage
https://red5pro.github.io/streaming-html5
Other
67 stars 51 forks source link

Video element has big current time value in a controls bar #125

Open cupuyc opened 6 years ago

cupuyc commented 6 years ago

I use new red5prosdk.RTCPublisher(); on my page with

<video id="red5pro-publisher" width="640" height="480" controls muted autoplay class="video"></video>

When I see camera, I also see video current time value: 46:33:26. This value should not be such big, because I just created stream with random name and even not published it.

default

Please suggest how to set that value to zero or more realistic (started counting from zero).

beetlejesss commented 6 years ago

I think that for the publisher this may reflect the time that the server has been running. @bustardcelly might be able to better respond to where this value is coming from.

bustardcelly commented 6 years ago

I believe you are correct @beetlejesss.

@cupuyc it should be noted that the Red5 Pro HTML SDK does not provide custom controls for broadcasts. This is the default Chrome display controls for a live broadcast.

Each browser displays their own custom controls for live broadcasts in the video and audio elements:

safari:

live_safari

firefox:

live_firefox

Safari recognizes it as a "Live" event, most likely because the duration value is coming in as Infinity.

Firefox starts counting up the time once the video element is presented in the DOM.

Not entirely sure how/where Chrome gets the time for its display - as @beetlejesss it may the time since the server has been alive.


You may not need to display the controls for publishers. If that is not a requirement, you can just remove the controls attribute from the video element declaration.

If you need the controls for live broadcast, I have not found a way to reset that time value. It is the currentTime property of the media element. Since it is a live event, it continually is being overwritten.

cupuyc commented 6 years ago

OK. Thanks for the clarification. For now I can just hide controls for demo. And in future I can add custom volume and fullscreen buttons.

Can be closed.