public class MediaRenderer extends CoreRenderer {
@Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
Media media = (Media) component;
MediaPlayer player = resolvePlayer(context, media);
ResponseWriter writer = context.getResponseWriter();
String src;
try {
src = getMediaSrc(context, media);
} catch (Exception ex) {
throw new IOException(ex);
}
boolean isIE = AgentUtils.isIE(context);
String sourceParam = player.getSourceParam();
writer.startElement("object", media);
writer.writeAttribute("type", player.getType(), null);
writer.writeAttribute("data", src, null);
if(isIE) {
encodeIEConfig(writer, player);
}
if(media.getStyleClass() != null) {
writer.writeAttribute("class", media.getStyleClass(), null);
}
renderPassThruAttributes(context, media, HTML.MEDIA_ATTRS);
if(sourceParam != null) {
encodeParam(writer, player.getSourceParam(), src, false);
}
for(UIComponent child : media.getChildren()) {
if(child instanceof UIParameter) {
UIParameter param = (UIParameter) child;