Linking to a Youtube Video
You can embed a Youtube video in your DITA source document.
To embed a Youtube Videa:
1. Create the an object tag for the video, for example: <object> </object>
2. Make sure that you are using the Embed URL and not the default URL provided in your browser when on the YouTube website. To obtain the proper URL, follow the instructions for obtaining a share link to embed in a website.
3. Next you are going to want to specify certain attributes for your video object
Specify what width and height you want to give to your video in the width and height attributes.
Set the data attribute to the link to the video file (optional).
For example:
<object width="560" height="320" data="https://www.youtube.com/embed/Fy1SB0ClS0k"> </object>
Note: The proper URL should contain “embed” in the path.
4. Next you can set certain param tags for your video depending on your own specifications
Note: The data
attribute on the object
element is optional.
The following is a fully working code example of the following steps:
<object outputclass="Foo" width="560" height="320">
<param name="movie" value="https://www.youtube.com/embed/Fy1SB0ClS0k" />
<param name="controls" value="true" />
</object>
Last modified date: 11/13/2024