Prevent the Display of Undecorated Media Content

The definitions of the Widget Framework's Video and Audio content types include a decorator declaration – either <ui:decorator name="audioArticleDecorator"/> for Audio content items or <ui:decorator name="videoArticleDecorator"/> for Video content items. These declarations mean that a Java component called a decorator is called during the rendering of the content items, if available. The audioArticleDecorator and videoArticleDecorator decorators specified in these declarations are provided by the Escenic Video plug-in, so if your Content Engine installation does not include the Video plug-in, the declarations are ignored.

However, if you do use the Video plug-in to manage your media content, then these decorators are an essential component of the rendering process. If, for any reason, the required decorator is unavailable or fails in some way during rendering, then the media item being published will not be rendered correctly and will not work.

In order to prevent such failures resulting in the display of defective media content on your site, you can set a switch that requires the decorator to be present and to execute successfully. If a failure occurs, then the audio or video content item affected will not be displayed at all rather than being displayed in a defective state.

If several media items are published on the same page and one of them fails and is therefore not displayed, the other items on the page will not be affected and will still be displayed.

To set this switch you need to:

  1. Create content type overrides for the Video and Audio content types, as described in Override a Core Content Type.

  2. Add a fail-on-error="true" attribute to each of the media content types' decorator declarations. For the Video content type, for example:

    <ui:decorator name="videoArticleDecorator" fail-on-error="true"/>
  3. Save your changes.

Note that this change will not have any effect unless your media content is published via the Video plug-in.