Class HTMLVideoElement
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The list of supported media formats varies from one browser to the other. You should either provide your video in a single format that all the relevant browsers supports, or provide multiple video sources in enough different formats that all the browsers you need to support are covered.
[Value("HTMLVideoElement")]
public class HTMLVideoElement : HTMLMediaElement
- Inheritance
-
HTMLVideoElement
- Inherited Members
Remarks
-HTML element implementing this interface: video.
-Supported media formats
Constructors
HTMLVideoElement()
public HTMLVideoElement()
Properties
DisablePictureInPicture
The HTMLVideoElement disablePictureInPicture property reflects the HTML attribute indicating whether the picture-in-picture feature is disabled for the current element.
[Value("disablePictureInPicture")]
public bool DisablePictureInPicture { get; set; }
Property Value
- bool
A boolean value that is
trueif the picture-in-picture feature is disabled for this element. This means that the user agent should not suggest that feature to users, or request it automatically.
Remarks
This value only represents a request from the website to the user agent. User configuration may change the eventual behavior—for example, Firefox users can change the media.videocontrols.picture-in-picture.respect-disablePictureInPicture setting to ignore the request to disable PiP.
Height
The height property of the HTMLVideoElement interface returns an integer that reflects the height attribute of the video element, specifying the displayed height of the resource in CSS pixels.
[Value("height")]
public ulong Height { get; set; }
Property Value
- ulong
A positive integer or 0.
Remarks
Onenterpictureinpicture
[Value("onenterpictureinpicture")]
public EventHandlerNonNull Onenterpictureinpicture { get; set; }
Property Value
Onleavepictureinpicture
[Value("onleavepictureinpicture")]
public EventHandlerNonNull Onleavepictureinpicture { get; set; }
Property Value
PlaysInline
[Value("playsInline")]
public bool PlaysInline { get; set; }
Property Value
Poster
The poster property of the HTMLVideoElement interface is a string that reflects the URL for an image to be shown while no video data is available. If the property does not represent a valid URL, no poster frame will be shown.
[Value("poster")]
public string Poster { get; set; }
Property Value
- string
A string.
Remarks
It reflects the poster attribute of the video element.
VideoHeight
The HTMLVideoElement interface's read-only videoHeight property indicates the intrinsic height of the video, expressed in CSS pixels.
In simple terms, this is the height of the media in its natural size.
[Value("videoHeight")]
public ulong VideoHeight { get; }
Property Value
- ulong
An integer value specifying the intrinsic height of the video in CSS pixels.
If the element's ReadyState isHTMLMediaElement.HAVE_NOTHING, then the value of this property is 0, because neither video nor poster frame size information is yet available.
Remarks
VideoWidth
The HTMLVideoElement interface's read-only videoWidth property indicates the intrinsic width of the video, expressed in CSS pixels.
In simple terms, this is the width of the media in its natural size.
[Value("videoWidth")]
public ulong VideoWidth { get; }
Property Value
- ulong
An integer value specifying the intrinsic width of the video in CSS pixels.
If the element's ReadyState isHTMLMediaElement.HAVE_NOTHING, then the value of this property is 0, because neither video nor poster frame size information is yet available.
Remarks
See HTMLVideoElement.videoHeight > About intrinsic width and height for more details.
Width
The width property of the HTMLVideoElement interface returns an integer that reflects the width attribute of the video element, specifying the displayed width of the resource in CSS pixels.
[Value("width")]
public ulong Width { get; set; }
Property Value
- ulong
A positive integer or 0.
Remarks
Methods
CancelVideoFrameCallback(ulong)
The cancelVideoFrameCallback() method of the HTMLVideoElement interface cancels a previously-registered video frame callback.
[Value("cancelVideoFrameCallback")]
public GlobalObject.Undefined CancelVideoFrameCallback(ulong handle)
Parameters
handleulong
Returns
Remarks
-The video element
-RequestVideoFrameCallback(VideoFrameRequestCallback)
-Perform efficient per-video-frame operations on video with requestVideoFrameCallback() on developer.chrome.com (2023)
GetVideoPlaybackQuality()
The HTMLVideoElement methodgetVideoPlaybackQuality() creates and returns a
VideoPlaybackQuality object containing metrics including how many
frames have been lost.
[Value("getVideoPlaybackQuality")]
public VideoPlaybackQuality GetVideoPlaybackQuality()
Returns
- VideoPlaybackQuality
A VideoPlaybackQuality object providing information about the video
element's current playback quality.
Remarks
The data returned can be used to evaluate the quality of the video stream.
-The video element
-The VideoPlaybackQuality interface.
RequestPictureInPicture()
The HTMLVideoElement methodrequestPictureInPicture() issues an asynchronous request
to display the video in picture-in-picture mode.
[Value("requestPictureInPicture")]
public Task<PictureInPictureWindow> RequestPictureInPicture()
Returns
- Task<PictureInPictureWindow>
A {{jsxref("Promise")}} that will resolve to a PictureInPictureWindow
object that can be used to listen when a user will resize that floating window.
Remarks
It's not guaranteed that the video will be put into picture-in-picture. If permission
to enter that mode is granted, the returned Promise will resolve and the
video will receive a HTMLVideoElement.Enterpictureinpicture event to let it know that it's now in picture-in-picture.
-The video element
-DisablePictureInPicture
-PictureInPictureEnabled
-ExitPictureInPicture()
-Document.PictureInPictureElement
-:picture-in-picture
RequestVideoFrameCallback(VideoFrameRequestCallback)
The requestVideoFrameCallback() method of the HTMLVideoElement interface registers a callback function that runs when a new video frame is sent to the compositor. This enables developers to perform efficient operations on each video frame.
[Value("requestVideoFrameCallback")]
public ulong RequestVideoFrameCallback(VideoFrameRequestCallback callback)
Parameters
callbackVideoFrameRequestCallback
Returns
- ulong
A number representing a unique callback ID.This can be passed to CancelVideoFrameCallback(ulong) to cancel the callback registration.
Remarks
-The video element
-CancelVideoFrameCallback(ulong)
-Perform efficient per-video-frame operations on video with requestVideoFrameCallback() on developer.chrome.com (2023)