mirror of
https://github.com/gosticks/PiPer.git
synced 2026-10-06 07:26:55 +00:00
Fixed closed captioning bug
Fixed bug causing captions to show multiple unnecessary empty new lines
This commit is contained in:
Binary file not shown.
+9
-2
@@ -159,9 +159,16 @@ const processCaptions = function() {
|
||||
const walk = document.createTreeWalker(captionElement, NodeFilter.SHOW_TEXT, null, false);
|
||||
while (walk.nextNode()) {
|
||||
const segment = walk.currentNode.nodeValue.trim();
|
||||
caption += segment ? segment + ' ' : '\n';
|
||||
if (segment) {
|
||||
caption += segment + ' ';
|
||||
} else if (caption.charAt(caption.length - 1) != '\n') {
|
||||
caption += '\n';
|
||||
} else {
|
||||
caption += '';
|
||||
}
|
||||
}
|
||||
log('Showing caption "' + caption.trim() + '"');
|
||||
caption = caption.trim();
|
||||
log('Showing caption "' + caption + '"');
|
||||
track.addCue(new VTTCue(video.currentTime, video.currentTime + 60, caption));
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.2.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>38</string>
|
||||
<string>39</string>
|
||||
<key>Developer Identifier</key>
|
||||
<string>BQ6Q24MF9X</string>
|
||||
<key>URL</key>
|
||||
|
||||
Reference in New Issue
Block a user