Class Video
The video element is used to embed video content in an HTML document. It provides a way to include video files that can be played by the browser's built-in video player. The video element supports multiple video formats and provides various attributes for controlling playback, appearance, and behavior. It can contain source elements to specify multiple video formats for browser compatibility.
Examples:
The following convenience methods are provided for constructing instances of this bean:
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoplay attribute.controls attribute.crossorigin(String value) crossorigin attribute.height attribute.loop attribute.mediagroup(String value) mediagroup attribute.muted attribute.poster attribute.preload attribute.src attribute.width attribute.Methods inherited from class org.apache.juneau.bean.html5.HtmlElementMixed
child, children, getChild, getChild, getChild, getChildren, setChildrenMethods inherited from class org.apache.juneau.bean.html5.HtmlElement
accesskey, attr, attrUri, class_, contenteditable, deminimize, dir, getAttr, getAttr, getAttrs, hidden, id, lang, onabort, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, oncuechange, ondblclick, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting, self, setAttrs, spellcheck, style, tabindex, title, toString, translate
-
Constructor Details
-
Video
public Video()Creates an emptyVideoelement. -
Video
Creates aVideoelement with the specifiedsrc(Object)attribute.- Parameters:
src- Thesrc(Object)attribute. Can benull , in which case the attribute is stored with anull value (not removed).
-
-
Method Details
-
autoplay
autoplay attribute.Hint that the media resource can be started automatically when the page is loaded.
This attribute uses deminimized values:
false - Attribute is not addedtrue - Attribute is added as"autoplay" - Other values - Passed through as-is
-
controls
controls attribute.Show user agent controls.
This attribute uses deminimized values:
false - Attribute is not addedtrue - Attribute is added as"controls" - Other values - Passed through as-is
-
crossorigin
crossorigin attribute.Specifies how the element handles cross-origin requests for CORS (Cross-Origin Resource Sharing).
Possible values:
"anonymous" - Cross-origin requests are made without credentials"use-credentials" - Cross-origin requests include credentials
- Parameters:
value- How to handle cross-origin requests. Can benull to unset the attribute.- Returns:
- This object.
-
height
height attribute.Vertical dimension.
-
loop
loop attribute.Causes the media to automatically restart from the beginning when it reaches the end.
- Parameters:
value- Iftrue , the media will loop continuously. Can benull to unset the attribute.- Returns:
- This object.
-
mediagroup
mediagroup attribute.Groups multiple media elements together so they can be controlled as a single unit. All media elements with the same mediagroup value will share the same MediaController, allowing synchronized playback.
This is useful for creating synchronized audio/video presentations or multiple camera angles.
- Parameters:
value- The name of the media group to join. Can benull to unset the attribute.- Returns:
- This object.
-
muted
muted attribute.Mutes the audio output by default. Useful for autoplay videos where audio should be disabled initially.
- Parameters:
value- Iftrue , the media will be muted by default. Can benull to unset the attribute.- Returns:
- This object.
-
poster
poster attribute.Specifies an image to display as a placeholder before the video starts playing. This image is shown while the video is loading or before the user clicks play.
The poster image should be representative of the video content and help users understand what the video contains.
- Parameters:
value- The URL of the poster image to display before video playback. Can benull to unset the attribute.- Returns:
- This object.
-
preload
preload attribute.Specifies how the browser should load the media resource.
Possible values:
"none" - Do not preload the media"metadata" - Preload only metadata (duration, dimensions, etc.)"auto" - Preload the entire media file (default)
- Parameters:
value- How much of the media to preload. Can benull to unset the attribute.- Returns:
- This object.
-
src
src attribute.Address of the resource.
The value can be of any of the following types:
URI,URL,String. Strings must be valid URIs.URIs defined by
UriResolvercan be used for values. -
width
width attribute.Horizontal dimension.
-