This chapter explains how to add SVG, MathML, audio,
video and Flash animations to your DITA topics and how
ditac
processes this rich media content in the case where
the output format supports rich media (e.g. XHTML 5, EPUB 3) and also in the
case where the output format does not support rich media (e.g. XHTML 1, PDF,
RTF).
![]() |
NoteXMLmind XML Editor has an
"Insert media object" button in its DITA
Topic tool bar which allows to easily insert any of
the elements and processing-instructions described in this chapter.
![]() |
<p><image href="media/graphic.svg"/></p>
<p><foreign><svg:svg height="140" id="svg2" version="1.1" viewBox="0 0 264 120" width="320" xmlns:svg="http://www.w3.org/2000/svg"> <svg:defs id="defs39"/> ... </svg:g> </svg:svg></foreign></p>
<p><foreign><mml:math display="block" xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mo>{</mml:mo> <mml:mtable> <mml:mtr> <mml:mtd> ... </mml:mtd> </mml:mtr> </mml:mtable> </mml:mrow> </mml:math></foreign></p>
<p><object data="media/audio.mp3" type="audio/mpeg"> <param name="source.src" value="media/audio.ogg"/> <param name="source.type" value="audio/ogg"/> <param name="source.src" value="media/audio.m4a"/> <param name="source.type" value="audio/mp4"/> <param name="source.src" value="media/audio.wav"/> <param name="source.type" value="audio/wav"/> <param name="controls" value="true"/> </object></p>
<p><object data="media/video.mp4" type="video/mp4"> <param name="source.src" value="media/video.ogv"/> <param name="source.type" value='video/ogg; codecs="theora, vorbis"'/> <param name="source.src" value="media/video.webm"/> <param name="source.type" value="video/webm"/> <param name="width" value="320"/> <param name="controls" value="yes"/> <param name="poster" value="media/video_poster.jpg"/> </object></p>
<p><object data="animation.swf" type="application/x-shockwave-flash" width="431" height="123"> <param name="movie" value="animation.swf"/> <param name="menu" value="true"/> <param name="quality" value="low"/> </object></p>
ditac
for the
following output formats: XHTML 5, XHTML 5 Web Help and EPUB 3.
It is discarded for any other output format.
onclick_data -> action (S action)* action -> op '(' target_id? ')' op -> 'play'|'pause'|'resume'|'mute'|'unmute' 'show'|'hide'
<p>Example 1: <xref href="#media/target_audio"><?onclick play()?> Say "<ph xml:lang="fr">Viens Hubble!</ph>"</xref> ... <object data="media/audio.wav" id="audio_sample" type="audio/wav"> <desc> ... </desc> </object></p>
<p>Example 2: <xref href="#media/target_image"><?onclick hide()?>Hide Hubble</xref>. <xref href="#media/target_image"><?onclick show()?>Show Hubble</xref>.</p>