HtmlVideoElement Class
https://html.spec.whatwg.org/multipage/media.html#htmlvideoelement
public sealed class HtmlVideoElement : HtmlMediaElement- Inheritance
HtmlMediaElementHtmlVideoElement
Properties
| Name | Description |
|---|---|
| DisablePictureInPicture | Gets or sets whether the user agent must not show the video in Picture-in-Picture (https://w3c.github.io/picture-in-picture/#disable-pip): when set, the pending requests fail and the video leaves Picture-in-Picture. |
| Height | Gets or sets the value of the height content attribute. |
| OnEnterPictureInPicture | Gets or sets the handler of the enterpictureinpicture event. |
| OnLeavePictureInPicture | Gets or sets the handler of the leavepictureinpicture event. |
| PlaysInline | Gets or sets a value indicating whether the element has the playsinline content attribute. |
| Poster | Gets or sets the poster content attribute, as a URL resolved against the base URL of the document. |
| VideoHeight | Gets the natural height of the video in CSS pixels (https://html.spec.whatwg.org/multipage/media.html#dom-video-videoheight), or 0 when the dimensions are not known (the ready state is HAVE_NOTHING, or the resource has no video). |
| VideoWidth | Gets the natural width of the video in CSS pixels (https://html.spec.whatwg.org/multipage/media.html#dom-video-videowidth), or 0 when the dimensions are not known (the ready state is HAVE_NOTHING, or the resource has no video). |
| Width | Gets or sets the value of the width content attribute. |
DisablePictureInPicture
PictureInPicture.csGets or sets whether the user agent must not show the video in Picture-in-Picture (https://w3c.github.io/picture-in-picture/#disable-pip): when set, the pending requests fail and the video leaves Picture-in-Picture.
public bool DisablePictureInPicture { get; set; }Height
HtmlElements.g.csGets or sets the value of the height content attribute.
public uint Height { get; set; }OnEnterPictureInPicture
PictureInPicture.csGets or sets the handler of the enterpictureinpicture event.
OnLeavePictureInPicture
PictureInPicture.csGets or sets the handler of the leavepictureinpicture event.
PlaysInline
HtmlElements.g.csGets or sets a value indicating whether the element has the playsinline content attribute.
public bool PlaysInline { get; set; }Poster
HtmlElements.g.csGets or sets the poster content attribute, as a URL resolved against the base URL of the document.
public string Poster { get; set; }VideoHeight
VideoElement.csGets the natural height of the video in CSS pixels (https://html.spec.whatwg.org/multipage/media.html#dom-video-videoheight), or 0 when the dimensions are not known (the ready state is HAVE_NOTHING, or the resource has no video).
public uint VideoHeight { get; }VideoWidth
VideoElement.csGets the natural width of the video in CSS pixels (https://html.spec.whatwg.org/multipage/media.html#dom-video-videowidth), or 0 when the dimensions are not known (the ready state is HAVE_NOTHING, or the resource has no video).
public uint VideoWidth { get; }Width
HtmlElements.g.csGets or sets the value of the width content attribute.
public uint Width { get; set; }Methods
| Name | Description |
|---|---|
| CancelVideoFrameCallback(uint) | Cancels a callback registered by HtmlVideoElement.RequestVideoFrameCallback (an unknown handle is ignored). |
| GetVideoPlaybackQuality() | Returns the playback quality metrics of the video (https://w3c.github.io/media-playback-quality/#dom-htmlvideoelement-getvideoplaybackquality): the numbers of frames reported by the player of the media backend (MediaPlayer.TotalVideoFrames, MediaPlayer.DroppedVideoFrames; 0 without player), at the current time. |
| RequestPictureInPicture() | Shows the video in a floating window (https://w3c.github.io/picture-in-picture/#request-pip). The task completes with the window once enterpictureinpicture is fired at the element. It fails with a SecurityError DomException when the permissions policy of the document does not allow the picture-in-picture feature, an InvalidStateError when the video has no metadata or no video track, its HtmlVideoElement.DisablePictureInPicture attribute is set, or the user agent cannot open the window, and a NotAllowedError when no element of the document is in Picture-in-Picture and the window has no transient activation (which is consumed). The window is opened by UserAgentUIBackend.OpenPictureInPictureWindowAsync. |
| RequestVideoFrameCallback(VideoFrameRequestCallback) | Registers a callback that runs when a new frame of the video is presented (https://wicg.github.io/video-rvfc/#dom-htmlvideoelement-requestvideoframecallback): in the next rendering update of the window after the frame, before the animation frame callbacks and with the same time. The callback runs once; a callback registered by a callback runs with the next frame. |
CancelVideoFrameCallback(uint)
VideoElement.FrameCallbacks.csCancels a callback registered by HtmlVideoElement.RequestVideoFrameCallback (an unknown handle is ignored).
GetVideoPlaybackQuality()
VideoElement.csReturns the playback quality metrics of the video (https://w3c.github.io/media-playback-quality/#dom-htmlvideoelement-getvideoplaybackquality): the numbers of frames reported by the player of the media backend (MediaPlayer.TotalVideoFrames, MediaPlayer.DroppedVideoFrames; 0 without player), at the current time.
public VideoPlaybackQuality GetVideoPlaybackQuality()RequestPictureInPicture()
PictureInPicture.csShows the video in a floating window (https://w3c.github.io/picture-in-picture/#request-pip). The task completes with the window once enterpictureinpicture is fired at the element. It fails with a SecurityError DomException when the permissions policy of the document does not allow the picture-in-picture feature, an InvalidStateError when the video has no metadata or no video track, its HtmlVideoElement.DisablePictureInPicture attribute is set, or the user agent cannot open the window, and a NotAllowedError when no element of the document is in Picture-in-Picture and the window has no transient activation (which is consumed). The window is opened by UserAgentUIBackend.OpenPictureInPictureWindowAsync.
public Task<PictureInPictureWindow> RequestPictureInPicture()RequestVideoFrameCallback(VideoFrameRequestCallback)
VideoElement.FrameCallbacks.csRegisters a callback that runs when a new frame of the video is presented (https://wicg.github.io/video-rvfc/#dom-htmlvideoelement-requestvideoframecallback): in the next rendering update of the window after the frame, before the animation frame callbacks and with the same time. The callback runs once; a callback registered by a callback runs with the next frame.
public uint RequestVideoFrameCallback(VideoFrameRequestCallback callback)Parameters
callbackVideoFrameRequestCallback- The callback.
Returns
uint The handle of the callback, for HtmlVideoElement.CancelVideoFrameCallback.