Comments (4)
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.
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.
That is interesting. Thanks for testing. I don't have any mobile to test on, so I appreciate it.
from libjass.
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)
- "PlayResX" is not treated as optional! -> breaking HOT 15
- When PlayResX or PlayResY are defined as zero, tab crashes. HOT 1
- Unexpected style margin collisions HOT 1
- \n being rendered in plain text, wrapping style 2 HOT 2
- Request for new release HOT 2
- How to crate subtitle from JSON Object ? HOT 2
- libjass.deserialize dialogue style changes not work HOT 2
- When playing preroll ads, sometimes the text appears very small HOT 1
- Why the npm package doesn't contains a type definition file. HOT 1
- Line-specific styles do not override style definitions HOT 2
- \fad with a fadeout of 0 is treated as fading out for the duration of the line HOT 1
- Opt-in support for command execution HOT 3
- [Feature Request]Can you convert a .ass subtitle to VobSub format? HOT 2
- dialogues ID will be created next to the last dialogues ID from previous object HOT 3
- when I create new dialogue can I get a dialogue class tag? HOT 1
- Update Typescript version HOT 6
- Serialize back to .ass HOT 1
- implement smart line wrapping
- Lines can be "pushed away" by other lines on the same layer HOT 2
- Lines are moved down when lines underneath it are removed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libjass.