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:
+8
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user