Xml Markup Of Videos
<h3 class="heading-h6"><a name="THLToolboxhomegtDevelopersZonegtWebDevelopmentgtXmlMarkupinTHLgtXMLMarkupOfVideos" class="anchorpoint"></a><a href="/tools/wiki/home.html">THL Toolbox</a> > <a href="/tools/wiki/Developers%27%20Zone.html">Developers' Zone</a> > <a href="/tools/wiki/Web%20Development.html">Web Development</a> > <a href="/tools/wiki/Xml%20Markup%20in%20THL.html">Xml Markup in THL</a> > XML Markup Of Videos</h3><p class="paragraph">
</p><h3 class="heading-h1"><a name="XMLMarkupofVideos" class="anchorpoint"></a>XML Markup of Videos</h3><p class="paragraph">
Videos are marked up using the <figure> element with its "rend" attribute set to "movie". The "entity" attribute is set to the name of the entity, declared at the top of the document, referencing the movie file. If there is a small and larger version of the same video, the smaller version is encoded first, followed by the encoding for the larger version, and the "corresp" attribute on the smaller version is set to the "id" attribute value of the larger version. The <figure> element contains a <figureDesc> element with the caption for the image. However, the <figureDesc> element may also contain some hidden <rs> elements defining the size of the picture. These elements are empty elements (that is, they contain no text between the opening and closing tags) with their "rend" attribute set to "none"; their "type" attribute set to either "height" or "width", and their "n" attribute set to the numeric value for the height and width respectively. This n-value should be purely numeric and <strong class="bold">not</strong> have a suffix such as "px", "in" or the like.</p><p class="paragraph">An example of the first video mark-up is found in Mona Schremp’s article in the second issue of JIATS on “<span class="nobr"><img src="/" alt="external link: " title="external link"/><a href="http://www.thlib.org/collections/texts/jiats/index.php#jiats=/02/schrempf/c1/" target="rwikiexternal">Hwa shang at the Border</a></span>” as the first back section. The mark-up looks like this:</p><div class="code"><pre><div1 id=<span class="java-quote">"c1"</span> n=<span class="java-quote">"video"</span>>
  <milestone unit=<span class="java-quote">"page"</span>/>
  <head>Video of a Ritual Dance</head>
  <p>

    <-- Small Version of Movie -->
    <figure entity=<span class="java-quote">"mov01"</span> corresp=<span class="java-quote">"mv1lg"</span> rend=<span class="java-quote">"movie"</span>>
      <figDesc>
        <persName corresp=<span class="java-quote">"entry1"</span> n=<span class="java-quote">"Hashang"</span> lang=<span class="java-quote">"tib"</span>>hwa shang</persName> Ritual Dance
        <rs type=<span class="java-quote">"height"</span> n=<span class="java-quote">"275"</span> rend=<span class="java-quote">"none"</span>/>
        <rs type=<span class="java-quote">"width"</span> n=<span class="java-quote">"350"</span> rend=<span class="java-quote">"none"</span>/>
      </figDesc>
    </figure>

    <-- Large Version of Movie -->
    <figure entity=<span class="java-quote">"mov01lg"</span> rend=<span class="java-quote">"movie large"</span> id=<span class="java-quote">"mv1lg"</span>>
      <figDesc>
        <persName corresp=<span class="java-quote">"entry1"</span> n=<span class="java-quote">"Hashang"</span> lang=<span class="java-quote">"tib"</span>>hwa shang</persName> Ritual Dance
        <rs type=<span class="java-quote">"height"</span> n=<span class="java-quote">"500"</span> rend=<span class="java-quote">"none"</span>/>
        <rs type=<span class="java-quote">"width"</span> n=<span class="java-quote">"650"</span> rend=<span class="java-quote">"none"</span>/>
      </figDesc>
    </figure>

  </p>
</div1></pre></div><p class="paragraph"><span style="color: red;"><strong class="bold">Note</strong>: The javascript for switching between smaller and larger versions of videos has to date (Oct 28, 2008) only been implemented for JIATS articles, because there is as yet no working example of a video (other than a panorama) embedded in a THL essay that is delivered through XML.</span>
</p><h3 class="heading-h4"><a name="VideosinLinksPopups" class="anchorpoint"></a>Videos in Links (Popups)</h3><p class="paragraph">To get a video to display as a popup pane with the video in it. The video should be marked up in an <xref> element as a regular link. The Javascript will search for any link with an href attribute that has the ".mp4" extension and create a special video popup for it. As with other links, the video-link should be declared at the top of the XML document as an entity. The URL for the video should be the full, absolute url to its location on www.thlib.org.</p><p class="paragraph">To specify the width and height of the movie, append a search string (i.e. a question mark followed by parameters) defining the parameters w (for width) and h (for height), separated by the ampersand. This search string would thus have a format of</p><div class="code"><pre><img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://www.thdl.org/…path" target="rwikiexternal">http://www.thdl.org/…path</a></span> to movie…/movie.mp4?w=300&h=200</pre></div><p class="paragraph">An example can be found in <span class="nobr"><img src="/" alt="external link: " title="external link"/><a href="http://www.thlib.org/places/monasteries/sera/essays/#essay=/cabezon/sera/colleges/intro/s/b24" target="rwikiexternal">The Mé College section of “An Introduction to Sera’s Colleges”</a></span>.</p><p class="paragraph">The entity in that document is marked up as follows:</p><div class="code"><pre><!ENTITY mov1 SYSTEM <span class="java-quote">"http://www.thlib.org/places/monasteries/sera/essays/images/01044_sera_mgon.mp4?w=320&h=256"</span> NDATA MP4></pre></div><p class="paragraph">Below in the text the link is then marked up thus:</p><div class="code"><pre><xref doc=<span class="java-quote">"mov1"</span> type=<span class="java-quote">"mp4"</span>>View a video of the Taok Chapel</xref></pre></div><p class="paragraph">The javascript will automatically insert the proper HTML markup to display the movie, when the link is clicked.
</p><h3 class="heading-h6"><a name="ProvidedforunrestrictedusebythespanclassnobrimgsrcsakairwikitoolimagesicklearrowgifaltexternallinktitleexternallinkahrefhttpwwwthliborgtargetrwikiexternalTibetanandHimalayanLibraryaspan" class="anchorpoint"></a><em class="italic">Provided for unrestricted use by the <span class="nobr"><img src="/" alt="external link: " title="external link"/><a href="http://www.thlib.org" target="rwikiexternal">Tibetan and Himalayan Library</a></span></em></h3><p class="paragraph">
</p><h3 class="heading-h6"><a name="ProvidedforunrestrictedusebythespanclassnobrimgsrcsakairwikitoolimagesicklearrowgifaltexternallinktitleexternallinkahrefhttpwwwthliborgtargetrwikiexternalTibetanandHimalayanLibraryaspan" class="anchorpoint"></a><em class="italic">Provided for unrestricted use by the <span class="nobr"><img src="/" alt="external link: " title="external link"/><a href="http://www.thlib.org" target="rwikiexternal">Tibetan and Himalayan Library</a></span></em></h3>