Syntax - Youtube mediatypeThe youtube media type allows you to show youtube videos within your ximpel presentation.
<ximpel> <playlist> <subject id="subject1"> <media> <youtube id="AI0RTvlm0hw"/> </media> </subject> </playlist> </ximpel>This plays the youtube video with the id
AI0RTvlm0hw. The id of a youtube video can be found by going to the video in youtube and looking at the url of the video. For instance:
or maybe something like:
v=AI0RTvlm0hwspecifies the video that is playing, where
AI0RTvlm0hwis the video ID in this case.
Positioning of the youtube video
height attributes can be used to position the youtube video at a certain spot within the presentation and force it to have a certain size. If you don't set any of these attributes then the youtube video will take up the entire view area.
<youtube id="AI0RTvlm0hw" x="200px" y="200px" width="400px" height="400" />
By setting the
y attributes, the video will have an offset from the top-left of the view area. In that case if you don't specify a
height attribute the video will will have a width and height equal to the view-area. This will cause part of the video to become invisble (because offset+view-area is bigger than the view-area). Usually you want to provide width/height attributes when using x and y offsets. By specifying the
height attributes you can change the width and height that the video will have.
Note: the video itself might not have the dimensions you specified. This is because youtube will maintain the aspect ratio of the video. If you specify a width and height that does not reflect the aspect ratio of the video then youtube will use your specified width and height and display the video as large as possible inside these dimensions while maintaining the aspect ratio. In that case black bars may appear at the sides or the top/bottom of the video. If this is undesirable, then choose a width/height equal to the aspect ratio of the video.
heightof the youtube video are all based on a
1920x1080resolution. So the visible area of the presentation lies between
y=1080. Read more about the native XIMPEL resolution here.
Playing only part of the youtube videoIn order to start playing at a certain point within the youtube video, the
startTimeattribute can be used. This specifies the startTime in seconds from which to start playing.
<youtube id="AI0RTvlm0hw" startTime="30" />To control how much of the youtube video should be played, you can use the
durationattribute that is available for all media types. This specifies the number of seconds to play. So if the
duration="10"then the video will play from the 30 seconds point of the video to 40 seconds point of the video.
<youtube id="AI0RTvlm0hw" startTime="30" duration="10" />
Leaving out the duration attribute means it will play until the end of the video. Leaving out the startTime attribute means the video will be played from the beginning.
Mute audioTo mute the audio of a YouTube video, you can set the mute attribute to true:
<youtube id="AI0RTvlm0hw" mute="true" />