[][src]Struct moxie_dom::elements::media::TrackBuilder

#[must_use = "needs to be built"]pub struct TrackBuilder { /* fields omitted */ }

The HTML <track> element is used as a child of the media elements <audio> and <video>. It lets you specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files) — Web Video Text Tracks or Timed Text Markup Language (TTML).

A type for initializing the element's attributes before calling build.

Implementations

impl TrackBuilder[src]

pub fn build(self) -> Track[src]

Initialize the element with all of the attributes so far.

impl TrackBuilder[src]

pub fn default(self, to_set: bool) -> Self[src]

This attribute indicates that the track should be enabled unless the user's preferences indicate that another track is more appropriate. This may only be used on one track element per media element.

pub fn subtitles(self, to_set: impl ToString) -> Self[src]

How the text track is meant to be used. If omitted the default kind is subtitles. If the attribute is not present, it will use the subtitles. If the attribute contains an invalid value, it will use metadata. The following keywords are allowed: Subtitles provide translation of content that cannot be understood by the viewer. For example dialogue or text that is not English in an English language film.

Subtitles may contain additional content, usually extra background information. For example the text at the beginning of the Star Wars films, or the date, time, and location of a scene.

pub fn captions(self, to_set: impl ToString) -> Self[src]

Closed captions provide a transcription and possibly a translation of audio.

It may include important non-verbal information such as music cues or sound effects. It may indicate the cue's source (e.g. music, text, character).

Suitable for users who are deaf or when the sound is muted.

pub fn kind(self, to_set: impl ToString) -> Self[src]

Textual description of the video content.

  • descriptions: Suitable for users who are blind or where the video cannot be seen.
  • chapters: Chapter titles are intended to be used when the user is navigating the media resource.
  • metadata: Tracks used by scripts. Not visible to the user.
  • label: A user-readable title of the text track which is used by the browser when listing available text tracks.

pub fn src(self, to_set: impl ToString) -> Self[src]

Address of the track (.vtt file). Must be a valid URL. This attribute must be specified and its URL value must have the same origin as the document — unless the

pub fn srclang(self, to_set: impl ToString) -> Self[src]

Language of the track text data. It must be a valid BCP 47 language tag. If the kind attribute is set to subtitles, then srclang must be defined.

Trait Implementations

impl Element for TrackBuilder[src]

impl<E> EventTarget<E> for TrackBuilder where
    E: GlobalEvent
[src]

impl GlobalEventHandler for TrackBuilder[src]

impl HtmlElement for TrackBuilder[src]

impl Node for TrackBuilder[src]

Auto Trait Implementations

impl !RefUnwindSafe for TrackBuilder

impl !Send for TrackBuilder

impl !Sync for TrackBuilder

impl Unpin for TrackBuilder

impl !UnwindSafe for TrackBuilder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<N> Child for N where
    N: Node
[src]

impl<T> Downcast for T where
    T: Any

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.