Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlasHLS playback: player.getCurrentTime() is not consistent with events #1221

Closed
medeeiros opened this issue Nov 23, 2016 · 16 comments
Closed
Labels

Comments

@medeeiros
Copy link
Contributor

Browser: 54.0.2840.98 (64-bit)

OS: OS X El Capitan 10.11.6

Clappr Version: 0.2.64

Steps to reproduce:

  • Set the source to a HLS LIVE stream with DVR
  • Use the FlasHLS playback: plugins: [Clappr.FlasHLS]
  • Set the debug level to 0 Clappr.Log.setLevel(0)
  • While you are watching live, compare the player.getCurrentTime() with the debug events
@cinnabot
Copy link

cinnabot commented Nov 23, 2016

Hi, I have some suggestions to help solving this issue!

Here is a list of similar issues:

  1. [FlasHLS] missing play event after starting paused LIVE stream

  2. What is the proper way to force FlasHLS?

  3. DVR on Safari

  4. [Clappr.Log] set log level to disabled

  5. How to detect FlasHLS?

Hope this is useful!

Cheers,
Cinnabot.

PS: Liked my suggestions? Install me in your repository! Visit: getcinnamon.io.

@medeeiros
Copy link
Contributor Author

var playerElement = document.getElementById("player-wrapper");

Clappr.Log.setLevel(0)

window.player = new Clappr.Player({
  source: '[A LIVE HLS URL]',
  baseUrl: '/latest',
  poster: 'http://clappr.io/poster.png',
  mute: true,
  autoPlay: true,
  plugins: [Clappr.FlasHLS],
  height: 360,
  width: 640,
  events: {
    onTimeUpdate: console.log
  }
});

player.attachTo(playerElement);

@leandromoreira
Copy link
Member

I tried to reproduce this using one internal live stream and the results were consistent:

With a DVR of 590s the logger shows consistently 590 ... 590 forever and when we start to watch a previous moment (DVR mode) the position was consistent with duration too. What values were you expecting to see and what values did you get?

@medeeiros
Copy link
Contributor Author

If you are watching the DVR, then yes. But if you are watching the LIVE it will return the duration. Check the PR.

@leandromoreira
Copy link
Member

Let's say a playlist is 30 seconds long then the event will always trigger with the value 30 or 30.1 or 29.999 forever.

This means that the duration is equal to the current time, is that what you mean? if yes, then this is not a bug, we chose to use this layout for live streaming but we're open to suggestions, what time would you want to see from live events?

@medeeiros
Copy link
Contributor Author

It is actually the opposite. The current time is equal to the duration. Which is pretty bad in my case since I need to save the exact time of the interaction with the player.

@tjenkinson
Copy link
Contributor

Does it behave the same as the js hls playback?

On 23 Nov 2016, at 17:31, Guilherme Medeiros <notifications@github.commailto:notifications@github.com> wrote:

It is actually the opposite. The current time is equal to the duration. Which is pretty bad in my case since I need to save the exact time of the interaction with the player.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/1221#issuecomment-262564535, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADG-WeRl9vYjYe6WgmjDfd6xbp2Vpntnks5rBGpNgaJpZM4K6i_z.

@medeeiros
Copy link
Contributor Author

No. That's exactly how I found this issue. We have a http streaming url and our website is https. So as you can imagine, due to mixed content we had to force FlasHLS as a playback, and that's when things started to get out of sync.

@leandromoreira
Copy link
Member

💩 I was testing under hls.js sorry @GuilhermeMedeiros

@leandromoreira
Copy link
Member

The current time is equal to the duration. Which is pretty bad in my case since I need to save the exact time of the interaction with the player.

When you mean time, do you mean it's a clock UTC time or time as time elapsed since the user start to watch the video?

@medeeiros
Copy link
Contributor Author

The elapsed time. player.getCurrentTime()

@medeeiros
Copy link
Contributor Author

Maybe you can't really notice if you have very short chunks. In our case we have 10 sec so things can really get out of sync since we need precision.

@leandromoreira
Copy link
Member

@GuilhermeMedeiros sorry for the long delay, let's try to get back and see what we can do.

First getCurrentTime() should return the elapsed time (in seconds) from the start of the streaming. Let's say we have a live hls streaming with chunks of 2s with a DVR window of 4 minutes (240s).

  • Then when I play the video, what was the value you were expecting from getCurrentTime()?
  • After 40s, what is the value you are expecting from getCurrentTime()?
  • After 360s, what is the value you are expecting from getCurrentTime()?

@medeeiros
Copy link
Contributor Author

Well, as you said, I expect the elapsed time, and not the total time, which is what the Flash playback returns at the moment.

@medeeiros
Copy link
Contributor Author

The only thing that really matters to me is to have consistency across playbacks, which is not the case at the moment and my PR fixes that.
What you expect from getCurrentTime() is up to you, if you want the elapsed or the total time when it's a live stream.

@leandromoreira
Copy link
Member

Thanks 👍 I got you @GuilhermeMedeiros @towerz and I will discuss this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants