HTMLVideoElement Class Reference

Inherits from
HTMLMediaElement : HTMLElement : Element : Node
Availability
Available in Safari 3.1 and later.
Available in iOS 3.0 and later.

Overview

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

Tasks

Getting and Setting Properties

Getting State

Displaying Video Fullscreen

Properties

height

The height of the video element in CSS pixels.

attribute unsigned long height
Availability

poster

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

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

videoHeight

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

readonly attribute unsigned long videoHeight
Discussion

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

Availability

videoWidth

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

readonly attribute unsigned long videoWidth
Discussion

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

Availability

webkitDisplayingFullscreen

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

readonly attribute boolean webkitDisplayingFullscreen
Discussion

true if displaying in fullscreen mode; otherwise, false.

Availability

webkitSupportsFullscreen

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

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

width

The width of the video element in CSS pixels.

attribute unsigned long width
Availability

Methods

webkitEnterFullscreen

Enters fullscreen mode.

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.

webkitExitFullscreen

Exits fullscreen mode.

void webkitExitFullscreen ();
Availability
  • Available in Safari 5.0 and later.
  • Available in iOS 4.2 and later.