From 06ad9da1dea07e64bcfc00d8c4c8c6a8d25231b3 Mon Sep 17 00:00:00 2001 From: Viterkim Date: Thu, 25 Jul 2024 15:45:23 +0200 Subject: [PATCH 1/6] VideoPlayer.tsx: Don't newline subtitles. (Let yomitan pick up the full sub) --- common/app/components/VideoPlayer.tsx | 4 +++- common/app/components/video-player.css | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/app/components/VideoPlayer.tsx b/common/app/components/VideoPlayer.tsx index cda01ccd..5e867135 100755 --- a/common/app/components/VideoPlayer.tsx +++ b/common/app/components/VideoPlayer.tsx @@ -165,7 +165,9 @@ const showingSubtitleHtml = ( `; } - return `${subtitle.text}`; + const lines = subtitle.text.split('\n'); + const wrappedText = lines.map(line => `

${line}

`).join(''); + return `${wrappedText}`; }; interface ShowingSubtitleProps { diff --git a/common/app/components/video-player.css b/common/app/components/video-player.css index 9124b98b..7e834621 100644 --- a/common/app/components/video-player.css +++ b/common/app/components/video-player.css @@ -11,3 +11,8 @@ .asbplayer-subtitles-blurred:hover { filter: none; } + +.subtitle-line { + margin: 0; + padding: 0; +} From 2b3a53e37184e3e4cf4c9e7905f9816cd5b008cd Mon Sep 17 00:00:00 2001 From: Viterkim Date: Sat, 10 Aug 2024 13:20:46 +0200 Subject: [PATCH 2/6] Videoplayer.tsx: Also wrap text with

when dom caching is disabled --- common/app/components/VideoPlayer.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/app/components/VideoPlayer.tsx b/common/app/components/VideoPlayer.tsx index 5e867135..863f419f 100755 --- a/common/app/components/VideoPlayer.tsx +++ b/common/app/components/VideoPlayer.tsx @@ -198,7 +198,12 @@ const ShowingSubtitle = ({ /> ); } else { - content = {subtitle.text}; + const lines = subtitle.text.split('\n'); + content = lines.map((line, index) => ( +

+ {line} +

+ )); } return ( From 988a60469b00cfe36827d44f6ccbb4ad207038b6 Mon Sep 17 00:00:00 2001 From: Viterkim Date: Sun, 11 Aug 2024 15:06:56 +0200 Subject: [PATCH 3/6] video-player.css: Fix excessive gap on bottom of subtitles (visible with pre-cache subtitle dom + multiple sub track) --- common/app/components/video-player.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/app/components/video-player.css b/common/app/components/video-player.css index 7e834621..7be3b9f1 100644 --- a/common/app/components/video-player.css +++ b/common/app/components/video-player.css @@ -15,4 +15,6 @@ .subtitle-line { margin: 0; padding: 0; + line-height: normal; + display: inline; } From 95f111bbfc3ec07daf21f1015c123e33c2a56979 Mon Sep 17 00:00:00 2001 From: Viterkim Date: Sun, 11 Aug 2024 15:43:05 +0200 Subject: [PATCH 4/6] undo inline: messed with splits on subs, whiteSpace made a huge box under the sub box (material ui css stuff) --- common/app/components/VideoPlayer.tsx | 2 +- common/app/components/video-player.css | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/common/app/components/VideoPlayer.tsx b/common/app/components/VideoPlayer.tsx index 863f419f..12054fc7 100755 --- a/common/app/components/VideoPlayer.tsx +++ b/common/app/components/VideoPlayer.tsx @@ -69,7 +69,7 @@ const useStyles = makeStyles({ paddingLeft: 20, paddingRight: 20, textAlign: 'center', - whiteSpace: 'pre-wrap', + whiteSpace: 'normal', lineHeight: 'normal', }, }); diff --git a/common/app/components/video-player.css b/common/app/components/video-player.css index 7be3b9f1..7e834621 100644 --- a/common/app/components/video-player.css +++ b/common/app/components/video-player.css @@ -15,6 +15,4 @@ .subtitle-line { margin: 0; padding: 0; - line-height: normal; - display: inline; } From 40490d51cd8943a45620c97abd394393ca9e1726 Mon Sep 17 00:00:00 2001 From: Viterkim Date: Sun, 11 Aug 2024 18:49:05 +0200 Subject: [PATCH 5/6] videoplayer.tsx: lineheight: normal -> inherit, better spacing look --- common/app/components/VideoPlayer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/app/components/VideoPlayer.tsx b/common/app/components/VideoPlayer.tsx index 12054fc7..8829d030 100755 --- a/common/app/components/VideoPlayer.tsx +++ b/common/app/components/VideoPlayer.tsx @@ -70,7 +70,7 @@ const useStyles = makeStyles({ paddingRight: 20, textAlign: 'center', whiteSpace: 'normal', - lineHeight: 'normal', + lineHeight: 'inherit', }, }); From 9071d5b48c58d55edc7af959eaa46890ddbbb004 Mon Sep 17 00:00:00 2001 From: Viterkim Date: Sun, 11 Aug 2024 22:07:10 +0200 Subject: [PATCH 6/6] prettier --- common/app/components/VideoPlayer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/app/components/VideoPlayer.tsx b/common/app/components/VideoPlayer.tsx index 8829d030..cd53d2ae 100755 --- a/common/app/components/VideoPlayer.tsx +++ b/common/app/components/VideoPlayer.tsx @@ -166,7 +166,7 @@ const showingSubtitleHtml = ( } const lines = subtitle.text.split('\n'); - const wrappedText = lines.map(line => `

${line}

`).join(''); + const wrappedText = lines.map((line) => `

${line}

`).join(''); return `${wrappedText}`; };