31. Media player

component("com.xmlmind.xmledit.cssext.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.

[Important]The @media media-player block

CSS rules referencing component("com.xmlmind.xmledit.cssext.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 nameSee description.Specified class must implement interface com.xmlmind.xmledit.cssext.media.MediaPlayerDelegate. By default, this class is com.xmlmind.xmledit.cssext.media.HTMLMediaPlayerDelegate
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.cssext.media.MediaPlayerFactory",
                       type, video);
}

audio { 
    content: component("com.xmlmind.xmledit.cssext.media.MediaPlayerFactory",
                       type, audio);
}
}

DocBook 5.1 example:

@media media-player {
videoobject {
    content: component("com.xmlmind.xmledit.cssext.media.MediaPlayerFactory",
                      type, video,
                      delegate,
                      "com.xmlmind.xmleditext.docbook.MediaPlayerDelegateImpl");
}

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