Summary: An explanation of how to add various types of multimedia objects to your Connexions content. Examples of some of the more common multimedia objects are included.
Note: You are viewing an old version of this document. The latest version is available here.
Connexions modules can contain many different types of multimedia. This document explains how you can add the following types of multimedia objects to a module:
Any type of multimedia object that can be embedded in a Web
page can be put into a Connexions module using the CNXML
media tag. See the description of the media
tag in the CNXML Language Specification for more
information. The only requirement is that the object must have
a valid MIME (Multipurpose Internet Mail Extension) type. MIME
is a protocol that enables the transmission of data, such as
sound or movies, over the Internet without first having to be
translated into an ASCII format. See MIME
Types for more information. This module contains
examples of the CNXML entries and their resulting displays for
the different multimedia objects.
Please note the following items when you are working with multimedia additions to your module:
type attribute must match the MIME type
for the media object you want to appear in the module. For
example, if you are adding an image file that is in the
Portable Networks Graphics (png file extension) format, the
type attribute must be image/png. The entry
would look like the following example:
<media type="image/png" src="mypicture.png"/>
Some of the image file types and their corresponding MIME types used in Connexions modules are:
To embed images in your module, insert CNXML entries similar to the following example into the "index.cnxml" file for your module:
<figure id="figure-01">
<name>Example Figure</name>
<media type="image/png" src="envelope-taller.png"/>
<caption>A graphic image displayed as a figure.</caption>
</figure>
The src attribute in the media tag gives the location
or source of the image that you want to appear in the module. The
attribute can be a file name if you have uploaded the file into your
module, or a full URL for an image file stored elsewhere on the
Internet.
The actual display for the previous CNXML example is:
| Example Figure |
|---|
![]() |
You can place two images within the same figure using the
subfigure tag. This is useful when you have two
related images that you want to display side-by-side or one
above the other. To display two images within the same figure,
insert CNXML entries similar to the following example into the
"index.cnxml" file for your module:
<figure id="figure-2" orient="horizontal">
<subfigure id="subfigure-1">
<name>Tall Icon and Envelope</name>
<media type="image/png" src="envelope-taller.png"/>
<caption>
Subfigure 1.
</caption>
</subfigure>
<subfigure id="subfigure-2">
<name>Small Icon and Envelope</name>
<media type="image/png" src="envelope.png"/>
<caption>
Subfigure 2.
</caption>
</subfigure>
<caption>Two images displayed horizontally in one figure.</caption>
</figure>
The actual display for the previous CNXML example is:
|
The attribute orient can have a value of
horizontal or vertical, and determines
how the images are arranged in the figure.
If the images in your module are the appropriate size when you
view them on-line, but when you print the module they appear too
large for the page, Connexions lets you insert an additional
image file in your module that can be formatted and sized
specifically for the print version. Image files formatted in
eps are the preferred format for printed versions
of Connexions modules. If your module contains eps
files and png files of the same image, Connexions
uses the eps files when it generates a PDF file
for printing and uses the png files when displaying
the module on-line.
Here is how to insert additional image files in your module for the print version:
eps format version of your
image files. The image should be sized to the appropriate
dimensions. media type entry for the
eps image file in the "index.cnxml" file just
above the entry for image file for the on-line display. The
image files should have the same name, except that the
extension should indicate the file type. For example:
"image1.png" (for on-line) and "image1.eps" (for print) eps image file to the module.
<figure id='printimage'>
<media type='application/postscript' src='image.eps'>
<media type='image/png' src='image.png'/>
</media>
</figure>
eps) entry must appear above the
on-line image (png) entry in the "index.cnxml" file.
The on-line image entry should be indented and nested under the
alternate image entry.
You can also display an image, that when clicked, displays a larger version of the image. Here is how to do it:
media type entry for the full-sized
and thumbnail images, as shown in the following example.
<figure id='thumbnail'>
<media type='image/png' src='TajMahal_medium.jpg'>
<param name='thumbnail' value='TajMahal_Thumb.jpg'/>
</media>
</figure>
You can insert Flash objects in your module. Here is an example of the CNXML code required to include a Flash object:
<figure id='flashfig'>
<media type="application/x-shockwave-flash" src="flash.swf">
<param name='height' value='250'/>
<param name='width' value='250'/>
</media>
<caption>"Welcome to Connexions" example Flash object.</caption>
</figure>
figure tags
to allow captions for explanation purposes. The figure
tags are not required to include these media objects in a module.The following is a list of some types of movies that you can include in your module. You can embed these types and any other type that can normally be inserted into a web page.
Movies can be added to your module by including code similar to the following:
<figure id='moviefig2'>
<media type="video/mpeg" src="Building_on_the_Past.mpg">
<param name="width" value="450"/>
<param name="height" value="400"/>
<param name="autoplay" value="false"/>
</media>
<caption>The Creative Commons movie: "Building on the Past".
Click the Play button to start the movie.</caption>
</figure>
figure tags
to allow captions for explanation purposes. The figure
tags are not required to include these media objects in a module.Java applets can be added to your module by including code similar to the following:
<figure id="javafig">
<media type="application/x-java-applet" src="PhasorDemo.class">
<param name="width" value="430"/>
<param name="height" value="500"/>
</media>
<caption>3D Animation of a Complex Sinusoid. Click the Run button
to start the animation.</caption>
</figure>
figure tags
to allow captions for explanation purposes. The figure
tags are not required to include these media objects in a module.Audio files such as mp3, real audio, and wav files can be inserted into your module quickly and easily. To include audio files in your document, upload the corresponding audio file and include code similar to the following in your "index.cnxml" document:
<figure id='musicscale'>
<media type="audio/x-wav" src="chromatic_slurred.wav"/>
<caption>A chromatic scale performed on clarinet by Michael Lawrence.</caption>
</figure>
The actual display for the previous CNXML example is:
Audio File:
chromatic_slurred.wav |
figure tags
to allow captions for explanation purposes. The figure
tags are not required to include these media objects in a module.For information on including LabVIEW demonstrations in your module, please see Creating LabVIEW demonstrations for Connexions.
Some multimedia objects need options or parameters to display
properly. You can pass this information to the multimedia objects
with the param tag. This tag is contained within the
media tags and does not require modification of the
media tag. See the description of the
param
tag in the CNXML Language Specification for more
information.
Here is an example of a param tag entry for a video
(mpg) object:
<media type="video/mpeg" src="testmovie.mpg">
<param name="width" value="300"/>
<param name="height" value="300"/>
</media>
Different multimedia object types support and respond to different parameters. Examples of some of the parameters for the different multimedia object types are:
param tag allows you to specify the run-time
settings for an object inserted into XHTML documents.
If you are using nested media tags to provide for an alternate image
display, such as a photograph that appears in the printed version
of the module to replace a movie that appears in the on-line version,
insert the param entries for the primary image before
the nested media entry for the alternate image, as
shown in the following example:
<media type="video/mov" src="howto.mov">
<param name="height" value="250" />
<param name="width" value="250" />
<media type="image/png" src="novideo.png />
</media>