To integrate a video file to DITA content, proceed as follows:
- Add the video file to the folder containing the topic.
- Add an
<object>
element containing the video as shown below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic1">
<title>Video player</title>
<body>
<p>
<object data="my-video.mp4" outputclass="video" height="590" width="700"/>
</p>
<p>
<object data="videos/MyVideo.mp4" outputclass="video" width="560px" height="315px">
<param name="allowfullscreen" value="true"/>
</object>
It is also possible to use the following syntax:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic1">
<title>Video player</title>
<body>
<p>
<object data="videos/MyVideo.mp4" outputclass="video" width="560px" height="315px">
<param name="allowfullscreen" value="true"/>
</object>
- Upload local videos sparingly and use small files.
- See Disable video autoplay to stop autoplay.