Class Source
The source element specifies multiple media resources for media elements like audio and video. It allows browsers to choose the most appropriate source based on format support, bandwidth, and other factors. The source element is used inside audio and video elements to provide fallback options for different media formats.
Examples:
The following convenience methods are provided for constructing instances of this bean:
See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods 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
-
Source
public Source()Creates an emptySourceelement. -
Source
- Parameters:
src- Thesrc(Object)attribute. Can benull , in which case the attribute is stored with anull value (not removed).type- Thetype(String)attribute. Can benull to unset the attribute.
-
-
Method Details
-
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. -
type
type attribute.Specifies the MIME type of the media resource. Helps browsers determine if they can play the media and which source to use when multiple sources are provided.
Common values:
"video/mp4" - MP4 video"video/webm" - WebM video"audio/mp3" - MP3 audio"audio/ogg" - OGG audio"audio/wav" - WAV audio
- Parameters:
value- The MIME type of the media resource. Can benull to unset the attribute.- Returns:
- This object.
-