32. Media player

component("com.xmlmind.xmledit.media.MediaPlayerFactory", key, value, ..., key, value)

Inserts in generated content a media player similar to those found in Web browsers. This facility is currently used to render XHTML 5, DITA and DocBook 5.1 audio and video elements by embedding a media player in the styled view.

The @media media-player block

CSS rules referencing component("com.xmlmind.xmledit.media.MediaPlayerFactory") must be wrapped in a @media media-player block. This is needed because firstly, this corresponds to a user preference (feature MediaPlayer in XMLmind XML Editor - Online Help) and secondly, this feature requires running JavaFX®, hence a Java™ runtime having a version equal or greater than 1.8.0_40.

KeyValueDefaultDescription
delegateQualified Java™ class nameRequired.Specified class must implement interface com.xmlmind.xmledit.media.MediaPlayerDelegate.
typeaudio|videoNo default.Specify audio to create an audio-only media player; video to create a video-only media player. Do not specify type to create a general purpose, audio or video, media player.

XHTML 5 example:

@media media-player {

video {
    content: component("com.xmlmind.xmledit.media.MediaPlayerFactory",
                       type, video,
                       delegate,
                       "com.xmlmind.xmleditext.xhtml.MediaPlayerDelegateImpl");
}

audio { 
    content: component("com.xmlmind.xmledit.media.MediaPlayerFactory",
                       type, audio,
                       delegate,
                       "com.xmlmind.xmleditext.xhtml.MediaPlayerDelegateImpl");
}

}

See also spinner.