<?xml version="1.0" encoding="utf-8"?>
<s1 title="HelpOnMacros/EmbedObject"><p></p>
<s2 id="EmbedObject" title="EmbedObject">
<p><p>Contents</p>
<ol><li>
<link anchor="E">EmbedObject</link><ol><li>
<link anchor="E-1">Enabling EmbedObject</link></li>
<li>
<link anchor="S">Syntax &amp; Usage</link></li>
<li>
<link anchor="E-2">Examples</link></li>
</ol>
</li>
</ol>
<p> </p>
<p>This macro is used to Embed an Object into a wiki page-- objects being things usually handled by plug-ins, such as Flash, PDF, or movies. Optional size of the object could be adjusted. Further keywords are dependent on the kind of application. </p>
<p>If the attachment file isn&apos;t uploaded yet the attachment line will be shown. </p>
<p>(!) New in 1.6: <jump href="/wiki/MoinMoin">MoinMoin</jump> has new (for some target types rather experimental) transclusion syntax like this: <code>{{target|desc|params}}</code>. </p>
<p></p>
<s3 id="Enabling EmbedObject" title="Enabling EmbedObject">
<p>EmbedObject is an included standard moin macro. However, for security reasons, mimetypes have to be specifically enabled in your wikiconfig.py to enable EmbedObject. </p>
<ol><li><p>In your wikiconfig.py file, under the &quot;Content options&quot; section, add the following lines: </p>
<source><![CDATA[    mimetypes_xss_protect = ['text/html', 'application/x-shockwave-flash', 'application/xhtml+xml',] 

    mimetypes_embed = ['application/x-dvi', 'application/postscript', 'application/pdf', 'application/ogg', 'application/vnd.visio', 'image/x-ms-bmp', 'image/svg+xml', 'image/tiff', 'image/x-photoshop', 'audio/mpeg', 'audio/midi', 'audio/x-wav', 'video/fli', 'video/mpeg', 'video/quicktime', 'video/x-msvideo', 'chemical/x-pdb', 'x-world/x-vrml',] ]]></source></li>
<li><p>You should specifically add and/or remove content types from the <code>mimetypes_embed</code> to only those you need to use on your site. For example, if you need Flash, move the <code>&apos;application/x-shockwave-flash&apos;</code> from the <code>mimetypes_xss_protect</code> to the <code>mimetypes_embed</code> line. </p>
</li>
</ol>
<p><em>see related: <jump href="/wiki/HelpOnConfiguration">HelpOnConfiguration</jump> </em> </p>
<p><strong>supported mimetypes:</strong> </p>
<ul><li>application/x-shockwave-flash </li>
<li>application/x-dvi </li>
<li>application/postscript </li>
<li>application/pdf </li>
<li>application/ogg </li>
<li>application/vnd.visio  </li>
<li>image/x-ms-bmp </li>
<li>image/svg+xml </li>
<li>image/tiff </li>
<li>image/x-photoshop </li>
<li>audio/mpeg </li>
<li>audio/midi </li>
<li>audio/x-wav </li>
<li>video/fli </li>
<li>video/mpeg </li>
<li>video/quicktime </li>
<li>video/x-msvideo </li>
<li>chemical/x-pdb </li>
<li>x-world/x-vrml   </li>
</ul>
<p></p>
</s3>
<s3 id="Syntax & Usage" title="Syntax &amp; Usage">
<p></p>
<source><![CDATA[<<EmbedObject(attachment[,option][,option])>>]]></source><p><strong>Keyword Parameters:</strong> </p>
<p>Dependent on the mimetype class a different set of keywords is used from the defaults: </p>
<p></p>
<source><![CDATA[  width = None, float
  height = None, float
  pagename = None, unicode
  align = middle
  alt = ''
  play = False
  loop = False
  quality = high
  op = True
  repeat = False
  autostart = False
  menu = True
  hidden = False]]></source><p>All mimetypes support width &amp; height parameters. </p>
<p>(!) Since 1.7 <jump href="/wiki/MoinMoin">MoinMoin</jump> supports parsing of units. Known units for the parameter width and height are px, em, pt, in, mm and %. </p>
<p>If you don&apos;t give a unit the default of px will be used. </p>
<p>Additionally: </p>
<ul><li><p><code>&apos;video&apos;</code> supports  <code> repeat, autostart, menu, op </code> </p>
</li>
<li><p><code>&apos;audio&apos;</code> supports  <code> play, repeat, autostart, op, hidden </code> </p>
<ul><li>the default width is 60 and default height is 20 </li>
</ul>
</li>
<li><p><code>&apos;application&apos;</code> supports <code>play, menu, autostart </code> </p>
</li>
</ul>
<p></p>
</s3>
<s3 id="Examples" title="Examples">
<p>Basic examples: </p>
<source><![CDATA[<<EmbedObject(example.swf)>>
<<EmbedObject(example.pdf)>>
<<EmbedObject(example.svg)>>]]></source><p>Realistic examples: </p>
<source><![CDATA[<<EmbedObject(testpdf.pdf,width=100%,height=600px)>>
<<EmbedObject(example.swf,width=637px,height=392px,play=true,loop=true)>>]]></source></s3></s2></s1>