Giter Site home page Giter Site logo

Comments (4)

Arnavion avatar Arnavion commented on September 23, 2024

AutoClock take value of currentTime from html5 video only once.

It should be taking the currentTime value once every rAF tick. As soon as the currentTime changes (about 1 every 250ms except on IE where it's more frequent) it will snap to that new time. The purpose of AutoClock is to interpolate the timestamps in between changes of video.currentTime (or other external drivers, like say setTimeout) for less bleeding.

Are you sure it only takes it on play and seek? Does it happen on desktop as well or only mobile? I cannot repro it on desktop.

Maybe sync time each "onupdatetime" event?

That is basically what it already does. As you can see, AutoClock's constructor takes a driver in the form of a function () -> currentTime. For VideoClock, this is the function () => videoElement.currentTime. In other words it doesn't use the ontimeupdate event itself, but the currentTime updates with the same frequency so it amounts to the same thing.

BTW, why you decided to switch from "onupdatetime" to manual clock only?

Even before AutoClock, VideoClock did not use the timeUpdate event. As I said it is very infrequent and so there's too much bleeding. Also browsers are inconsistent on whether they fire timeUpdate events during seeking, or while holding the seek thumb down and not moving it, etc. So back then VideoClock itself polled video.currentTime in every rAF callback.

However if you wanted to use, say, a flash player instead of video element, then you could not use VideoClock. So this interpolation behavior of VideoClock would not be available to you and you would have to code it yourself. So AutoClock was introduced to extract this behavior from VideoClock in a way that is independent of the video element. That's why it takes the driver function - this is an abstraction over any form of playback.

from libjass.

Dador avatar Dador commented on September 23, 2024

That's how it looks from side:

  • Start play video
  • Opening with various heavy effects (which lags around 2 seconds)
  • All dialogues after opening is delayed for 2 seconds.

After testing it many times I think Chrome Mobile reports wrong currentTime after such lags. For example at real video position 01:00 it reports 00:58.
Only after seek it starts to report right currentTime. That's why I thought "it only takes it on play and seek".

Maybe that somehow connected with mechanism of hardware acceleration in Android. I'll try to test that case in other mobile browsers and also will try to create reduced test.

But most likely the problem is not in libjass.

from libjass.

Arnavion avatar Arnavion commented on September 23, 2024

That is interesting. Thanks for testing. I don't have any mobile to test on, so I appreciate it.

from libjass.

Dador avatar Dador commented on September 23, 2024

Works fine in stock Android browser. So bug only in Chrome Mobile.

I created issue and reduced test in Chromium project. Please star it - https://code.google.com/p/chromium/issues/detail?id=509010

I close this issue cause problem not in libjass.

from libjass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.