]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#316] subtitle documentation for language attributes
authorScottDowne <sdowne@learn.senecac.on.ca>
Thu, 3 Mar 2011 16:59:24 +0000 (11:59 -0500)
committerScottDowne <sdowne@learn.senecac.on.ca>
Thu, 3 Mar 2011 16:59:24 +0000 (11:59 -0500)
plugins/subtitle/popcorn.subtitle.js

index 21fdb27b737d9e6c0f93e709b5f2954781925a8e..e20e2a88b7cd395a7b93ee2cadc4db6af827a667 100644 (file)
    * Target is the id of the document element that the content is
    *  appended to, this target element must exist on the DOM
    * Text is the text of the subtitle you want to display.
+   *
+   * Language is the expected language the subtitle text is in
+   * Languagesrc is the target id of the element that contains 
+   *  the language value ("en", "fr", etc.) to translate the text into
+   *  example:
+   *  <select id="language">
+   *    <option value="zh" selected="selected">Chinese</option>
+   *    <option value="en">English</option>
+   *    <option value="fr">French</option>
+   *    <option value="de">German</option>
+   *    <option value="it">Italian</option>
+   *    <option value="ja">Japanese</option>
+   *    <option value="ko">Korean</option>
+   *    <option value="fa">Persian</option>
+   *    <option value="pl">Polish</option>
+   *    <option value="pt">Portuguese</option>
+   *    <option value="es">Spanish</option>
+   *  </select>
+   * Accessibilitysrc is the target id of a checkbox element
+   *  checked means show all subtitles regardless of language and languagesrc
+   *  not checked means only translate if language and languagesrc are different
+   *  if no accessibilitysrc exists, default is to display all subtitles regardless
    * 
    * @param {Object} options
    * 
    * Example:
      var p = Popcorn('#video')
         .footnote({
-          start:          5,                 // seconds, mandatory
-          end:            15,                // seconds, mandatory
-          text:           'Hellow world',    // optional
-          target:         'subtitlediv'      // optional
+          start:            5,                 // seconds, mandatory
+          end:              15,                // seconds, mandatory
+          text:             'Hellow world',    // optional
+          target:           'subtitlediv',     // optional
+          language:         'en',              // optional
+          languagesrc:      'language',        // optional
+          accessibilitysrc: 'accessibility'    // optional
         } )
    *
    */