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> <style>
body { body {
font-family: sans-serif; font-family: sans-serif;
font-size: 32px; font-size: 36px;
text-align: center; text-align: center;
margin-top: 16px; padding-top: 8px;
margin-top: 0;
overflow: hidden;
} }
</style> </style>
<script src="subtitles.js"></script> <script src="subtitles.js"></script>

View File

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