Add SRT subtitle support and improve subtitle handling

This update enables SRT subtitle files by converting them to VTT blob URLs, sets the default subtitle track automatically, and improves subtitle track switching. Subtitle styling is enhanced in CSS, and tests are updated to use the correct subtitle prop format.
This commit is contained in:
hibna
2025-10-29 14:15:43 +03:00
parent 02e578f954
commit c5efcb95d5
4 changed files with 177 additions and 8 deletions
+22
View File
@@ -24,3 +24,25 @@
.video-element::-webkit-media-controls-panel {
display: none !important;
}
/* Subtitle styling */
.video-element::cue {
background-color: rgba(0, 0, 0, 0.8);
color: white;
font-size: 1.2em;
font-family: Arial, sans-serif;
line-height: 1.4;
padding: 0.2em 0.5em;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}
/* Ensure text tracks are visible */
.video-element::-webkit-media-text-track-container {
overflow: visible !important;
position: relative !important;
z-index: 1 !important;
}
.video-element::-webkit-media-text-track-display {
overflow: visible !important;
}