Comments (4)
Yes, currently the renderer always appends new subs to the layer div, so new subs always appear in document order (i.e., below) existing subs.
Is it okay to just reverse this for the layer1-3 divs - use insert instead of append? Or is there something else to consider?
from libjass.
First dialogues ordered by "start time" (the earliest dialogue would be at the bottom).
If there are dialogues with the same "start time", then order by position in script (the dialogue that closest to beguining whould be at the bottom). Script to test that.
I don't think that thing with time important for common dialogues. But maybe it can be important for typesetting (for example when one dialogue "moves" another).
Time already half-considered in libjass (just by fact that we append dialogue on start time). Why half? If click "pause" and then "play" again (i.e. dialogues re-rendered?) subtitles re-ordered without considering time.
In other words, "just reverse" would help in most cases. What to do with time - it is your choise :)
from libjass.
Sorting by start time is technically not right. Eg: dialogue1 is from 2s to 7s and dialogue2 is from 1s to 5s. If seeking to 3s, then d1 should show before d2 (assuming \an2, d1 should be below d2). However if you play the video with vsfilter from 0s to 3s you will see it put d2 below d1, which is because of three reasons:
- Since at 1s vsfilter already rendered d2, it will not move it at 2s when it has to render d1. Instead it will render d1 above it.
- For the same reason, at 6s even though d2 is gone, d1 will remain floating in the air.
- vsfilter caches a dialogue once it's rendered. So say you seek to 10s and then back to 6s, d1 will be rendered fresh but it will still be floating in mid-air.
An interesting outcome of the third point above is that you can make it give different results. If you close and reopen the video and seek directly to 6s, now vsfilter will render d1 at the bottom. Then if you seek back to 3s, now it will render d2 above d1. Then if you seek to 0s and play normally, at 1s it will render d2 in the air, since that's where it's cached it now.
I do understand that sorting by start time emulates the order vsfilter would've chosen if playing normally.
At any rate, not moving dialogues when the current set of visible subs changes is another thing libjass can't do, since it relies on the browser to position the sub divs.
Pausing and playing should not reorder the dialogues. They should still render in the same order as before pause. I'll investigate.
from libjass.
Oh right, it reorders on pause and play for a similar reason to vsfilter's caching - libjass doesn't re-render subs that are already displayed. So in normal playback the 4-*
are already displayed, so the 5-*
are appended below the 4-*
. However on pause/play, all subs at the current time are re-rendered in script order, so 5-*
are put first and 4-*
appended below them.
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.