ACCOUNT-30901 add support for tracks in video component#1540
Conversation
|
Size stats
|
|
Deploy preview for mistica-web ready!
Deployed with vercel-action |
|
Accessibility report ℹ️ You can run this locally by executing |
There was a problem hiding this comment.
Pull request overview
Adds support for <track> elements (subtitles, captions, etc.) to the Video component by introducing a new tracks prop and corresponding VideoTrack type, exporting the new type publicly, and updating the Video story with a sample WebVTT subtitle file.
Changes:
- New
VideoTracktype andtracksprop onVideo, rendered as<track>children;crossOrigin="anonymous"is automatically applied when tracks are present. - Public re-export of
VideoTrackfrom the package entry point. - Story update with a demo
.vttsubtitle file to exercise the new feature.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/video.tsx | Adds VideoTrack type, tracks prop, renders <track> elements, sets crossOrigin when tracks exist. |
| src/index.tsx | Exports the new VideoTrack type. |
| src/stories/video-story.tsx | Adds a tracks example using the new VTT file in the Default story. |
| src/stories/videos/test-subtitles.vtt | New WebVTT subtitle file used by the story. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| disableRemotePlayback | ||
| muted={muted} | ||
| loop={loop} | ||
| crossOrigin={tracks ? 'anonymous' : undefined} |
|
Size stats
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…nd toggle functionality
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| /** | ||
| * Sets the display mode of a track by its index. | ||
| * - 'showing': track is visible | ||
| * - 'disabled': track is inactive | ||
| */ | ||
| setTrackMode: (index: number, mode: 'showing' | 'disabled') => void; |
There was a problem hiding this comment.
Is the goal of this method changing the subtitles that are currently enabled? Perhaps we should expose a simpler API, something like:
setActiveSubtitleIndex: (i: number) => void
```tsx
No description provided.