Safari Developer Library

Developer

HTMLVideoElement Class Reference

Options
Deployment Target:

On This Page

HTMLVideoElement

Inheritance


Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in Safari 3.1 and later.
Available in iOS 3.0 and later.

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

    JavaScript

    attribute unsigned long width

    Availability

    Available in Safari 3.1 and later.

    Available in iOS 3.0 and later.

  • height Property

    The height of the video element in CSS pixels.

    Declaration

    JavaScript

    attribute unsigned long height

    Availability

    Available in Safari 3.1 and later.

    Available in iOS 3.0 and later.

  • poster Property

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

    Declaration

    JavaScript

    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.

    Availability

    Available in Safari 3.1 and later.

    Available in iOS 3.0 and later.

  • videoWidth Property

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

    Declaration

    JavaScript

    readonly attribute unsigned long videoWidth

    Discussion

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

    Availability

    Available in Safari 3.1 and later.

    Available in iOS 3.0 and later.

  • videoHeight Property

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

    Declaration

    JavaScript

    readonly attribute unsigned long videoHeight

    Discussion

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

    Availability

    Available in Safari 3.1 and later.

    Available in iOS 3.0 and later.

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

    Declaration

    JavaScript

    readonly attribute boolean webkitDisplayingFullscreen

    Discussion

    true if displaying in fullscreen mode; otherwise, false.

    Availability

    Available in Safari 5.0 and later.

    Available in iOS 4.0 and later.

  • Enters fullscreen mode.

    Declaration

    JavaScript

    void webkitEnterFullscreen ();

    Discussion

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

    Availability

    Available in Safari 5.0 and later.

    Available in iOS 4.2 and later.

  • Exits fullscreen mode.

    Declaration

    JavaScript

    void webkitExitFullscreen ();

    Availability

    Available in Safari 5.0 and later.

    Available in iOS 4.2 and later.

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

    Declaration

    JavaScript

    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.

    Availability

    Available in Safari 5.0 and later.

    Available in iOS 4.0 and later.