Struct silkenweb::elements::VideoBuilder[][src]

pub struct VideoBuilder(_);

Implementations

impl VideoBuilder[src]

pub fn id(self, value: impl AttributeValue<String>) -> VideoBuilder[src]

pub fn class(self, value: impl AttributeValue<String>) -> VideoBuilder[src]

pub fn autoplay(self, value: impl AttributeValue<bool>) -> VideoBuilder[src]

If specified, the video automatically begins to play back as soon as it can do so without stopping to finish loading the data.

Note: Sites that automatically play audio (or videos with an audio track) can be an unpleasant experience for users, so should be avoided when possible. If you must offer autoplay functionality, you should make it opt-in (requiring a user to specifically enable it). However, this can be useful when creating media elements whose source will be set at a later time, under user control. See our autoplay guide for additional information about how to properly use autoplay.

To disable video autoplay, autoplay=“false” will not work; the video will autoplay if the attribute is there in the <video> tag at all. To remove autoplay, the attribute needs to be removed altogether.

pub fn buffered(self, value: impl AttributeValue<String>) -> VideoBuilder[src]

An attribute you can read to determine the time ranges of the buffered media. This attribute contains a TimeRanges object.

pub fn controls(self, value: impl AttributeValue<bool>) -> VideoBuilder[src]

If this attribute is present, the browser will offer controls to allow the user to control video playback, including volume, seeking, and pause/resume playback.

pub fn crossorigin(self, value: impl AttributeValue<String>) -> VideoBuilder[src]

This enumerated attribute indicates whether to use CORS to fetch the related image. CORS-enabled resources can be reused in the <canvas> element without being tainted. The allowed values are:

  • anonymous: Sends a cross-origin request without a credential. In other words, it sends the Origin: HTTP header without a cookie, X.509 certificate, or performing HTTP Basic authentication. If the server does not give credentials to the origin site (by not setting the Access-Control-Allow-Origin: HTTP header), the image will be tainted, and its usage restricted.
  • use-credentials: Sends a cross-origin request with a credential. In other words, it sends the Origin: HTTP header with a cookie, a certificate, or performing HTTP Basic authentication. If the server does not give credentials to the origin site (through Access-Control-Allow-Credentials: HTTP header), the image will be tainted and its usage restricted.

When not present, the resource is fetched without a CORS request (i.e. without sending the Origin: HTTP header), preventing its non-tainted used in <canvas> elements. If invalid, it is handled as if the enumerated keyword anonymous was used.

pub fn current_time(self, value: impl AttributeValue<String>) -> VideoBuilder[src]

Reading currentTime returns a double-precision floating-point value indicating the current playback position of the media specified in seconds. If the media has not started playing yet, the time offset at which it will begin is returned. Setting currentTime sets the current playback position to the given time and seeks the media to that position if the media is currently loaded.

If the media is being streamed, it’s possible that the user agent may not be able to obtain some parts of the resource if that data has expired from the media buffer. Other media may have a media timeline that doesn’t start at 0 seconds, so setting currentTime to a time before that would fail. The getStartDate() method can be used to determine the beginning point of the media timeline’s reference frame.

pub fn height(self, value: impl AttributeValue<String>) -> VideoBuilder[src]

The height of the video’s display area, in CSS pixels (absolute values only; no percentages.)

pub fn loop_(self, value: impl AttributeValue<bool>) -> VideoBuilder[src]

If specified, the browser will automatically seek back to the start upon reaching the end of the video.

pub fn muted(self, value: impl AttributeValue<bool>) -> VideoBuilder[src]

Indicates the default setting of the audio contained in the video. If set, the audio will be initially silenced. Its default value is false, meaning that the audio will be played when the video is played.

pub fn playsinline(self, value: impl AttributeValue<bool>) -> VideoBuilder[src]

Indicating that the video is to be played “inline”, that is within the element’s playback area. Note that the absence of this attribute does not imply that the video will always be played in fullscreen.

pub fn poster(self, value: impl AttributeValue<String>) -> VideoBuilder[src]

A URL for an image to be shown while the video is downloading. If this attribute isn’t specified, nothing is displayed until the first frame is available, then the first frame is shown as the poster frame.

pub fn preload(self, value: impl AttributeValue<String>) -> VideoBuilder[src]

This enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience with regards to what content is loaded before the video is played. It may have one of the following values:

  • none: Indicates that the video should not be preloaded.
  • metadata: Indicates that only video metadata (e.g. length) is fetched.
  • auto: Indicates that the whole video file can be downloaded, even if the user is not expected to use it.
  • empty string: Synonym of the auto value.

The default value is different for each browser. The spec advises it to be set to metadata.

Note:

The autoplay attribute has precedence over preload. If autoplay is specified, the browser would obviously need to start downloading the video for playback.

The specification does not force the browser to follow the value of this attribute; it is a mere hint.

pub fn src(self, value: impl AttributeValue<String>) -> VideoBuilder[src]

The URL of the video to embed. This is optional; you may instead use the <source> element within the video block to specify the video to embed.

pub fn width(self, value: impl AttributeValue<String>) -> VideoBuilder[src]

The width of the video’s display area, in CSS pixels (absolute values only; no percentages).

impl VideoBuilder[src]

pub fn on_blur(
    self,
    f: impl FnMut(FocusEvent, HtmlVideoElement) + 'static
) -> VideoBuilder
[src]

pub fn on_click(
    self,
    f: impl FnMut(MouseEvent, HtmlVideoElement) + 'static
) -> VideoBuilder
[src]

pub fn on_change(
    self,
    f: impl FnMut(Event, HtmlVideoElement) + 'static
) -> VideoBuilder
[src]

pub fn on_dblclick(
    self,
    f: impl FnMut(MouseEvent, HtmlVideoElement) + 'static
) -> VideoBuilder
[src]

pub fn on_focusout(
    self,
    f: impl FnMut(FocusEvent, HtmlVideoElement) + 'static
) -> VideoBuilder
[src]

pub fn on_input(
    self,
    f: impl FnMut(InputEvent, HtmlVideoElement) + 'static
) -> VideoBuilder
[src]

pub fn on_keydown(
    self,
    f: impl FnMut(KeyboardEvent, HtmlVideoElement) + 'static
) -> VideoBuilder
[src]

pub fn on_keyup(
    self,
    f: impl FnMut(KeyboardEvent, HtmlVideoElement) + 'static
) -> VideoBuilder
[src]

pub fn effect(self, f: impl Effect<HtmlVideoElement>) -> VideoBuilder[src]

impl VideoBuilder[src]

pub fn text(self, child: impl Text) -> VideoBuilder[src]

pub fn child<Child>(self, c: Child) -> VideoBuilder where
    Child: Into<Element>, 
[src]

Trait Implementations

impl Builder for VideoBuilder[src]

type Target = Video

impl DomElement for VideoBuilder[src]

impl From<VideoBuilder> for ElementBuilder[src]

impl From<VideoBuilder> for Element[src]

Auto Trait Implementations

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<T> From<T> 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.