17.2. Using the media player dialog box

The dialog box has two tabs. First tab allows to specify one or more media files. The other tab allows to configure the media player.

17.2.1. The Media tab

Figure 9.21. The Media tab of the media player dialog box

The Media tab of the media player dialog box

  • Click Add to add a media file.

  • Click Edit to modify selected media file.

  • Click Remove to remove selected media file.

  • Click Remove All to remove all media files.

  • Use drag and drop to reorder the list of media files. The media file which is actually played by the embedded media player is the first one in the list having a supported format (see supported formats below).

Clicking Add or Edit displays the following dialog box:

  • In the "Media file" field, specify the absolute or relative URL of a media file. Make sure to specify a file having a content type matching the underlying media element. For example, do not specify a video file for a media player used to render an XHTML 5 audio element.

  • In the "Content type" field, specify the precise content type of the media file. Leave blank if you are not sure of what this content type could be.

Specify alternate audio and video formats whenever possible

The embedded media player only supports playing few audio and video formats, mainly .mp3 (audio/mpeg) , .wav (audio/x-wav), .m4a (audio/x-m4a), .mp4 (video/mp4).

This should not prevent you from specifying alternate audio and video formats like .ogg (audio/ogg), .webm (video/webm), etc. Such formats may be the only ones supported by the application which will be used to open your deliverable (example: Apple iBook used to open the EPUB 3 book resulting from the conversion of a DITA document). So it is important to specify alternate audio and video formats whenever possible.

17.2.2. The Setup tab

Figure 9.22. The Setup tab of the media player dialog box

The Setup tab of the media player dialog box

The following checkboxes allows to configure the embedded audio or video player:

  • Show media controls (play/pause button, etc). Corresponds to the the controls attribute of an XHTML 5 audio or video element.

    Note that when the media player has not been given any control button, it's still possible to use it by right-clicking in it and selecting the Play/Pause, Rewind, Forward and Back items found in the popup menu. See Figure 9.20, “The right-click popup menu of a media player (audio only, no controls)”.

  • Start playing as soon as media is ready. Corresponds to the the autoplay attribute of an XHTML 5 audio or video element.

  • Start over again every time media is finished. Corresponds to the the loop attribute of an XHTML 5 audio or video element.

  • Audio output initially muted. Corresponds to the the muted attribute of an XHTML 5 audio or video element.

The Video frame is absent when the media player is used to render an audio element.

Width

Width of the embedded media player. Strictly positive integer expressed in pixels.

The default width and height are those of the media actually played by the media player, that is, the intrinsic video size.

Note

The media player embedded in XXE's styled view will always look too small on the HiDPI screen of a Linux computer.

As already explained, the media player is implemented using the JavaFX® technology and for now, JavaFX is HiDPI-aware only on Windows and on the Mac.

Height

Height of the embedded media player. Strictly positive integer expressed in pixels.

Note that it's possible to specify only the width of the media player or only its height or both its width and height.

Image to be shown until the video is playing

Corresponds to the poster attribute of an XHTML 5 video element. The absolute or relative URL of a PNG or JPEG image file.

Unless above Width and/or Height have been specified, the media player is given the size of this “poster image”.