subtitle preview

This commit is contained in:
j 2017-10-05 21:22:11 +02:00
parent c451bb82bb
commit 40472ec6f9
2 changed files with 12 additions and 6 deletions

View file

@ -1,9 +1,11 @@
<style>
body {
font-family: sans-serif;
font-size: 32px;
font-size: 36px;
text-align: center;
margin-top: 16px;
padding-top: 8px;
margin-top: 0;
overflow: hidden;
}
</style>
<script src="subtitles.js"></script>

View file

@ -21,21 +21,25 @@ app.render = function() {
app.status.subtitles[app.status.current].forEach(function(sub) {
if (app.status.currentTime >= sub['in'] && app.status.currentTime < sub.out) {
//html += '<br><br><b>' + sub['in'] + ' ' + sub.out + ': ' + sub.value + '</b>'
html += '<br><br><b>' + sub.value + '</b>'
showNext = 10
html += '<br><br><b>' + sub.value.replace('\n', '<br>\n') + '</b>'
showNext = 8
update = true
} else if (showNext) {
//html += '<br><br>' + sub['in'] + ' ' + sub.out + ': ' + sub.value
html += '<br><br>' + sub.value
html += '<br><br>' + sub.value.replace('\n', '<br>\n')
showNext -= 1
}
})
}
if (app.status.subtitles[app.status.next]) {
if (showNext) {
html += '<br><br><b>' + app.status.next.slice(0, 1).toUpperCase() + '</b>'
showNext -= 1
}
app.status.subtitles[app.status.next].forEach(function(sub) {
if (showNext) {
//html += '<br><br>' + sub['in'] + ' ' + sub.out + ': ' + sub.value
html += '<br><br>' + sub.value
html += '<br><br>' + sub.value.replace('\n', '<br>\n')
showNext -= 1
}
})