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.
Properties
height
The height of the video element in CSS pixels.
attribute unsigned long height
Availability
- Available in Safari 3.1 and later.
- Available in iOS 3.0 and later.
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
- Available in Safari 3.1 and later.
- Available in iOS 3.0 and later.
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
- Available in Safari 3.1 and later.
- Available in iOS 3.0 and later.
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
- Available in Safari 3.1 and later.
- Available in iOS 3.0 and later.
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
- Available in Safari 5.0 and later.
- Available in iOS 4.0 and later.
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
- Available in Safari 5.0 and later.
- Available in iOS 4.0 and later.
width
The width of the video element in CSS pixels.
attribute unsigned long width
Availability
- Available in Safari 3.1 and later.
- Available in iOS 3.0 and later.
Methods
webkitEnterFullscreen
Enters fullscreen mode.
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.
Availability
- Available in Safari 5.0 and later.
- Available in iOS 4.2 and later.
© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-04-14)