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
+8 -3
View File
@@ -8,11 +8,16 @@ function App() {
const [useDemo, setUseDemo] = useState(true)
// Demo video URLs (you can replace with your own)
const demoVideoUrl = '/Stormy Weather_c7e908aa/master.m3u8'
const demoPoster = undefined
const demoVideoUrl = '/s6ebilmemkac.mp4'
const demoPoster = '/s6ebilmemkac.webp'
const demoSubtitles: SubtitleTrack[] = [
// Add your subtitle URLs here
{
src: '/ses.srt',
lang: 'tr',
label: 'Türkçe',
default: true,
},
]
const currentVideoUrl = useDemo ? demoVideoUrl : videoUrl