pub enum TrackKind {
Subtitles,
Captions,
Descriptions,
Chapters,
Metadata,
}Expand description
The kind attribute values for <track> elements.
§Purpose
Specifies the type of text track, defining how the track content should be interpreted and displayed for media accessibility and enhancement.
§Usage Context
- Used with:
<track>elements (within<audio>or<video>) - Accessibility: Subtitles and captions are crucial for accessibility
- Format: Tracks typically use
WebVTTformat
§Valid Values
Subtitles: Transcription or translation for dialogueCaptions: Transcription including sound effects (for hearing impaired)Descriptions: Text descriptions of visual content (for visually impaired)Chapters: Chapter titles for media navigationMetadata: Track for scripts (not displayed to user)
§Example
use ironhtml_attributes::{AttributeValue, TrackKind};
let kind = TrackKind::Subtitles;
assert_eq!(kind.to_attr_value(), "subtitles");<video src="movie.mp4" controls>
<track kind="subtitles" src="subs-en.vtt" srclang="en" label="English">
<track kind="captions" src="caps-en.vtt" srclang="en" label="English CC">
<track kind="descriptions" src="desc.vtt" srclang="en">
<track kind="chapters" src="chapters.vtt" srclang="en">
</video>§WHATWG Specification
Variants§
Subtitles
Subtitles provide translation of dialogue and text for users who understand the audio but need translation.
Captions
Captions provide transcription and possibly translation of audio, including sound effects, music, and other audio information.
Descriptions
Descriptions provide textual descriptions of video content for visually impaired users.
Chapters
Chapters provide chapter titles for media navigation and structure.
Metadata
Metadata tracks are not displayed but used by scripts for enhanced interactivity.
Trait Implementations§
Source§impl AttributeValue for TrackKind
impl AttributeValue for TrackKind
Source§fn to_attr_value(&self) -> Cow<'static, str>
fn to_attr_value(&self) -> Cow<'static, str>
Convert to the attribute value string.
impl Copy for TrackKind
impl Eq for TrackKind
impl StructuralPartialEq for TrackKind
Auto Trait Implementations§
impl Freeze for TrackKind
impl RefUnwindSafe for TrackKind
impl Send for TrackKind
impl Sync for TrackKind
impl Unpin for TrackKind
impl UnwindSafe for TrackKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more