Class DamVideoMediaMarkupBuilder
- java.lang.Object
-
- io.wcm.handler.mediasource.dam.markup.DamVideoMediaMarkupBuilder
-
- All Implemented Interfaces:
MediaMarkupBuilder
@Model(adaptables={org.apache.sling.api.SlingHttpServletRequest.class,org.apache.sling.api.resource.Resource.class}) @ConsumerType public class DamVideoMediaMarkupBuilder extends java.lang.Object implements MediaMarkupBuilderDefault implementation ofMediaMarkupBuilderfor DAM video assets.
-
-
Field Summary
-
Fields inherited from interface io.wcm.handler.media.spi.MediaMarkupBuilder
DUMMY_IMAGE, DUMMY_MIN_DIMENSION
-
-
Constructor Summary
Constructors Constructor Description DamVideoMediaMarkupBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccepts(@NotNull Media media)Checks whether this builder can generate markup for the given media.protected voidaddSources(io.wcm.handler.commons.dom.Video video, Media media)Add sources for HTML5 video playerio.wcm.handler.commons.dom.HtmlElementbuild(@NotNull Media media)Build media element markupprotected java.util.Map<java.lang.String,java.lang.String>getAdditionalFlashPlayerFlashVars(Media media, Dimension dimension)Get additional parameters to be set as flashvars parameter on html object element for flash player.protected java.util.Map<java.lang.String,java.lang.String>getAdditionalFlashPlayerParameters(Media media, Dimension dimension)Get additional parameters to be set as <param> elements on html object element for flash player.protected @Nullable com.day.cq.dam.api.AssetgetDamAsset(Media media)protected io.wcm.handler.commons.dom.VideogetVideoPlayerElement(@NotNull Media media)Build HTML5 video player elementprotected java.util.List<java.lang.String>getVideoProfileNames()Return video profile names stored below /etc/dam/video supported by this markup builder.protected java.util.List<com.day.cq.dam.video.VideoProfile>getVideoProfiles()Return video profiles supported by this markup builder.booleanisValidMedia(@NotNull io.wcm.handler.commons.dom.HtmlElement element)Checks if the given HTML element is valid.
-
-
-
Method Detail
-
accepts
public final boolean accepts(@NotNull @NotNull Media media)Description copied from interface:MediaMarkupBuilderChecks whether this builder can generate markup for the given media.- Specified by:
acceptsin interfaceMediaMarkupBuilder- Parameters:
media- Media metadata- Returns:
- true if this markup builder can handle the given media
-
getVideoProfileNames
protected java.util.List<java.lang.String> getVideoProfileNames()
Return video profile names stored below /etc/dam/video supported by this markup builder.- Returns:
- Video profile names
-
getVideoProfiles
protected java.util.List<com.day.cq.dam.video.VideoProfile> getVideoProfiles()
Return video profiles supported by this markup builder.- Returns:
- Video profiles
-
getDamAsset
@Nullable protected @Nullable com.day.cq.dam.api.Asset getDamAsset(Media media)
- Parameters:
media- Media metadata- Returns:
- DAM asset or null
-
build
public final io.wcm.handler.commons.dom.HtmlElement build(@NotNull @NotNull Media media)Description copied from interface:MediaMarkupBuilderBuild media element markup- Specified by:
buildin interfaceMediaMarkupBuilder- Parameters:
media- Media metadata- Returns:
- Media element or null if media is invalid
-
getVideoPlayerElement
protected io.wcm.handler.commons.dom.Video getVideoPlayerElement(@NotNull @NotNull Media media)Build HTML5 video player element- Parameters:
media- Media metadata- Returns:
- Media element
-
addSources
protected void addSources(io.wcm.handler.commons.dom.Video video, Media media)Add sources for HTML5 video player- Parameters:
video- Videomedia- Media metadata
-
getAdditionalFlashPlayerParameters
protected java.util.Map<java.lang.String,java.lang.String> getAdditionalFlashPlayerParameters(Media media, Dimension dimension)
Get additional parameters to be set as <param> elements on html object element for flash player.- Parameters:
media- Media metadatadimension- Dimension- Returns:
- Set of key/value pairs
-
getAdditionalFlashPlayerFlashVars
protected java.util.Map<java.lang.String,java.lang.String> getAdditionalFlashPlayerFlashVars(Media media, Dimension dimension)
Get additional parameters to be set as flashvars parameter on html object element for flash player.- Parameters:
media- Media metadatadimension- Dimension- Returns:
- Set of key/value pairs
-
isValidMedia
public final boolean isValidMedia(@NotNull @NotNull io.wcm.handler.commons.dom.HtmlElement element)Description copied from interface:MediaMarkupBuilderChecks if the given HTML element is valid. It is treated as invalid if it is null, or if it is a simple IMG element containing the dummy image.- Specified by:
isValidMediain interfaceMediaMarkupBuilder- Parameters:
element- Media markup element.- Returns:
- true if media element is invalid
-
-