Skip to content

Instantly share code, notes, and snippets.

@wabson
Created February 28, 2013 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wabson/5057107 to your computer and use it in GitHub Desktop.
Save wabson/5057107 to your computer and use it in GitHub Desktop.
Sample configuration to enable the Media Viewers 2.x viewer plug-ins in Alfresco Share. This is only needed on Alfresco 4.0 and 4.1, since newer versions can use the supplied extensibility modules which supply this same configuration.
<config>
<!--
List of rule to decide which plugin that shall be used to preview the node's content or thumbnails.
The list is evaluated from the top.
All attributes for a condition must match.
When a condition matches the nodes' mimeType and/or thumbails its list of plugins are tested from the top.
Every plugin will be created and get an opportunity to decide if it may be used in the users browser environment.
If the plugin can't be used it will give a report back to the user that will be displayed if neither of the
plugins in the list can be used.
-->
<plugin-conditions>
<!--
Enables the PdfJs viewer for all PDF documents or Embed in older browsers
The PdfJs <plugin> element supports the following attributes to further control the viewer
* src="value" Name of the thumbnail to display, which should be a PDF (default null, forces the cm:content property to be used)
* skipbrowsertest="true|false" Skipbrowser test, mostly for developer to force test loading (default "false")
* mode="iframe|block" Display mode. "block" is the normal Share view, "iframe" uses the pdf.js viewer in an iframe (deprecated, default "block")
* defaultScale="page-width|two-page-width|page-height|page-fit|two-page-fit|auto|value" Default zoom level for new documents, either a predefined string (for auto-calculation) or a decimal number between 0 and 1 (default "two-page-fit")
* scaleDelta="value" Multipler for zooming in/out, should be a decimal > 1 (default "1.1")
* pageLayout="single|multi" Layout to use to display pages, "single" (one page per row) or "multi" (multiple pages per row) (default "multi")
* disableTextLayer="true|false" Whether text overlays on pages should be disabled. Overlays allow users to select text content in their browser but reduce rendering performance (default "false")
* useLocalStorage="true|false" Whether to use HTML5 browser storage to persist the page number and zoom level of previously-viewed documents (default "true")
The Embed <plugin> element supports the following attributes
* src="value" Name of the thumbnail to display (default null, forces the cm:content property to be used)
* ieActiveX="true|false" Comma separated string of Windows ActiveX id:s. Used in Internet Explorer only to test for plugin presence. (default "AcroPDF.PDF,PDF.PdfCtrl,FOXITREADEROCX.FoxitReaderOCXCtrl.1")
* testPluginAvailability="true|false" Test if a plugin is available. Use for mime types that need a plugin to display for example application/pdf (default "false")
-->
<condition mimeType="application/pdf">
<plugin>PdfJs</plugin>
<plugin>Embed</plugin>
</condition>
<!--
Enables the PdfJs viewer for other content which can be transformed to PDF or Embed
in older browsers.
Note, the OpenOffice transformer must be available on the server for this to work.
-->
<condition thumbnail="pdf">
<plugin src="pdf">PdfJs</plugin>
<plugin src="pdf">Embed</plugin>
</condition>
<!--
Enables the FLVPlayer viewer for video formats natively-supported by Flash
The <plugin> element supports the following attributes to further control the viewer
* poster="value" Name of the static image thumbnail to display before displaying the video (default "imgpreviewfull")
* queueMissingRenditions="true|false" Whether the player should attempt to queue the generation of missing video thumbnails (default "true")
* autoplay="true|false" Whether to auto-play the video (default "false")
* autoload="true|false" Whether to auto-load the video (default "true")
* playercolor="value" Color of the player in hex notation, without the initial '#' (default "e1e3e5")
* buttoncolor="value" Color of the player button icons in hex notation (default "000000")
* buttonovercolor="value" Hover color of the player buttons in hex notation (default "0088de")
* sliderovercolor="value" Hover color of the player slider in hex notation (default "0088de")
* showfullscreen="true|false" Whether to show the full screen button (default "true")
* showiconplay="true|false" Whether to show the play button (default "true")
* showvolume="true|false" Whether to show the volume control (default "true")
* showtime="true|false" Whether to show the elapsed time in the player (default "true")
* playermargin="value" Margin in pixels around the player (default "0")
-->
<condition mimeType="video/mp4">
<plugin>FLVPlayer</plugin>
</condition>
<condition mimeType="video/m4v">
<plugin>FLVPlayer</plugin>
</condition>
<condition mimeType="video/x-flv">
<plugin>FLVPlayer</plugin>
</condition>
<!--
Enables the FLVPlayer viewer for other common video formats. This requires FFmpeg support.
-->
<condition mimeType="video/mpeg2" thumbnail="h264preview">
<plugin>FLVPlayer</plugin>
</condition>
<condition mimeType="video/quicktime" thumbnail="h264preview">
<plugin>FLVPlayer</plugin>
</condition>
<condition mimeType="video/ogg" thumbnail="h264preview">
<plugin>FLVPlayer</plugin>
</condition>
<condition mimeType="video/x-msvideo" thumbnail="h264preview">
<plugin>FLVPlayer</plugin>
</condition>
<condition mimeType="video/webm" thumbnail="h264preview">
<plugin>FLVPlayer</plugin>
</condition>
<!--
Enables the MP3Player viewer for audio formats natively-supported by Flash
-->
<condition mimeType="audio/mpeg">
<plugin>MP3Player</plugin>
</condition>
<!--
Enables the MP3Player viewer for other common audio formats. This requires FFmpeg support.
The <plugin> element supports the following attributes to further control the viewer
* mp3ThumbnailName="value" Name of the audio thumbnail to look in for MP3 audio content for non-MP3 files (default "mp3thumbnail")
* queueMissingRenditions="true|false" Whether the player should attempt to queue the generation of missing audio thumbnails (default "true")
* autoplay="true|false" Whether to auto-play the audio (default "false")
* autoload="true|false" Whether to auto-load the audio (default "true")
-->
<condition mimeType="audio/x-wav" thumbnail="mp3preview">
<plugin>MP3Player</plugin>
</condition>
<condition mimeType="audio/x-flac" thumbnail="mp3preview">
<plugin>MP3Player</plugin>
</condition>
<condition mimeType="audio/vorbis" thumbnail="mp3preview">
<plugin>MP3Player</plugin>
</condition>
<condition mimeType="audio/ogg" thumbnail="mp3preview">
<plugin>MP3Player</plugin>
</condition>
<condition mimeType="audio/x-ms-wma" thumbnail="mp3preview">
<plugin>MP3Player</plugin>
</condition>
<!--
Enables the Prettify viewer for JavaScript files using language auto-detection
and for CSS files setting the type explictly (see list in prettify's README)
-->
<condition mimeType="application/x-javascript">
<plugin>Prettify</plugin>
</condition>
<condition mimeType="text/css">
<plugin lang="lang-css">Prettify</plugin>
</condition>
<!--
Enables the EXPERIMENTAL WebODF viewer for Open Document text files
-->
<condition mimeType="application/vnd.oasis.opendocument.text">
<plugin>WebODF</plugin>
</condition>
<!-- DEFAULT SHARE CONFIGURATION BELOW THIS LINE -->
<!-- Video with posters -->
<condition mimeType="video/mp4" thumbnail="imgpreview">
<plugin poster="imgpreview" posterFileSuffix=".png">StrobeMediaPlayback</plugin>
<plugin poster="imgpreview" posterFileSuffix=".png">FlashFox</plugin>
<plugin poster="imgpreview" posterFileSuffix=".png">Video</plugin>
</condition>
<condition mimeType="video/m4v" thumbnail="imgpreview">
<plugin poster="imgpreview" posterFileSuffix=".png">StrobeMediaPlayback</plugin>
<plugin poster="imgpreview" posterFileSuffix=".png">FlashFox</plugin>
<plugin poster="imgpreview" posterFileSuffix=".png">Video</plugin>
</condition>
<condition mimeType="video/x-flv" thumbnail="imgpreview">
<plugin poster="imgpreview" posterFileSuffix=".png">StrobeMediaPlayback</plugin>
<plugin poster="imgpreview" posterFileSuffix=".png">FlashFox</plugin>
</condition>
<condition mimeType="video/quicktime" thumbnail="imgpreview">
<plugin poster="imgpreview" posterFileSuffix=".png">StrobeMediaPlayback</plugin>
</condition>
<condition mimeType="video/ogg" thumbnail="imgpreview">
<plugin poster="imgpreview" posterFileSuffix=".png">Video</plugin>
</condition>
<condition mimeType="video/webm" thumbnail="imgpreview">
<plugin poster="imgpreview" posterFileSuffix=".png">Video</plugin>
</condition>
<!-- Video without posters -->
<condition mimeType="video/mp4">
<plugin>StrobeMediaPlayback</plugin>
<plugin>FlashFox</plugin>
<plugin>Video</plugin>
</condition>
<condition mimeType="video/x-m4v">
<plugin>StrobeMediaPlayback</plugin>
<plugin>FlashFox</plugin>
<plugin>Video</plugin>
</condition>
<condition mimeType="video/x-flv">
<plugin>StrobeMediaPlayback</plugin>
<plugin>FlashFox</plugin>
</condition>
<condition mimeType="video/quicktime">
<plugin>StrobeMediaPlayback</plugin>
</condition>
<condition mimeType="video/ogg">
<plugin>Video</plugin>
</condition>
<condition mimeType="video/webm">
<plugin>Video</plugin>
</condition>
<!-- Audio -->
<condition mimeType="audio/mpeg">
<plugin>StrobeMediaPlayback</plugin>
<plugin>FlashFox</plugin>
<plugin>Audio</plugin>
</condition>
<condition mimeType="audio/x-wav">
<plugin>Audio</plugin>
</condition>
<!-- Documents that has been converted to .swf -->
<condition thumbnail="webpreview">
<plugin src="webpreview" paging="true">WebPreviewer</plugin>
</condition>
<!-- Content that has an image preview thumbnail -->
<condition thumbnail="imgpreview">
<plugin src="imgpreview">Image</plugin>
</condition>
<!-- Images in real size (if they didn't have a imgpreview) -->
<condition mimeType="image/jpeg">
<plugin srcMaxSize="500000">Image</plugin>
</condition>
<condition mimeType="image/png">
<plugin srcMaxSize="500000">Image</plugin>
</condition>
<condition mimeType="image/gif">
<plugin srcMaxSize="500000">Image</plugin>
</condition>
<condition mimeType="application/x-shockwave-flash">
<plugin>Flash</plugin>
</condition>
<!-- To add zooming capabilities for images place the following inside a <condition> element -->
<!-- <plugin>WebPreviewer</plugin> -->
</plugin-conditions>
</config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment