HTML and CSS Reference
In-Depth Information
<cc:attribute name="width" type="java.lang.String"
shortDescription="Width of the video" />
<cc:attribute name="height" type="java.lang.String"
shortDescription="Height of the video" />
<cc:attribute name="sources" type="java.util.Collection"
shortDescription="Collection of alternative MediaSources" />
<cc:attribute name="tracks" type="java.util.Collection"
shortDescription="Collection of MediaTracks" />
</cc:interface>
<cc:implementation >
<div id="#{cc.clientId}">
<video jsf:id="media-player"
jsf:value="#{cc.attrs.value}">
</video>
</div>
</cc:implementation>
</html>
The following are demonstrations of the two methods for conditionally including attributes in the output of the
composite component.
Method one: <f:passThroughAttribute/>
Each of the attributes can be added directly in the Facelets view file by embedding the <f:passThroughAttribute />
tag in the <video /> tag as shown in Listing 8-6.
Listing 8-6. Using Conditional <f:passThroughAttribute /> Elements
<cc:implementation >
<div id="#{cc.clientId}">
<video jsf:id="media-player"
jsf:value="#{cc.attrs.value}"
crossorigin="#{cc.attrs.crossorigin}"
preload="#{cc.attrs.preload}"
mediagroup="#{cc.attrs.mediagroup}"
src="#{cc.attrs.value}">
<c:if test="#{cc.attrs.autoplay}">
<f:passThroughAttribute name="autoplay" value="true" />
</c:if>
<c:if test="#{cc.attrs.loop}">
<f:passThroughAttribute name="loop" value="true" />
</c:if>
<c:if test="#{cc.attrs.muted}">
<f:passThroughAttribute name="muted" value="true" />
</c:if>
 
Search WWH ::




Custom Search