Safari Developer Library

Developer

HTMLVideoElement Class Reference

Options
Deployment Target:

On This Page

HTMLVideoElement

A class representing the HTML video element that plays a video in a webpage. Use the HTMLAudioElement class for the HTML audio element.

  • width Property

    The width of the video element in CSS pixels.

    Declaration

    attribute unsigned long width

  • height Property

    The height of the video element in CSS pixels.

    Declaration

    attribute unsigned long height

  • poster Property

    The URI address of an image file that is shown when no video data is available.

    Declaration

    attribute DOMString poster

    Discussion

    When a video element is paused and the current playback position is the first frame of video, the element represents either the frame of video corresponding to the current playback position or the poster frame, at the discretion of the user agent.

  • videoWidth Property

    The native width of the video in CSS pixels. (read-only)

    Declaration

    readonly attribute unsigned long videoWidth

    Discussion

    If no video data is available, this property is 0.

  • videoHeight Property

    The native height of the video in CSS pixels. (read-only)

    Declaration

    readonly attribute unsigned long videoHeight

    Discussion

    If no video data is available, this property is 0.

  • A Boolean value indicating whether the video is displaying in fullscreen mode.

    Declaration

    readonly attribute boolean webkitDisplayingFullscreen

    Discussion

    true if displaying in fullscreen mode; otherwise, false.

  • Enters fullscreen mode.

    Declaration

    voidwebkitEnterFullscreen ();

    Discussion

    This method throws an exception if the element is not allowed to enter fullscreen—that is, if webkitSupportsFullscreen is false.

  • Exits fullscreen mode.

    Declaration

    voidwebkitExitFullscreen ();

  • A Boolean value indicating whether the video can be played in fullscreen mode.

    Declaration

    readonly attribute boolean webkitSupportsFullscreen

    Discussion

    true if the device supports fullscreen mode; otherwise, false. This property is also false if the meta data is loaded or the loadedmetadata event has not fired, and if the files are audio-only.