HTML and CSS Reference
In-Depth Information
<cc:implementation >
<div id="#{cc.clientId}">
<video jsf:id="#{cc.elementId} "
jsf:value="#{cc.attrs.value}"
crossorigin="#{cc.attrs.crossorigin}"
preload="#{cc.attrs.preload}"
mediagroup="#{cc.attrs.mediagroup}"
src="#{cc.attrs.value}">
<c:forEach items="#{cc.attrs.sources}" var="source" >
<source src="#{source.source}" type="#{source.type}" />
</c:forEach>
<c:forEach items="#{cc.attrs.tracks}" var="track" >
<track jsf:value="#{track.source}" src="#{track.source}">
<c:if test="#{track.kind != null}">
<f:passThroughAttribute name="kind" value="#{track.kind.toString()}" />
</c:if>
<c:if test="#{track.locale != null}">
<f:passThroughAttribute name="srclang"
value="#{track.locale.toString()}" />
</c:if>
<c:if test="#{track.defaultTrack}">
<f:passThroughAttribute name="defaultTrack" value="defaultTrack" />
</c:if>
</track>
</c:forEach>
</video>
</div>
</cc:implementation>
</html>
Example of using the video component
Using the video component is trivial. If you want to provide the media sources and text tracks to the component, you
must use a managed bean to contain your collections; otherwise the components can be used with a managed bean.
Listing 8-12 shows an example where a collection of media sources and text tracks are fetched from a backing bean.
The backing bean in Listing 8-13 exposes the properties as collections that could come from a database.
Listing 8-12. Using the Video Component
<h2>Video with a single media file</h2>
<projsfhtml5:video value="media/trailer.mp4"
autoplay="true"
controls="true" />
 
Search WWH ::




Custom Search