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.
mediaタグを使用することで、様々なタイプのマルチメディアファイルを、ConnexionsモジュールのWebページに組み込むことができます。mediaタグについての解説はCNXML Language Specificationを参照してください。ただしファイルに有効なMIME(Multipurpose Internet Mail Extension)がなくてはなりません。MIMEはASCIIフォーマットに翻訳されることなく、インターネット上で音声や動画ファイルの転送を可能にするプロトコルです。詳しくはMIME
Typesを参照してください。以降では、各マルチメディアファイルを組み込むためのCNXMLの入力例とその表示結果例を述べていきます。
タイプはMIMEタイプとマッチしなくてはなりません。例えば、もし画像ファイルをPNG形式でモジュールに追加しようとするなら、属性タイプはimage/pngでなければなりません。入力は以下のように行ってください。
<media type="image/png" src="mypicture.png"/>
<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>
src属性には、モジュールで表示したい画像を、場所かソースで指定します。画像がアップロードするか、インターネット上のほかの場所に保存されたイメージの完全なURLを持っている場合、この属性はファイル名のみになる場合があります。Example Figure![]() 図 1: A graphic image displayed as a figure. |
subfigureタグを使用することで、あなたは1つの図の中に2つの画像を置くことができます。これは、画像を左右や上下に並べて表示したい場合に役に立ちます。2つの画像を1つの図の中に表示するには、以下のようにCNXMLを入力してください。
<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>
図 2: Two images displayed horizontally in one figure. |
orient属性はhorizontalかverticalという値を持つことができます。それにより画像がどのように配置されるか指定することができます。
eps形式でフォーマットされた画像ファイルは印刷に適しています。同じ画像のeps形式ファイルとpng形式ファイルがモジュール内にある場合、Connexionsは印刷時のPDFファイル生成にはeps形式を、オンラインでモジュールを表示するにはpng形式を使用します。
eps形式バージョンを作成してください。そして適切なサイズにしてください。eps画像ファイルのメディアタイプ入力を、index.cnxml内に挿入してください。画像ファイルは同じ名前を持たなくてはなりません。例えば"image1.png"(オンライン)であれば、"image1.eps"(印刷)となります。
eps画像ファイルをモジュールに追加してください。
<figure id='printimage'>
<media type='application/postscript' src='image.eps'>
<media type='image/png' src='image.png'/>
</media>
</figure>
eps)の入力は、オンライン画像(png)の入力の上に現れなくてはなりません。オンライン画像の入力はインデントされ、入れ子にされていなければなりません。
メディアタイプ入力を挿入してください。
<figure id='thumbnail'>
<media type='image/png' src='TajMahal_medium.jpg'>
<param name='thumbnail' value='TajMahal_Thumb.jpg'/>
</media>
</figure>
実際の画面は以下のようになります。
図 3: Photograph of the Taj Mahal taken by Steve
Evans. It is licensed for public use under the
Creative Commons Attribution License. |
<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>
Flashは画像や動画が表示されるのと同じように、モジュール内で表示されます。
図 4: "Welcome to Connexions" example Flash object. |
figureタグ内に記述されています。figureタグは、モジュール内でこれらのメディアファイルを含めるのに必要ではありません。<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>実際の画面は以下のようになります。
図 5: The Creative Commons movie: "Building on the Past".
Click the Play button to start the movie. |
figureタグ内に記述されています。figureタグは、モジュール内でこれらのメディアファイルを含めるのに必要ではありません。
<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>
実際の画面は以下のようになります。
図 6: 3D Animation of a Complex Sinusoid. Click the Run button
to start the animation. |
figureタグ内に記述されています。figureタグは、モジュール内でこれらのメディアファイルを含めるのに必要ではありません。
<figure id='musicscale'>
<media type="audio/x-wav" src="chromatic_slurred.wav"/>
<caption>A chromatic scale performed on clarinet by Michael Lawrence.</caption>
</figure>
Audio File:
chromatic_slurred.wav 図 7: A chromatic scale performed on clarinet by Michael Lawrence. |
figureタグ内に記述されています。figureタグは、モジュール内でこれらのメディアファイルを含めるのに必要ではありません。paramタグでこの情報をマルチメディアファイルに与えることができます。このタグはmediaタグに含まれていて、mediaタグの変更を必要としません。paramタグの解説はCNXML Language Specificationを見てください。
paramタグ入力の例です。
<media type="video/mpeg" src="testmovie.mpg">
<param name="width" value="300"/>
<param name="height" value="300"/>
</media>
paramタグで、XHTMLドキュメントに挿入されたファイルのランタイム設定を指定することができます。
<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>
Comments, questions, feedback, criticisms?