Created
March 17, 2014 18:48
-
-
Save seblavoie/9605736 to your computer and use it in GitHub Desktop.
Show subtitles. See http://www.youtube.com/watch?v=4LAnZPDUOiI for details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L = thisComp.layer("the layer"); | |
max = 5; // number of words to display | |
n = 0 | |
if (L.marker.numKeys > 0){ | |
n = L.marker.nearestKey(time).index; | |
if (L.marker.key(n).time > time){ | |
n--; | |
} | |
} | |
s = " "; | |
if (n > 0){ | |
base = Math.floor((n-1)/max)*max + 1; | |
for (i = base; i < base + max; i++){ | |
if (i <= L.marker.numKeys){ | |
s += L.marker.key(i).comment + " "; | |
} | |
} | |
} | |
s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment