pul_uv_rails 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (588) hide show
  1. checksums.yaml +7 -0
  2. data/.bowerrc +3 -0
  3. data/.gitignore +9 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +5 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE +202 -0
  8. data/README.md +44 -0
  9. data/Rakefile +6 -0
  10. data/bower.json +27 -0
  11. data/lib/pul_uv_rails.rb +12 -0
  12. data/lib/pul_uv_rails/universal_viewer.rb +34 -0
  13. data/lib/pul_uv_rails/version.rb +3 -0
  14. data/public/universalviewer/.bower.json +32 -0
  15. data/public/universalviewer/.bowerrc +6 -0
  16. data/public/universalviewer/.gitattributes +4 -0
  17. data/public/universalviewer/.gitignore +88 -0
  18. data/public/universalviewer/.gitmodules +6 -0
  19. data/public/universalviewer/.npmignore +19 -0
  20. data/public/universalviewer/.travis.yml +21 -0
  21. data/public/universalviewer/.vscode/settings.json +13 -0
  22. data/public/universalviewer/.vscode/tasks.json +25 -0
  23. data/public/universalviewer/CHANGELOG.md +11 -0
  24. data/public/universalviewer/Gruntfile.js +490 -0
  25. data/public/universalviewer/LICENSE.txt +16 -0
  26. data/public/universalviewer/README.md +98 -0
  27. data/public/universalviewer/app.build.js +14 -0
  28. data/public/universalviewer/bower.json +23 -0
  29. data/public/universalviewer/config.js +56 -0
  30. data/public/universalviewer/dist/uv-2.0.1/app.html +61 -0
  31. data/public/universalviewer/dist/uv-2.0.1/html/uv-pdfcenterpanel-module/viewer.html +363 -0
  32. data/public/universalviewer/dist/uv-2.0.1/l10n/ach/chrome.properties +18 -0
  33. data/public/universalviewer/dist/uv-2.0.1/l10n/ach/viewer.properties +97 -0
  34. data/public/universalviewer/dist/uv-2.0.1/l10n/af/chrome.properties +18 -0
  35. data/public/universalviewer/dist/uv-2.0.1/l10n/af/viewer.properties +140 -0
  36. data/public/universalviewer/dist/uv-2.0.1/l10n/ak/chrome.properties +18 -0
  37. data/public/universalviewer/dist/uv-2.0.1/l10n/ak/viewer.properties +123 -0
  38. data/public/universalviewer/dist/uv-2.0.1/l10n/an/chrome.properties +19 -0
  39. data/public/universalviewer/dist/uv-2.0.1/l10n/an/viewer.properties +161 -0
  40. data/public/universalviewer/dist/uv-2.0.1/l10n/ar/chrome.properties +19 -0
  41. data/public/universalviewer/dist/uv-2.0.1/l10n/ar/viewer.properties +161 -0
  42. data/public/universalviewer/dist/uv-2.0.1/l10n/as/chrome.properties +19 -0
  43. data/public/universalviewer/dist/uv-2.0.1/l10n/as/viewer.properties +161 -0
  44. data/public/universalviewer/dist/uv-2.0.1/l10n/ast/chrome.properties +7 -0
  45. data/public/universalviewer/dist/uv-2.0.1/l10n/ast/viewer.properties +73 -0
  46. data/public/universalviewer/dist/uv-2.0.1/l10n/az/chrome.properties +18 -0
  47. data/public/universalviewer/dist/uv-2.0.1/l10n/az/viewer.properties +139 -0
  48. data/public/universalviewer/dist/uv-2.0.1/l10n/be/chrome.properties +4 -0
  49. data/public/universalviewer/dist/uv-2.0.1/l10n/be/viewer.properties +103 -0
  50. data/public/universalviewer/dist/uv-2.0.1/l10n/bg/chrome.properties +18 -0
  51. data/public/universalviewer/dist/uv-2.0.1/l10n/bg/viewer.properties +124 -0
  52. data/public/universalviewer/dist/uv-2.0.1/l10n/bn-BD/chrome.properties +18 -0
  53. data/public/universalviewer/dist/uv-2.0.1/l10n/bn-BD/viewer.properties +139 -0
  54. data/public/universalviewer/dist/uv-2.0.1/l10n/bn-IN/chrome.properties +18 -0
  55. data/public/universalviewer/dist/uv-2.0.1/l10n/bn-IN/viewer.properties +139 -0
  56. data/public/universalviewer/dist/uv-2.0.1/l10n/br/chrome.properties +19 -0
  57. data/public/universalviewer/dist/uv-2.0.1/l10n/br/viewer.properties +161 -0
  58. data/public/universalviewer/dist/uv-2.0.1/l10n/bs/chrome.properties +8 -0
  59. data/public/universalviewer/dist/uv-2.0.1/l10n/bs/viewer.properties +125 -0
  60. data/public/universalviewer/dist/uv-2.0.1/l10n/ca/chrome.properties +19 -0
  61. data/public/universalviewer/dist/uv-2.0.1/l10n/ca/viewer.properties +161 -0
  62. data/public/universalviewer/dist/uv-2.0.1/l10n/cs/chrome.properties +19 -0
  63. data/public/universalviewer/dist/uv-2.0.1/l10n/cs/viewer.properties +161 -0
  64. data/public/universalviewer/dist/uv-2.0.1/l10n/csb/chrome.properties +8 -0
  65. data/public/universalviewer/dist/uv-2.0.1/l10n/csb/viewer.properties +134 -0
  66. data/public/universalviewer/dist/uv-2.0.1/l10n/cy/chrome.properties +19 -0
  67. data/public/universalviewer/dist/uv-2.0.1/l10n/cy/viewer.properties +161 -0
  68. data/public/universalviewer/dist/uv-2.0.1/l10n/da/chrome.properties +9 -0
  69. data/public/universalviewer/dist/uv-2.0.1/l10n/da/viewer.properties +161 -0
  70. data/public/universalviewer/dist/uv-2.0.1/l10n/de/chrome.properties +19 -0
  71. data/public/universalviewer/dist/uv-2.0.1/l10n/de/viewer.properties +161 -0
  72. data/public/universalviewer/dist/uv-2.0.1/l10n/el/chrome.properties +9 -0
  73. data/public/universalviewer/dist/uv-2.0.1/l10n/el/viewer.properties +131 -0
  74. data/public/universalviewer/dist/uv-2.0.1/l10n/en-GB/chrome.properties +19 -0
  75. data/public/universalviewer/dist/uv-2.0.1/l10n/en-GB/viewer.properties +161 -0
  76. data/public/universalviewer/dist/uv-2.0.1/l10n/en-US/chrome.properties +19 -0
  77. data/public/universalviewer/dist/uv-2.0.1/l10n/en-US/viewer.properties +161 -0
  78. data/public/universalviewer/dist/uv-2.0.1/l10n/en-ZA/chrome.properties +19 -0
  79. data/public/universalviewer/dist/uv-2.0.1/l10n/en-ZA/viewer.properties +161 -0
  80. data/public/universalviewer/dist/uv-2.0.1/l10n/eo/chrome.properties +19 -0
  81. data/public/universalviewer/dist/uv-2.0.1/l10n/eo/viewer.properties +161 -0
  82. data/public/universalviewer/dist/uv-2.0.1/l10n/es-AR/chrome.properties +19 -0
  83. data/public/universalviewer/dist/uv-2.0.1/l10n/es-AR/viewer.properties +167 -0
  84. data/public/universalviewer/dist/uv-2.0.1/l10n/es-CL/chrome.properties +19 -0
  85. data/public/universalviewer/dist/uv-2.0.1/l10n/es-CL/viewer.properties +126 -0
  86. data/public/universalviewer/dist/uv-2.0.1/l10n/es-ES/chrome.properties +8 -0
  87. data/public/universalviewer/dist/uv-2.0.1/l10n/es-ES/viewer.properties +107 -0
  88. data/public/universalviewer/dist/uv-2.0.1/l10n/es-MX/chrome.properties +19 -0
  89. data/public/universalviewer/dist/uv-2.0.1/l10n/es-MX/viewer.properties +161 -0
  90. data/public/universalviewer/dist/uv-2.0.1/l10n/et/chrome.properties +19 -0
  91. data/public/universalviewer/dist/uv-2.0.1/l10n/et/viewer.properties +161 -0
  92. data/public/universalviewer/dist/uv-2.0.1/l10n/eu/chrome.properties +18 -0
  93. data/public/universalviewer/dist/uv-2.0.1/l10n/eu/viewer.properties +136 -0
  94. data/public/universalviewer/dist/uv-2.0.1/l10n/fa/chrome.properties +18 -0
  95. data/public/universalviewer/dist/uv-2.0.1/l10n/fa/viewer.properties +102 -0
  96. data/public/universalviewer/dist/uv-2.0.1/l10n/ff/chrome.properties +18 -0
  97. data/public/universalviewer/dist/uv-2.0.1/l10n/ff/viewer.properties +123 -0
  98. data/public/universalviewer/dist/uv-2.0.1/l10n/fi/chrome.properties +19 -0
  99. data/public/universalviewer/dist/uv-2.0.1/l10n/fi/viewer.properties +161 -0
  100. data/public/universalviewer/dist/uv-2.0.1/l10n/fr/chrome.properties +18 -0
  101. data/public/universalviewer/dist/uv-2.0.1/l10n/fr/viewer.properties +161 -0
  102. data/public/universalviewer/dist/uv-2.0.1/l10n/fy-NL/chrome.properties +9 -0
  103. data/public/universalviewer/dist/uv-2.0.1/l10n/fy-NL/viewer.properties +167 -0
  104. data/public/universalviewer/dist/uv-2.0.1/l10n/ga-IE/chrome.properties +19 -0
  105. data/public/universalviewer/dist/uv-2.0.1/l10n/ga-IE/viewer.properties +161 -0
  106. data/public/universalviewer/dist/uv-2.0.1/l10n/gd/chrome.properties +19 -0
  107. data/public/universalviewer/dist/uv-2.0.1/l10n/gd/viewer.properties +161 -0
  108. data/public/universalviewer/dist/uv-2.0.1/l10n/gl/chrome.properties +8 -0
  109. data/public/universalviewer/dist/uv-2.0.1/l10n/gl/viewer.properties +124 -0
  110. data/public/universalviewer/dist/uv-2.0.1/l10n/gu-IN/chrome.properties +10 -0
  111. data/public/universalviewer/dist/uv-2.0.1/l10n/gu-IN/viewer.properties +108 -0
  112. data/public/universalviewer/dist/uv-2.0.1/l10n/he/chrome.properties +20 -0
  113. data/public/universalviewer/dist/uv-2.0.1/l10n/he/viewer.properties +150 -0
  114. data/public/universalviewer/dist/uv-2.0.1/l10n/hi-IN/chrome.properties +18 -0
  115. data/public/universalviewer/dist/uv-2.0.1/l10n/hi-IN/viewer.properties +136 -0
  116. data/public/universalviewer/dist/uv-2.0.1/l10n/hr/chrome.properties +18 -0
  117. data/public/universalviewer/dist/uv-2.0.1/l10n/hr/viewer.properties +139 -0
  118. data/public/universalviewer/dist/uv-2.0.1/l10n/hu/chrome.properties +19 -0
  119. data/public/universalviewer/dist/uv-2.0.1/l10n/hu/viewer.properties +161 -0
  120. data/public/universalviewer/dist/uv-2.0.1/l10n/hy-AM/chrome.properties +19 -0
  121. data/public/universalviewer/dist/uv-2.0.1/l10n/hy-AM/viewer.properties +161 -0
  122. data/public/universalviewer/dist/uv-2.0.1/l10n/id/chrome.properties +19 -0
  123. data/public/universalviewer/dist/uv-2.0.1/l10n/id/viewer.properties +167 -0
  124. data/public/universalviewer/dist/uv-2.0.1/l10n/is/chrome.properties +19 -0
  125. data/public/universalviewer/dist/uv-2.0.1/l10n/is/viewer.properties +161 -0
  126. data/public/universalviewer/dist/uv-2.0.1/l10n/it/chrome.properties +8 -0
  127. data/public/universalviewer/dist/uv-2.0.1/l10n/it/viewer.properties +107 -0
  128. data/public/universalviewer/dist/uv-2.0.1/l10n/ja/chrome.properties +19 -0
  129. data/public/universalviewer/dist/uv-2.0.1/l10n/ja/viewer.properties +161 -0
  130. data/public/universalviewer/dist/uv-2.0.1/l10n/ka/chrome.properties +18 -0
  131. data/public/universalviewer/dist/uv-2.0.1/l10n/ka/viewer.properties +124 -0
  132. data/public/universalviewer/dist/uv-2.0.1/l10n/kk/chrome.properties +19 -0
  133. data/public/universalviewer/dist/uv-2.0.1/l10n/kk/viewer.properties +161 -0
  134. data/public/universalviewer/dist/uv-2.0.1/l10n/km/chrome.properties +19 -0
  135. data/public/universalviewer/dist/uv-2.0.1/l10n/km/viewer.properties +161 -0
  136. data/public/universalviewer/dist/uv-2.0.1/l10n/kn/chrome.properties +18 -0
  137. data/public/universalviewer/dist/uv-2.0.1/l10n/kn/viewer.properties +123 -0
  138. data/public/universalviewer/dist/uv-2.0.1/l10n/ko/chrome.properties +19 -0
  139. data/public/universalviewer/dist/uv-2.0.1/l10n/ko/viewer.properties +161 -0
  140. data/public/universalviewer/dist/uv-2.0.1/l10n/ku/chrome.properties +18 -0
  141. data/public/universalviewer/dist/uv-2.0.1/l10n/ku/viewer.properties +136 -0
  142. data/public/universalviewer/dist/uv-2.0.1/l10n/lg/chrome.properties +18 -0
  143. data/public/universalviewer/dist/uv-2.0.1/l10n/lg/viewer.properties +100 -0
  144. data/public/universalviewer/dist/uv-2.0.1/l10n/lij/chrome.properties +7 -0
  145. data/public/universalviewer/dist/uv-2.0.1/l10n/lij/viewer.properties +94 -0
  146. data/public/universalviewer/dist/uv-2.0.1/l10n/locale.properties +312 -0
  147. data/public/universalviewer/dist/uv-2.0.1/l10n/lt/chrome.properties +19 -0
  148. data/public/universalviewer/dist/uv-2.0.1/l10n/lt/viewer.properties +161 -0
  149. data/public/universalviewer/dist/uv-2.0.1/l10n/lv/chrome.properties +9 -0
  150. data/public/universalviewer/dist/uv-2.0.1/l10n/lv/viewer.properties +157 -0
  151. data/public/universalviewer/dist/uv-2.0.1/l10n/mai/chrome.properties +18 -0
  152. data/public/universalviewer/dist/uv-2.0.1/l10n/mai/viewer.properties +123 -0
  153. data/public/universalviewer/dist/uv-2.0.1/l10n/mk/chrome.properties +9 -0
  154. data/public/universalviewer/dist/uv-2.0.1/l10n/mk/viewer.properties +126 -0
  155. data/public/universalviewer/dist/uv-2.0.1/l10n/ml/chrome.properties +18 -0
  156. data/public/universalviewer/dist/uv-2.0.1/l10n/ml/viewer.properties +136 -0
  157. data/public/universalviewer/dist/uv-2.0.1/l10n/mn/chrome.properties +15 -0
  158. data/public/universalviewer/dist/uv-2.0.1/l10n/mn/viewer.properties +65 -0
  159. data/public/universalviewer/dist/uv-2.0.1/l10n/mr/chrome.properties +18 -0
  160. data/public/universalviewer/dist/uv-2.0.1/l10n/mr/viewer.properties +119 -0
  161. data/public/universalviewer/dist/uv-2.0.1/l10n/ms/chrome.properties +19 -0
  162. data/public/universalviewer/dist/uv-2.0.1/l10n/ms/viewer.properties +161 -0
  163. data/public/universalviewer/dist/uv-2.0.1/l10n/my/chrome.properties +18 -0
  164. data/public/universalviewer/dist/uv-2.0.1/l10n/my/viewer.properties +123 -0
  165. data/public/universalviewer/dist/uv-2.0.1/l10n/nb-NO/chrome.properties +19 -0
  166. data/public/universalviewer/dist/uv-2.0.1/l10n/nb-NO/viewer.properties +161 -0
  167. data/public/universalviewer/dist/uv-2.0.1/l10n/nl/chrome.properties +19 -0
  168. data/public/universalviewer/dist/uv-2.0.1/l10n/nl/viewer.properties +161 -0
  169. data/public/universalviewer/dist/uv-2.0.1/l10n/nn-NO/chrome.properties +8 -0
  170. data/public/universalviewer/dist/uv-2.0.1/l10n/nn-NO/viewer.properties +136 -0
  171. data/public/universalviewer/dist/uv-2.0.1/l10n/nso/chrome.properties +18 -0
  172. data/public/universalviewer/dist/uv-2.0.1/l10n/nso/viewer.properties +123 -0
  173. data/public/universalviewer/dist/uv-2.0.1/l10n/oc/chrome.properties +19 -0
  174. data/public/universalviewer/dist/uv-2.0.1/l10n/oc/viewer.properties +161 -0
  175. data/public/universalviewer/dist/uv-2.0.1/l10n/or/chrome.properties +18 -0
  176. data/public/universalviewer/dist/uv-2.0.1/l10n/or/viewer.properties +139 -0
  177. data/public/universalviewer/dist/uv-2.0.1/l10n/pa-IN/chrome.properties +10 -0
  178. data/public/universalviewer/dist/uv-2.0.1/l10n/pa-IN/viewer.properties +175 -0
  179. data/public/universalviewer/dist/uv-2.0.1/l10n/pl/chrome.properties +9 -0
  180. data/public/universalviewer/dist/uv-2.0.1/l10n/pl/viewer.properties +149 -0
  181. data/public/universalviewer/dist/uv-2.0.1/l10n/pt-BR/chrome.properties +19 -0
  182. data/public/universalviewer/dist/uv-2.0.1/l10n/pt-BR/viewer.properties +161 -0
  183. data/public/universalviewer/dist/uv-2.0.1/l10n/pt-PT/chrome.properties +19 -0
  184. data/public/universalviewer/dist/uv-2.0.1/l10n/pt-PT/viewer.properties +166 -0
  185. data/public/universalviewer/dist/uv-2.0.1/l10n/rm/chrome.properties +8 -0
  186. data/public/universalviewer/dist/uv-2.0.1/l10n/rm/viewer.properties +127 -0
  187. data/public/universalviewer/dist/uv-2.0.1/l10n/ro/chrome.properties +27 -0
  188. data/public/universalviewer/dist/uv-2.0.1/l10n/ro/viewer.properties +156 -0
  189. data/public/universalviewer/dist/uv-2.0.1/l10n/ru/chrome.properties +8 -0
  190. data/public/universalviewer/dist/uv-2.0.1/l10n/ru/viewer.properties +107 -0
  191. data/public/universalviewer/dist/uv-2.0.1/l10n/rw/chrome.properties +18 -0
  192. data/public/universalviewer/dist/uv-2.0.1/l10n/rw/viewer.properties +123 -0
  193. data/public/universalviewer/dist/uv-2.0.1/l10n/sah/chrome.properties +18 -0
  194. data/public/universalviewer/dist/uv-2.0.1/l10n/sah/viewer.properties +122 -0
  195. data/public/universalviewer/dist/uv-2.0.1/l10n/si/chrome.properties +17 -0
  196. data/public/universalviewer/dist/uv-2.0.1/l10n/si/viewer.properties +98 -0
  197. data/public/universalviewer/dist/uv-2.0.1/l10n/sk/chrome.properties +19 -0
  198. data/public/universalviewer/dist/uv-2.0.1/l10n/sk/viewer.properties +161 -0
  199. data/public/universalviewer/dist/uv-2.0.1/l10n/sl/chrome.properties +8 -0
  200. data/public/universalviewer/dist/uv-2.0.1/l10n/sl/viewer.properties +136 -0
  201. data/public/universalviewer/dist/uv-2.0.1/l10n/son/chrome.properties +18 -0
  202. data/public/universalviewer/dist/uv-2.0.1/l10n/son/viewer.properties +120 -0
  203. data/public/universalviewer/dist/uv-2.0.1/l10n/sq/chrome.properties +19 -0
  204. data/public/universalviewer/dist/uv-2.0.1/l10n/sq/viewer.properties +160 -0
  205. data/public/universalviewer/dist/uv-2.0.1/l10n/sr/chrome.properties +18 -0
  206. data/public/universalviewer/dist/uv-2.0.1/l10n/sr/viewer.properties +123 -0
  207. data/public/universalviewer/dist/uv-2.0.1/l10n/sv-SE/chrome.properties +19 -0
  208. data/public/universalviewer/dist/uv-2.0.1/l10n/sv-SE/viewer.properties +161 -0
  209. data/public/universalviewer/dist/uv-2.0.1/l10n/sw/chrome.properties +18 -0
  210. data/public/universalviewer/dist/uv-2.0.1/l10n/sw/viewer.properties +121 -0
  211. data/public/universalviewer/dist/uv-2.0.1/l10n/ta-LK/chrome.properties +3 -0
  212. data/public/universalviewer/dist/uv-2.0.1/l10n/ta-LK/viewer.properties +50 -0
  213. data/public/universalviewer/dist/uv-2.0.1/l10n/ta/chrome.properties +19 -0
  214. data/public/universalviewer/dist/uv-2.0.1/l10n/ta/viewer.properties +161 -0
  215. data/public/universalviewer/dist/uv-2.0.1/l10n/te/chrome.properties +18 -0
  216. data/public/universalviewer/dist/uv-2.0.1/l10n/te/viewer.properties +145 -0
  217. data/public/universalviewer/dist/uv-2.0.1/l10n/th/chrome.properties +19 -0
  218. data/public/universalviewer/dist/uv-2.0.1/l10n/th/viewer.properties +161 -0
  219. data/public/universalviewer/dist/uv-2.0.1/l10n/tl/chrome.properties +17 -0
  220. data/public/universalviewer/dist/uv-2.0.1/l10n/tl/viewer.properties +83 -0
  221. data/public/universalviewer/dist/uv-2.0.1/l10n/tn/chrome.properties +15 -0
  222. data/public/universalviewer/dist/uv-2.0.1/l10n/tn/viewer.properties +68 -0
  223. data/public/universalviewer/dist/uv-2.0.1/l10n/tr/chrome.properties +19 -0
  224. data/public/universalviewer/dist/uv-2.0.1/l10n/tr/viewer.properties +161 -0
  225. data/public/universalviewer/dist/uv-2.0.1/l10n/uk/chrome.properties +18 -0
  226. data/public/universalviewer/dist/uv-2.0.1/l10n/uk/viewer.properties +136 -0
  227. data/public/universalviewer/dist/uv-2.0.1/l10n/ur/chrome.properties +19 -0
  228. data/public/universalviewer/dist/uv-2.0.1/l10n/ur/viewer.properties +161 -0
  229. data/public/universalviewer/dist/uv-2.0.1/l10n/vi/chrome.properties +18 -0
  230. data/public/universalviewer/dist/uv-2.0.1/l10n/vi/viewer.properties +120 -0
  231. data/public/universalviewer/dist/uv-2.0.1/l10n/wo/chrome.properties +18 -0
  232. data/public/universalviewer/dist/uv-2.0.1/l10n/wo/viewer.properties +116 -0
  233. data/public/universalviewer/dist/uv-2.0.1/l10n/xh/chrome.properties +19 -0
  234. data/public/universalviewer/dist/uv-2.0.1/l10n/xh/viewer.properties +161 -0
  235. data/public/universalviewer/dist/uv-2.0.1/l10n/zh-CN/chrome.properties +19 -0
  236. data/public/universalviewer/dist/uv-2.0.1/l10n/zh-CN/viewer.properties +161 -0
  237. data/public/universalviewer/dist/uv-2.0.1/l10n/zh-TW/chrome.properties +20 -0
  238. data/public/universalviewer/dist/uv-2.0.1/l10n/zh-TW/viewer.properties +162 -0
  239. data/public/universalviewer/dist/uv-2.0.1/l10n/zu/chrome.properties +18 -0
  240. data/public/universalviewer/dist/uv-2.0.1/l10n/zu/viewer.properties +124 -0
  241. data/public/universalviewer/dist/uv-2.0.1/lib/Detector.js +67 -0
  242. data/public/universalviewer/dist/uv-2.0.1/lib/README.md +9 -0
  243. data/public/universalviewer/dist/uv-2.0.1/lib/app.js +9 -0
  244. data/public/universalviewer/dist/uv-2.0.1/lib/bundle.min.js +11 -0
  245. data/public/universalviewer/dist/uv-2.0.1/lib/compatibility.js +559 -0
  246. data/public/universalviewer/dist/uv-2.0.1/lib/embed.js +553 -0
  247. data/public/universalviewer/dist/uv-2.0.1/lib/flashmediaelement.swf +0 -0
  248. data/public/universalviewer/dist/uv-2.0.1/lib/iiif-gallery-component.js +475 -0
  249. data/public/universalviewer/dist/uv-2.0.1/lib/iiif-metadata-component.js +458 -0
  250. data/public/universalviewer/dist/uv-2.0.1/lib/iiif-tree-component.js +293 -0
  251. data/public/universalviewer/dist/uv-2.0.1/lib/l10n.js +1007 -0
  252. data/public/universalviewer/dist/uv-2.0.1/lib/mediaelement-and-player.js +4288 -0
  253. data/public/universalviewer/dist/uv-2.0.1/lib/openseadragon.min.js +15 -0
  254. data/public/universalviewer/dist/uv-2.0.1/lib/pdf.js +8568 -0
  255. data/public/universalviewer/dist/uv-2.0.1/lib/pdf.min.js +197 -0
  256. data/public/universalviewer/dist/uv-2.0.1/lib/pdf.worker.js +42400 -0
  257. data/public/universalviewer/dist/uv-2.0.1/lib/pdf.worker.min.js +891 -0
  258. data/public/universalviewer/dist/uv-2.0.1/lib/pdf_combined.js +937 -0
  259. data/public/universalviewer/dist/uv-2.0.1/lib/pdfobject.js +250 -0
  260. data/public/universalviewer/dist/uv-2.0.1/lib/stats.min.js +7 -0
  261. data/public/universalviewer/dist/uv-2.0.1/lib/three.min.js +870 -0
  262. data/public/universalviewer/dist/uv-2.0.1/lib/uv-mediaelement-extension-dependencies.js +5 -0
  263. data/public/universalviewer/dist/uv-2.0.1/lib/uv-mediaelement-extension.cy-GB.config.json +1 -0
  264. data/public/universalviewer/dist/uv-2.0.1/lib/uv-mediaelement-extension.en-GB.config.json +1 -0
  265. data/public/universalviewer/dist/uv-2.0.1/lib/uv-pdf-extension-dependencies.js +5 -0
  266. data/public/universalviewer/dist/uv-2.0.1/lib/uv-pdf-extension.cy-GB.config.json +1 -0
  267. data/public/universalviewer/dist/uv-2.0.1/lib/uv-pdf-extension.en-GB.config.json +1 -0
  268. data/public/universalviewer/dist/uv-2.0.1/lib/uv-seadragon-extension-dependencies.js +5 -0
  269. data/public/universalviewer/dist/uv-2.0.1/lib/uv-seadragon-extension.cy-GB.config.json +1 -0
  270. data/public/universalviewer/dist/uv-2.0.1/lib/uv-seadragon-extension.en-GB.config.json +1 -0
  271. data/public/universalviewer/dist/uv-2.0.1/lib/uv-virtex-extension-dependencies.js +5 -0
  272. data/public/universalviewer/dist/uv-2.0.1/lib/uv-virtex-extension.cy-GB.config.json +1 -0
  273. data/public/universalviewer/dist/uv-2.0.1/lib/uv-virtex-extension.en-GB.config.json +1 -0
  274. data/public/universalviewer/dist/uv-2.0.1/lib/viewer.js +5861 -0
  275. data/public/universalviewer/dist/uv-2.0.1/lib/viewer.min.js +178 -0
  276. data/public/universalviewer/dist/uv-2.0.1/lib/virtex.js +343 -0
  277. data/public/universalviewer/dist/uv-2.0.1/package.json +70 -0
  278. data/public/universalviewer/dist/uv-2.0.1/schema/uv-mediaelement-extension.cy-GB.schema.json +1 -0
  279. data/public/universalviewer/dist/uv-2.0.1/schema/uv-mediaelement-extension.en-GB.schema.json +1 -0
  280. data/public/universalviewer/dist/uv-2.0.1/schema/uv-pdf-extension.cy-GB.schema.json +1 -0
  281. data/public/universalviewer/dist/uv-2.0.1/schema/uv-pdf-extension.en-GB.schema.json +1 -0
  282. data/public/universalviewer/dist/uv-2.0.1/schema/uv-seadragon-extension.cy-GB.schema.json +1 -0
  283. data/public/universalviewer/dist/uv-2.0.1/schema/uv-seadragon-extension.en-GB.schema.json +1 -0
  284. data/public/universalviewer/dist/uv-2.0.1/schema/uv-virtex-extension.cy-GB.schema.json +1 -0
  285. data/public/universalviewer/dist/uv-2.0.1/schema/uv-virtex-extension.en-GB.schema.json +1 -0
  286. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/css/uv-mediaelement-extension/theme.css +3178 -0
  287. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/css/uv-pdf-extension/theme.css +4044 -0
  288. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/css/uv-seadragon-extension/theme.css +3185 -0
  289. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/css/uv-virtex-extension/theme.css +2455 -0
  290. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-contentleftpanel-module/padlock.png +0 -0
  291. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-contentleftpanel-module/thumb_placeholder.png +0 -0
  292. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-mediaelementcenterpanel-module/bigplay.png +0 -0
  293. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-mediaelementcenterpanel-module/controls-wellcome-bg.png +0 -0
  294. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-mediaelementcenterpanel-module/controls-wellcome.png +0 -0
  295. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-mediaelementcenterpanel-module/loading.gif +0 -0
  296. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-moreinforightpanel-module/copy.png +0 -0
  297. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-osdmobilefooterpanel-module/rotate_right.png +0 -0
  298. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-osdmobilefooterpanel-module/zoom_in.png +0 -0
  299. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-osdmobilefooterpanel-module/zoom_out.png +0 -0
  300. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pagingheaderpanel-module/first.png +0 -0
  301. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pagingheaderpanel-module/grid.png +0 -0
  302. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pagingheaderpanel-module/last.png +0 -0
  303. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pagingheaderpanel-module/next.png +0 -0
  304. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pagingheaderpanel-module/one_up.png +0 -0
  305. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pagingheaderpanel-module/prev.png +0 -0
  306. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pagingheaderpanel-module/settings.png +0 -0
  307. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pagingheaderpanel-module/two_up.png +0 -0
  308. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/annotation-check.svg +11 -0
  309. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/annotation-comment.svg +16 -0
  310. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/annotation-help.svg +26 -0
  311. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/annotation-insert.svg +10 -0
  312. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/annotation-key.svg +11 -0
  313. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/annotation-newparagraph.svg +11 -0
  314. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/annotation-noicon.svg +7 -0
  315. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/annotation-note.svg +42 -0
  316. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/annotation-paragraph.svg +16 -0
  317. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-next-rtl.png +0 -0
  318. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-next-rtl@2x.png +0 -0
  319. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-next.png +0 -0
  320. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-next@2x.png +0 -0
  321. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-previous-rtl.png +0 -0
  322. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-previous-rtl@2x.png +0 -0
  323. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-previous.png +0 -0
  324. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-previous@2x.png +0 -0
  325. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/grab.cur +0 -0
  326. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/grabbing.cur +0 -0
  327. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/loading-icon.gif +0 -0
  328. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/loading-small.png +0 -0
  329. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-documentProperties.png +0 -0
  330. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-documentProperties@2x.png +0 -0
  331. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-firstPage.png +0 -0
  332. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-firstPage@2x.png +0 -0
  333. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-handTool.png +0 -0
  334. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-handTool@2x.png +0 -0
  335. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-lastPage.png +0 -0
  336. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-lastPage@2x.png +0 -0
  337. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-rotateCcw.png +0 -0
  338. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-rotateCcw@2x.png +0 -0
  339. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-rotateCw.png +0 -0
  340. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-rotateCw@2x.png +0 -0
  341. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/shadow.png +0 -0
  342. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/texture.png +0 -0
  343. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-bookmark.png +0 -0
  344. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-bookmark@2x.png +0 -0
  345. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-download.png +0 -0
  346. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-download@2x.png +0 -0
  347. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-menuArrows.png +0 -0
  348. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-menuArrows@2x.png +0 -0
  349. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-openFile.png +0 -0
  350. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-openFile@2x.png +0 -0
  351. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageDown-rtl.png +0 -0
  352. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageDown-rtl@2x.png +0 -0
  353. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageDown.png +0 -0
  354. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageDown@2x.png +0 -0
  355. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageUp-rtl.png +0 -0
  356. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageUp-rtl@2x.png +0 -0
  357. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageUp.png +0 -0
  358. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageUp@2x.png +0 -0
  359. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-presentationMode.png +0 -0
  360. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-presentationMode@2x.png +0 -0
  361. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-print.png +0 -0
  362. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-print@2x.png +0 -0
  363. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-search.png +0 -0
  364. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-search@2x.png +0 -0
  365. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-secondaryToolbarToggle-rtl.png +0 -0
  366. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-secondaryToolbarToggle-rtl@2x.png +0 -0
  367. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-secondaryToolbarToggle.png +0 -0
  368. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-secondaryToolbarToggle@2x.png +0 -0
  369. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-sidebarToggle-rtl.png +0 -0
  370. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-sidebarToggle-rtl@2x.png +0 -0
  371. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-sidebarToggle.png +0 -0
  372. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-sidebarToggle@2x.png +0 -0
  373. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewAttachments.png +0 -0
  374. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewOutline-rtl.png +0 -0
  375. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewOutline-rtl@2x.png +0 -0
  376. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewOutline.png +0 -0
  377. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewOutline@2x.png +0 -0
  378. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewThumbnail.png +0 -0
  379. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewThumbnail@2x.png +0 -0
  380. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-zoomIn.png +0 -0
  381. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-zoomIn@2x.png +0 -0
  382. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-zoomOut.png +0 -0
  383. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-zoomOut@2x.png +0 -0
  384. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/down_arrow.png +0 -0
  385. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/down_arrow_disabled.png +0 -0
  386. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/home.png +0 -0
  387. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/left_arrow.png +0 -0
  388. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/left_arrow_disabled.png +0 -0
  389. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/pixel.gif +0 -0
  390. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/right_arrow.png +0 -0
  391. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/right_arrow_disabled.png +0 -0
  392. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/rotate_right.png +0 -0
  393. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/up_arrow.png +0 -0
  394. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/up_arrow_disabled.png +0 -0
  395. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/zoom_in.png +0 -0
  396. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-seadragoncenterpanel-module/zoom_out.png +0 -0
  397. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-searchfooterpanel-module/next.png +0 -0
  398. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-searchfooterpanel-module/placemarker_down.png +0 -0
  399. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-searchfooterpanel-module/placemarker_down_hover.png +0 -0
  400. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-searchfooterpanel-module/placemarker_up.png +0 -0
  401. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-searchfooterpanel-module/prev.png +0 -0
  402. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-searchfooterpanel-module/search.png +0 -0
  403. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-searchfooterpanel-module/spinner.gif +0 -0
  404. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/arrows_left.png +0 -0
  405. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/arrows_right.png +0 -0
  406. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/bookmark.png +0 -0
  407. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/close.png +0 -0
  408. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/close_attribution.png +0 -0
  409. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/close_information_box.png +0 -0
  410. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/close_message_box.png +0 -0
  411. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/copy.png +0 -0
  412. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/dialogue_arrow.png +0 -0
  413. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/download.png +0 -0
  414. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/embed.png +0 -0
  415. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/error.png +0 -0
  416. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/exit_fullscreen.png +0 -0
  417. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/feedback.png +0 -0
  418. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/fullscreen.png +0 -0
  419. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/hidden_thumb.png +0 -0
  420. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/iiif.png +0 -0
  421. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/minus.png +0 -0
  422. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/modal_bg.gif +0 -0
  423. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/moreinfo.png +0 -0
  424. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/open.png +0 -0
  425. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/plus.png +0 -0
  426. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/print.png +0 -0
  427. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/search_result.png +0 -0
  428. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/settings.png +0 -0
  429. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/share.png +0 -0
  430. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/sprite.png +0 -0
  431. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-shared-module/unavailable.png +0 -0
  432. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-virtexcenterpanel-module/zoom_in.png +0 -0
  433. data/public/universalviewer/dist/uv-2.0.1/themes/uv-cy-GB-theme/img/uv-virtexcenterpanel-module/zoom_out.png +0 -0
  434. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/css/uv-mediaelement-extension/theme.css +3172 -0
  435. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/css/uv-pdf-extension/theme.css +4035 -0
  436. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/css/uv-seadragon-extension/theme.css +3178 -0
  437. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/css/uv-virtex-extension/theme.css +2448 -0
  438. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/hamburger.png +0 -0
  439. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-contentleftpanel-module/padlock.png +0 -0
  440. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-contentleftpanel-module/thumb_placeholder.png +0 -0
  441. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-mediaelementcenterpanel-module/bigplay.png +0 -0
  442. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-mediaelementcenterpanel-module/controls-wellcome-bg.png +0 -0
  443. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-mediaelementcenterpanel-module/controls-wellcome.png +0 -0
  444. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-mediaelementcenterpanel-module/loading.gif +0 -0
  445. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-moreinforightpanel-module/copy.png +0 -0
  446. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-osdmobilefooterpanel-module/rotate_right.png +0 -0
  447. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-osdmobilefooterpanel-module/zoom_in.png +0 -0
  448. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-osdmobilefooterpanel-module/zoom_out.png +0 -0
  449. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pagingheaderpanel-module/first.png +0 -0
  450. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pagingheaderpanel-module/grid.png +0 -0
  451. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pagingheaderpanel-module/last.png +0 -0
  452. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pagingheaderpanel-module/next.png +0 -0
  453. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pagingheaderpanel-module/one_up.png +0 -0
  454. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pagingheaderpanel-module/prev.png +0 -0
  455. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pagingheaderpanel-module/settings.png +0 -0
  456. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pagingheaderpanel-module/two_up.png +0 -0
  457. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/annotation-check.svg +11 -0
  458. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/annotation-comment.svg +16 -0
  459. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/annotation-help.svg +26 -0
  460. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/annotation-insert.svg +10 -0
  461. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/annotation-key.svg +11 -0
  462. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/annotation-newparagraph.svg +11 -0
  463. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/annotation-noicon.svg +7 -0
  464. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/annotation-note.svg +42 -0
  465. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/annotation-paragraph.svg +16 -0
  466. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-next-rtl.png +0 -0
  467. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-next-rtl@2x.png +0 -0
  468. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-next.png +0 -0
  469. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-next@2x.png +0 -0
  470. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-previous-rtl.png +0 -0
  471. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-previous-rtl@2x.png +0 -0
  472. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-previous.png +0 -0
  473. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/findbarButton-previous@2x.png +0 -0
  474. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/grab.cur +0 -0
  475. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/grabbing.cur +0 -0
  476. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/loading-icon.gif +0 -0
  477. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/loading-small.png +0 -0
  478. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-documentProperties.png +0 -0
  479. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-documentProperties@2x.png +0 -0
  480. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-firstPage.png +0 -0
  481. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-firstPage@2x.png +0 -0
  482. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-handTool.png +0 -0
  483. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-handTool@2x.png +0 -0
  484. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-lastPage.png +0 -0
  485. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-lastPage@2x.png +0 -0
  486. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-rotateCcw.png +0 -0
  487. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-rotateCcw@2x.png +0 -0
  488. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-rotateCw.png +0 -0
  489. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/secondaryToolbarButton-rotateCw@2x.png +0 -0
  490. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/shadow.png +0 -0
  491. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/texture.png +0 -0
  492. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-bookmark.png +0 -0
  493. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-bookmark@2x.png +0 -0
  494. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-download.png +0 -0
  495. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-download@2x.png +0 -0
  496. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-menuArrows.png +0 -0
  497. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-menuArrows@2x.png +0 -0
  498. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-openFile.png +0 -0
  499. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-openFile@2x.png +0 -0
  500. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageDown-rtl.png +0 -0
  501. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageDown-rtl@2x.png +0 -0
  502. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageDown.png +0 -0
  503. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageDown@2x.png +0 -0
  504. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageUp-rtl.png +0 -0
  505. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageUp-rtl@2x.png +0 -0
  506. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageUp.png +0 -0
  507. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-pageUp@2x.png +0 -0
  508. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-presentationMode.png +0 -0
  509. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-presentationMode@2x.png +0 -0
  510. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-print.png +0 -0
  511. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-print@2x.png +0 -0
  512. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-search.png +0 -0
  513. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-search@2x.png +0 -0
  514. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-secondaryToolbarToggle-rtl.png +0 -0
  515. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-secondaryToolbarToggle-rtl@2x.png +0 -0
  516. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-secondaryToolbarToggle.png +0 -0
  517. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-secondaryToolbarToggle@2x.png +0 -0
  518. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-sidebarToggle-rtl.png +0 -0
  519. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-sidebarToggle-rtl@2x.png +0 -0
  520. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-sidebarToggle.png +0 -0
  521. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-sidebarToggle@2x.png +0 -0
  522. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewAttachments.png +0 -0
  523. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewOutline-rtl.png +0 -0
  524. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewOutline-rtl@2x.png +0 -0
  525. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewOutline.png +0 -0
  526. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewOutline@2x.png +0 -0
  527. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewThumbnail.png +0 -0
  528. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-viewThumbnail@2x.png +0 -0
  529. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-zoomIn.png +0 -0
  530. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-zoomIn@2x.png +0 -0
  531. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-zoomOut.png +0 -0
  532. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-pdfcenterpanel-module/toolbarButton-zoomOut@2x.png +0 -0
  533. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/down_arrow.png +0 -0
  534. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/down_arrow_disabled.png +0 -0
  535. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/home.png +0 -0
  536. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/left_arrow.png +0 -0
  537. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/left_arrow_disabled.png +0 -0
  538. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/pixel.gif +0 -0
  539. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/right_arrow.png +0 -0
  540. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/right_arrow_disabled.png +0 -0
  541. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/rotate_right.png +0 -0
  542. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/up_arrow.png +0 -0
  543. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/up_arrow_disabled.png +0 -0
  544. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/zoom_in.png +0 -0
  545. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-seadragoncenterpanel-module/zoom_out.png +0 -0
  546. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-searchfooterpanel-module/next.png +0 -0
  547. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-searchfooterpanel-module/placemarker_down.png +0 -0
  548. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-searchfooterpanel-module/placemarker_down_hover.png +0 -0
  549. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-searchfooterpanel-module/placemarker_up.png +0 -0
  550. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-searchfooterpanel-module/prev.png +0 -0
  551. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-searchfooterpanel-module/search.png +0 -0
  552. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-searchfooterpanel-module/spinner.gif +0 -0
  553. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/arrows_left.png +0 -0
  554. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/arrows_right.png +0 -0
  555. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/bookmark.png +0 -0
  556. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/close.png +0 -0
  557. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/close_attribution.png +0 -0
  558. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/close_information_box.png +0 -0
  559. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/close_message_box.png +0 -0
  560. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/copy.png +0 -0
  561. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/dialogue_arrow.png +0 -0
  562. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/download.png +0 -0
  563. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/embed.png +0 -0
  564. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/error.png +0 -0
  565. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/exit_fullscreen.png +0 -0
  566. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/feedback.png +0 -0
  567. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/fullscreen.png +0 -0
  568. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/hidden_thumb.png +0 -0
  569. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/iiif.png +0 -0
  570. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/minus.png +0 -0
  571. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/modal_bg.gif +0 -0
  572. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/moreinfo.png +0 -0
  573. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/open.png +0 -0
  574. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/plus.png +0 -0
  575. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/print.png +0 -0
  576. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/search_result.png +0 -0
  577. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/settings.png +0 -0
  578. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/share.png +0 -0
  579. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/sprite.png +0 -0
  580. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-shared-module/unavailable.png +0 -0
  581. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-virtexcenterpanel-module/zoom_in.png +0 -0
  582. data/public/universalviewer/dist/uv-2.0.1/themes/uv-en-GB-theme/img/uv-virtexcenterpanel-module/zoom_out.png +0 -0
  583. data/public/universalviewer/favicon.ico +0 -0
  584. data/public/universalviewer/gulpfile.js +13 -0
  585. data/public/universalviewer/package.json +70 -0
  586. data/public/universalviewer/typings.json +20 -0
  587. data/pul_uv_rails.gemspec +26 -0
  588. metadata +687 -0
@@ -0,0 +1,4288 @@
1
+ /*!
2
+ * MediaElement.js
3
+ * HTML5 <video> and <audio> shim and player
4
+ * http://mediaelementjs.com/
5
+ *
6
+ * Creates a JavaScript object that mimics HTML5 MediaElement API
7
+ * for browsers that don't understand HTML5 or can't play the provided codec
8
+ * Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3
9
+ *
10
+ * Copyright 2010-2012, John Dyer (http://j.hn)
11
+ * Dual licensed under the MIT or GPL Version 2 licenses.
12
+ *
13
+ */
14
+ // Namespace
15
+ var mejs = mejs || {};
16
+
17
+ // version number
18
+ mejs.version = '2.8.2';
19
+
20
+ // player number (for missing, same id attr)
21
+ mejs.meIndex = 0;
22
+
23
+ // media types accepted by plugins
24
+ mejs.plugins = {
25
+ silverlight: [
26
+ {version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
27
+ ],
28
+ flash: [
29
+ {version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg', 'video/youtube', 'video/x-youtube']}
30
+ //,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
31
+ ],
32
+ youtube: [
33
+ {version: null, types: ['video/youtube', 'video/x-youtube']}
34
+ ],
35
+ vimeo: [
36
+ {version: null, types: ['video/vimeo']}
37
+ ]
38
+ };
39
+
40
+ /*
41
+ Utility methods
42
+ */
43
+ mejs.Utility = {
44
+ encodeUrl: function(url) {
45
+ return encodeURIComponent(url); //.replace(/\?/gi,'%3F').replace(/=/gi,'%3D').replace(/&/gi,'%26');
46
+ },
47
+ escapeHTML: function(s) {
48
+ return s.toString().split('&').join('&amp;').split('<').join('&lt;').split('"').join('&quot;');
49
+ },
50
+ absolutizeUrl: function(url) {
51
+ var el = document.createElement('div');
52
+ el.innerHTML = '<a href="' + this.escapeHTML(url) + '">x</a>';
53
+ return el.firstChild.href;
54
+ },
55
+ getScriptPath: function(scriptNames) {
56
+ var
57
+ i = 0,
58
+ j,
59
+ path = '',
60
+ name = '',
61
+ script,
62
+ scripts = document.getElementsByTagName('script'),
63
+ il = scripts.length,
64
+ jl = scriptNames.length;
65
+
66
+ for (; i < il; i++) {
67
+ script = scripts[i].src;
68
+ for (j = 0; j < jl; j++) {
69
+ name = scriptNames[j];
70
+ if (script.indexOf(name) > -1) {
71
+ path = script.substring(0, script.indexOf(name));
72
+ break;
73
+ }
74
+ }
75
+ if (path !== '') {
76
+ break;
77
+ }
78
+ }
79
+ return path;
80
+ },
81
+ secondsToTimeCode: function(time, forceHours, showFrameCount, fps) {
82
+ //add framecount
83
+ if (typeof showFrameCount == 'undefined') {
84
+ showFrameCount=false;
85
+ } else if(typeof fps == 'undefined') {
86
+ fps = 25;
87
+ }
88
+
89
+ var hours = Math.floor(time / 3600) % 24,
90
+ minutes = Math.floor(time / 60) % 60,
91
+ seconds = Math.floor(time % 60),
92
+ frames = Math.floor(((time % 1)*fps).toFixed(3)),
93
+ result =
94
+ ( (forceHours || hours > 0) ? (hours < 10 ? '0' + hours : hours) + ':' : '')
95
+ + (minutes < 10 ? '0' + minutes : minutes) + ':'
96
+ + (seconds < 10 ? '0' + seconds : seconds)
97
+ + ((showFrameCount) ? ':' + (frames < 10 ? '0' + frames : frames) : '');
98
+
99
+ return result;
100
+ },
101
+
102
+ timeCodeToSeconds: function(hh_mm_ss_ff, forceHours, showFrameCount, fps){
103
+ if (typeof showFrameCount == 'undefined') {
104
+ showFrameCount=false;
105
+ } else if(typeof fps == 'undefined') {
106
+ fps = 25;
107
+ }
108
+
109
+ var tc_array = hh_mm_ss_ff.split(":"),
110
+ tc_hh = parseInt(tc_array[0], 10),
111
+ tc_mm = parseInt(tc_array[1], 10),
112
+ tc_ss = parseInt(tc_array[2], 10),
113
+ tc_ff = 0,
114
+ tc_in_seconds = 0;
115
+
116
+ if (showFrameCount) {
117
+ tc_ff = parseInt(tc_array[3])/fps;
118
+ }
119
+
120
+ tc_in_seconds = ( tc_hh * 3600 ) + ( tc_mm * 60 ) + tc_ss + tc_ff;
121
+
122
+ return tc_in_seconds;
123
+ },
124
+
125
+ /* borrowed from SWFObject: http://code.google.com/p/swfobject/source/browse/trunk/swfobject/src/swfobject.js#474 */
126
+ removeSwf: function(id) {
127
+ var obj = document.getElementById(id);
128
+ if (obj && obj.nodeName == "OBJECT") {
129
+ if (mejs.MediaFeatures.isIE) {
130
+ obj.style.display = "none";
131
+ (function(){
132
+ if (obj.readyState == 4) {
133
+ mejs.Utility.removeObjectInIE(id);
134
+ } else {
135
+ setTimeout(arguments.callee, 10);
136
+ }
137
+ })();
138
+ } else {
139
+ obj.parentNode.removeChild(obj);
140
+ }
141
+ }
142
+ },
143
+ removeObjectInIE: function(id) {
144
+ var obj = document.getElementById(id);
145
+ if (obj) {
146
+ for (var i in obj) {
147
+ if (typeof obj[i] == "function") {
148
+ obj[i] = null;
149
+ }
150
+ }
151
+ obj.parentNode.removeChild(obj);
152
+ }
153
+ }
154
+ };
155
+
156
+
157
+ // Core detector, plugins are added below
158
+ mejs.PluginDetector = {
159
+
160
+ // main public function to test a plug version number PluginDetector.hasPluginVersion('flash',[9,0,125]);
161
+ hasPluginVersion: function(plugin, v) {
162
+ var pv = this.plugins[plugin];
163
+ v[1] = v[1] || 0;
164
+ v[2] = v[2] || 0;
165
+ return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
166
+ },
167
+
168
+ // cached values
169
+ nav: window.navigator,
170
+ ua: window.navigator.userAgent.toLowerCase(),
171
+
172
+ // stored version numbers
173
+ plugins: [],
174
+
175
+ // runs detectPlugin() and stores the version number
176
+ addPlugin: function(p, pluginName, mimeType, activeX, axDetect) {
177
+ this.plugins[p] = this.detectPlugin(pluginName, mimeType, activeX, axDetect);
178
+ },
179
+
180
+ // get the version number from the mimetype (all but IE) or ActiveX (IE)
181
+ detectPlugin: function(pluginName, mimeType, activeX, axDetect) {
182
+
183
+ var version = [0,0,0],
184
+ description,
185
+ i,
186
+ ax;
187
+
188
+ // Firefox, Webkit, Opera
189
+ if (typeof(this.nav.plugins) != 'undefined' && typeof this.nav.plugins[pluginName] == 'object') {
190
+ description = this.nav.plugins[pluginName].description;
191
+ if (description && !(typeof this.nav.mimeTypes != 'undefined' && this.nav.mimeTypes[mimeType] && !this.nav.mimeTypes[mimeType].enabledPlugin)) {
192
+ version = description.replace(pluginName, '').replace(/^\s+/,'').replace(/\sr/gi,'.').split('.');
193
+ for (i=0; i<version.length; i++) {
194
+ version[i] = parseInt(version[i].match(/\d+/), 10);
195
+ }
196
+ }
197
+ // Internet Explorer / ActiveX
198
+ } else if (typeof(window.ActiveXObject) != 'undefined') {
199
+ try {
200
+ ax = new ActiveXObject(activeX);
201
+ if (ax) {
202
+ version = axDetect(ax);
203
+ }
204
+ }
205
+ catch (e) { }
206
+ }
207
+ return version;
208
+ }
209
+ };
210
+
211
+ // Add Flash detection
212
+ mejs.PluginDetector.addPlugin('flash','Shockwave Flash','application/x-shockwave-flash','ShockwaveFlash.ShockwaveFlash', function(ax) {
213
+ // adapted from SWFObject
214
+ var version = [],
215
+ d = ax.GetVariable("$version");
216
+ if (d) {
217
+ d = d.split(" ")[1].split(",");
218
+ version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
219
+ }
220
+ return version;
221
+ });
222
+
223
+ // Add Silverlight detection
224
+ mejs.PluginDetector.addPlugin('silverlight','Silverlight Plug-In','application/x-silverlight-2','AgControl.AgControl', function (ax) {
225
+ // Silverlight cannot report its version number to IE
226
+ // but it does have a isVersionSupported function, so we have to loop through it to get a version number.
227
+ // adapted from http://www.silverlightversion.com/
228
+ var v = [0,0,0,0],
229
+ loopMatch = function(ax, v, i, n) {
230
+ while(ax.isVersionSupported(v[0]+ "."+ v[1] + "." + v[2] + "." + v[3])){
231
+ v[i]+=n;
232
+ }
233
+ v[i] -= n;
234
+ };
235
+ loopMatch(ax, v, 0, 1);
236
+ loopMatch(ax, v, 1, 1);
237
+ loopMatch(ax, v, 2, 10000); // the third place in the version number is usually 5 digits (4.0.xxxxx)
238
+ loopMatch(ax, v, 2, 1000);
239
+ loopMatch(ax, v, 2, 100);
240
+ loopMatch(ax, v, 2, 10);
241
+ loopMatch(ax, v, 2, 1);
242
+ loopMatch(ax, v, 3, 1);
243
+
244
+ return v;
245
+ });
246
+ // add adobe acrobat
247
+ /*
248
+ PluginDetector.addPlugin('acrobat','Adobe Acrobat','application/pdf','AcroPDF.PDF', function (ax) {
249
+ var version = [],
250
+ d = ax.GetVersions().split(',')[0].split('=')[1].split('.');
251
+
252
+ if (d) {
253
+ version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
254
+ }
255
+ return version;
256
+ });
257
+ */
258
+ // necessary detection (fixes for <IE9)
259
+ mejs.MediaFeatures = {
260
+ init: function() {
261
+ var
262
+ t = this,
263
+ d = document,
264
+ nav = mejs.PluginDetector.nav,
265
+ ua = mejs.PluginDetector.ua.toLowerCase(),
266
+ i,
267
+ v,
268
+ html5Elements = ['source','track','audio','video'];
269
+
270
+ // detect browsers (only the ones that have some kind of quirk we need to work around)
271
+ t.isiPad = (ua.match(/ipad/i) !== null);
272
+ t.isiPhone = (ua.match(/iphone/i) !== null);
273
+ t.isiOS = t.isiPhone || t.isiPad;
274
+ t.isAndroid = (ua.match(/android/i) !== null);
275
+ t.isBustedAndroid = (ua.match(/android 2\.[12]/) !== null);
276
+ t.isIE = (nav.appName.toLowerCase().indexOf("microsoft") != -1);
277
+ t.isChrome = (ua.match(/chrome/gi) !== null);
278
+ t.isFirefox = (ua.match(/firefox/gi) !== null);
279
+ t.isWebkit = (ua.match(/webkit/gi) !== null);
280
+ t.isGecko = (ua.match(/gecko/gi) !== null) && !t.isWebkit;
281
+ t.isOpera = (ua.match(/opera/gi) !== null);
282
+ t.hasTouch = ('ontouchstart' in window);
283
+
284
+ // create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection
285
+ for (i=0; i<html5Elements.length; i++) {
286
+ v = document.createElement(html5Elements[i]);
287
+ }
288
+
289
+ t.supportsMediaTag = (typeof v.canPlayType !== 'undefined' || t.isBustedAndroid);
290
+
291
+ // detect native JavaScript fullscreen (Safari/Firefox only, Chrome still fails)
292
+
293
+ // iOS
294
+ t.hasSemiNativeFullScreen = (typeof v.webkitEnterFullscreen !== 'undefined');
295
+
296
+ // Webkit/firefox
297
+ t.hasWebkitNativeFullScreen = (typeof v.webkitRequestFullScreen !== 'undefined');
298
+ t.hasMozNativeFullScreen = (typeof v.mozRequestFullScreen !== 'undefined');
299
+
300
+ t.hasTrueNativeFullScreen = (t.hasWebkitNativeFullScreen || t.hasMozNativeFullScreen);
301
+ t.nativeFullScreenEnabled = t.hasTrueNativeFullScreen;
302
+ if (t.hasMozNativeFullScreen) {
303
+ t.nativeFullScreenEnabled = v.mozFullScreenEnabled;
304
+ }
305
+
306
+
307
+ if (this.isChrome) {
308
+ t.hasSemiNativeFullScreen = false;
309
+ }
310
+
311
+ if (t.hasTrueNativeFullScreen) {
312
+ t.fullScreenEventName = (t.hasWebkitNativeFullScreen) ? 'webkitfullscreenchange' : 'mozfullscreenchange';
313
+
314
+
315
+ t.isFullScreen = function() {
316
+ if (v.mozRequestFullScreen) {
317
+ return d.mozFullScreen;
318
+ } else if (v.webkitRequestFullScreen) {
319
+ return d.webkitIsFullScreen;
320
+ }
321
+ }
322
+
323
+ t.requestFullScreen = function(el) {
324
+
325
+ if (t.hasWebkitNativeFullScreen) {
326
+ el.webkitRequestFullScreen();
327
+ } else if (t.hasMozNativeFullScreen) {
328
+ el.mozRequestFullScreen();
329
+ }
330
+ }
331
+
332
+ t.cancelFullScreen = function() {
333
+ if (t.hasWebkitNativeFullScreen) {
334
+ document.webkitCancelFullScreen();
335
+ } else if (t.hasMozNativeFullScreen) {
336
+ document.mozCancelFullScreen();
337
+ }
338
+ }
339
+
340
+ }
341
+
342
+
343
+ // OS X 10.5 can't do this even if it says it can :(
344
+ if (t.hasSemiNativeFullScreen && ua.match(/mac os x 10_5/i)) {
345
+ t.hasNativeFullScreen = false;
346
+ t.hasSemiNativeFullScreen = false;
347
+ }
348
+
349
+ }
350
+ };
351
+ mejs.MediaFeatures.init();
352
+
353
+
354
+ /*
355
+ extension methods to <video> or <audio> object to bring it into parity with PluginMediaElement (see below)
356
+ */
357
+ mejs.HtmlMediaElement = {
358
+ pluginType: 'native',
359
+ isFullScreen: false,
360
+
361
+ setCurrentTime: function (time) {
362
+ this.currentTime = time;
363
+ },
364
+
365
+ setMuted: function (muted) {
366
+ this.muted = muted;
367
+ },
368
+
369
+ setVolume: function (volume) {
370
+ this.volume = volume;
371
+ },
372
+
373
+ // for parity with the plugin versions
374
+ stop: function () {
375
+ this.pause();
376
+ },
377
+
378
+ // This can be a url string
379
+ // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}]
380
+ setSrc: function (url) {
381
+
382
+ // Fix for IE9 which can't set .src when there are <source> elements. Awesome, right?
383
+ var
384
+ existingSources = this.getElementsByTagName('source');
385
+ while (existingSources.length > 0){
386
+ this.removeChild(existingSources[0]);
387
+ }
388
+
389
+ if (typeof url == 'string') {
390
+ this.src = url;
391
+ } else {
392
+ var i, media;
393
+
394
+ for (i=0; i<url.length; i++) {
395
+ media = url[i];
396
+ if (this.canPlayType(media.type)) {
397
+ this.src = media.src;
398
+ }
399
+ }
400
+ }
401
+ },
402
+
403
+ setVideoSize: function (width, height) {
404
+ this.width = width;
405
+ this.height = height;
406
+ }
407
+ };
408
+
409
+ /*
410
+ Mimics the <video/audio> element by calling Flash's External Interface or Silverlights [ScriptableMember]
411
+ */
412
+ mejs.PluginMediaElement = function (pluginid, pluginType, mediaUrl) {
413
+ this.id = pluginid;
414
+ this.pluginType = pluginType;
415
+ this.src = mediaUrl;
416
+ this.events = {};
417
+ };
418
+
419
+ // JavaScript values and ExternalInterface methods that match HTML5 video properties methods
420
+ // http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html
421
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html
422
+ mejs.PluginMediaElement.prototype = {
423
+
424
+ // special
425
+ pluginElement: null,
426
+ pluginType: '',
427
+ isFullScreen: false,
428
+
429
+ // not implemented :(
430
+ playbackRate: -1,
431
+ defaultPlaybackRate: -1,
432
+ seekable: [],
433
+ played: [],
434
+
435
+ // HTML5 read-only properties
436
+ paused: true,
437
+ ended: false,
438
+ seeking: false,
439
+ duration: 0,
440
+ error: null,
441
+ tagName: '',
442
+
443
+ // HTML5 get/set properties, but only set (updated by event handlers)
444
+ muted: false,
445
+ volume: 1,
446
+ currentTime: 0,
447
+
448
+ // HTML5 methods
449
+ play: function () {
450
+ if (this.pluginApi != null) {
451
+ if (this.pluginType == 'youtube') {
452
+ this.pluginApi.playVideo();
453
+ } else {
454
+ this.pluginApi.playMedia();
455
+ }
456
+ this.paused = false;
457
+ }
458
+ },
459
+ load: function () {
460
+ if (this.pluginApi != null) {
461
+ if (this.pluginType == 'youtube') {
462
+ } else {
463
+ this.pluginApi.loadMedia();
464
+ }
465
+
466
+ this.paused = false;
467
+ }
468
+ },
469
+ pause: function () {
470
+ if (this.pluginApi != null) {
471
+ if (this.pluginType == 'youtube') {
472
+ this.pluginApi.pauseVideo();
473
+ } else {
474
+ this.pluginApi.pauseMedia();
475
+ }
476
+
477
+
478
+ this.paused = true;
479
+ }
480
+ },
481
+ stop: function () {
482
+ if (this.pluginApi != null) {
483
+ if (this.pluginType == 'youtube') {
484
+ this.pluginApi.stopVideo();
485
+ } else {
486
+ this.pluginApi.stopMedia();
487
+ }
488
+ this.paused = true;
489
+ }
490
+ },
491
+ canPlayType: function(type) {
492
+ var i,
493
+ j,
494
+ pluginInfo,
495
+ pluginVersions = mejs.plugins[this.pluginType];
496
+
497
+ for (i=0; i<pluginVersions.length; i++) {
498
+ pluginInfo = pluginVersions[i];
499
+
500
+ // test if user has the correct plugin version
501
+ if (mejs.PluginDetector.hasPluginVersion(this.pluginType, pluginInfo.version)) {
502
+
503
+ // test for plugin playback types
504
+ for (j=0; j<pluginInfo.types.length; j++) {
505
+ // find plugin that can play the type
506
+ if (type == pluginInfo.types[j]) {
507
+ return true;
508
+ }
509
+ }
510
+ }
511
+ }
512
+
513
+ return false;
514
+ },
515
+
516
+ positionFullscreenButton: function(x,y,visibleAndAbove) {
517
+ if (this.pluginApi != null && this.pluginApi.positionFullscreenButton) {
518
+ this.pluginApi.positionFullscreenButton(x,y,visibleAndAbove);
519
+ }
520
+ },
521
+
522
+ hideFullscreenButton: function() {
523
+ if (this.pluginApi != null && this.pluginApi.hideFullscreenButton) {
524
+ this.pluginApi.hideFullscreenButton();
525
+ }
526
+ },
527
+
528
+
529
+ // custom methods since not all JavaScript implementations support get/set
530
+
531
+ // This can be a url string
532
+ // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}]
533
+ setSrc: function (url) {
534
+ if (typeof url == 'string') {
535
+ this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(url));
536
+ this.src = mejs.Utility.absolutizeUrl(url);
537
+ } else {
538
+ var i, media;
539
+
540
+ for (i=0; i<url.length; i++) {
541
+ media = url[i];
542
+ if (this.canPlayType(media.type)) {
543
+ this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(media.src));
544
+ this.src = mejs.Utility.absolutizeUrl(url);
545
+ }
546
+ }
547
+ }
548
+
549
+ },
550
+ setCurrentTime: function (time) {
551
+ if (this.pluginApi != null) {
552
+ if (this.pluginType == 'youtube') {
553
+ this.pluginApi.seekTo(time);
554
+ } else {
555
+ this.pluginApi.setCurrentTime(time);
556
+ }
557
+
558
+
559
+
560
+ this.currentTime = time;
561
+ }
562
+ },
563
+ setVolume: function (volume) {
564
+ if (this.pluginApi != null) {
565
+ // same on YouTube and MEjs
566
+ if (this.pluginType == 'youtube') {
567
+ this.pluginApi.setVolume(volume * 100);
568
+ } else {
569
+ this.pluginApi.setVolume(volume);
570
+ }
571
+ this.volume = volume;
572
+ }
573
+ },
574
+ setMuted: function (muted) {
575
+ if (this.pluginApi != null) {
576
+ if (this.pluginType == 'youtube') {
577
+ if (muted) {
578
+ this.pluginApi.mute();
579
+ } else {
580
+ this.pluginApi.unMute();
581
+ }
582
+ this.muted = muted;
583
+ this.dispatchEvent('volumechange');
584
+ } else {
585
+ this.pluginApi.setMuted(muted);
586
+ }
587
+ this.muted = muted;
588
+ }
589
+ },
590
+
591
+ // additional non-HTML5 methods
592
+ setVideoSize: function (width, height) {
593
+
594
+ //if (this.pluginType == 'flash' || this.pluginType == 'silverlight') {
595
+ if ( this.pluginElement.style) {
596
+ this.pluginElement.style.width = width + 'px';
597
+ this.pluginElement.style.height = height + 'px';
598
+ }
599
+ // altered by @edsilv
600
+ //if (this.pluginApi != null && this.pluginApi.setVideoSize) {
601
+ if (this.pluginApi != null) {
602
+ this.pluginApi.setVideoSize(width, height);
603
+ }
604
+ //}
605
+ },
606
+
607
+ setFullscreen: function (fullscreen) {
608
+ if (this.pluginApi != null && this.pluginApi.setFullscreen) {
609
+ this.pluginApi.setFullscreen(fullscreen);
610
+ }
611
+ },
612
+
613
+ enterFullScreen: function() {
614
+ if (this.pluginApi != null && this.pluginApi.setFullscreen) {
615
+ this.setFullscreen(true);
616
+ }
617
+ },
618
+
619
+ exitFullScreen: function() {
620
+ if (this.pluginApi != null && this.pluginApi.setFullscreen) {
621
+ this.setFullscreen(false);
622
+ }
623
+ },
624
+
625
+ // start: fake events
626
+ addEventListener: function (eventName, callback, bubble) {
627
+ this.events[eventName] = this.events[eventName] || [];
628
+ this.events[eventName].push(callback);
629
+ },
630
+ removeEventListener: function (eventName, callback) {
631
+ if (!eventName) { this.events = {}; return true; }
632
+ var callbacks = this.events[eventName];
633
+ if (!callbacks) return true;
634
+ if (!callback) { this.events[eventName] = []; return true; }
635
+ for (i = 0; i < callbacks.length; i++) {
636
+ if (callbacks[i] === callback) {
637
+ this.events[eventName].splice(i, 1);
638
+ return true;
639
+ }
640
+ }
641
+ return false;
642
+ },
643
+ dispatchEvent: function (eventName) {
644
+ var i,
645
+ args,
646
+ callbacks = this.events[eventName];
647
+
648
+ if (callbacks) {
649
+ args = Array.prototype.slice.call(arguments, 1);
650
+ for (i = 0; i < callbacks.length; i++) {
651
+ callbacks[i].apply(null, args);
652
+ }
653
+ }
654
+ },
655
+ // end: fake events
656
+
657
+ // fake DOM attribute methods
658
+ attributes: {},
659
+ hasAttribute: function(name){
660
+ return (name in this.attributes);
661
+ },
662
+ removeAttribute: function(name){
663
+ delete this.attributes[name];
664
+ },
665
+ getAttribute: function(name){
666
+ if (this.hasAttribute(name)) {
667
+ return this.attributes[name];
668
+ }
669
+ return '';
670
+ },
671
+ setAttribute: function(name, value){
672
+ this.attributes[name] = value;
673
+ },
674
+
675
+ remove: function() {
676
+ mejs.Utility.removeSwf(this.pluginElement.id);
677
+ }
678
+ };
679
+
680
+ // Handles calls from Flash/Silverlight and reports them as native <video/audio> events and properties
681
+ mejs.MediaPluginBridge = {
682
+
683
+ pluginMediaElements:{},
684
+ htmlMediaElements:{},
685
+
686
+ registerPluginElement: function (id, pluginMediaElement, htmlMediaElement) {
687
+ this.pluginMediaElements[id] = pluginMediaElement;
688
+ this.htmlMediaElements[id] = htmlMediaElement;
689
+ },
690
+
691
+ // when Flash/Silverlight is ready, it calls out to this method
692
+ initPlugin: function (id) {
693
+
694
+ var pluginMediaElement = this.pluginMediaElements[id],
695
+ htmlMediaElement = this.htmlMediaElements[id];
696
+
697
+ if (pluginMediaElement) {
698
+ // find the javascript bridge
699
+ switch (pluginMediaElement.pluginType) {
700
+ case "flash":
701
+ pluginMediaElement.pluginElement = pluginMediaElement.pluginApi = document.getElementById(id);
702
+ break;
703
+ case "silverlight":
704
+ pluginMediaElement.pluginElement = document.getElementById(pluginMediaElement.id);
705
+ pluginMediaElement.pluginApi = pluginMediaElement.pluginElement.Content.MediaElementJS;
706
+ break;
707
+ }
708
+
709
+ if (pluginMediaElement.pluginApi != null && pluginMediaElement.success) {
710
+ pluginMediaElement.success(pluginMediaElement, htmlMediaElement);
711
+ }
712
+ }
713
+ },
714
+
715
+ // receives events from Flash/Silverlight and sends them out as HTML5 media events
716
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html
717
+ fireEvent: function (id, eventName, values) {
718
+ var
719
+ e,
720
+ i,
721
+ bufferedTime,
722
+ pluginMediaElement = this.pluginMediaElements[id];
723
+
724
+ pluginMediaElement.ended = false;
725
+ pluginMediaElement.paused = true;
726
+
727
+ // fake event object to mimic real HTML media event.
728
+ e = {
729
+ type: eventName,
730
+ target: pluginMediaElement
731
+ };
732
+
733
+ // attach all values to element and event object
734
+ for (i in values) {
735
+ pluginMediaElement[i] = values[i];
736
+ e[i] = values[i];
737
+ }
738
+
739
+ // fake the newer W3C buffered TimeRange (loaded and total have been removed)
740
+ bufferedTime = values.bufferedTime || 0;
741
+
742
+ e.target.buffered = e.buffered = {
743
+ start: function(index) {
744
+ return 0;
745
+ },
746
+ end: function (index) {
747
+ return bufferedTime;
748
+ },
749
+ length: 1
750
+ };
751
+
752
+ pluginMediaElement.dispatchEvent(e.type, e);
753
+ }
754
+ };
755
+
756
+ /*
757
+ Default options
758
+ */
759
+ mejs.MediaElementDefaults = {
760
+ // allows testing on HTML5, flash, silverlight
761
+ // auto: attempts to detect what the browser can do
762
+ // native: forces HTML5 playback
763
+ // shim: disallows HTML5, will attempt either Flash or Silverlight
764
+ // none: forces fallback view
765
+ mode: 'auto',
766
+ // remove or reorder to change plugin priority and availability
767
+ plugins: ['flash','silverlight','youtube','vimeo'],
768
+ // shows debug errors on screen
769
+ enablePluginDebug: false,
770
+ // overrides the type specified, useful for dynamic instantiation
771
+ type: '',
772
+ // path to Flash and Silverlight plugins
773
+ // altered by @edsilv - include app.js
774
+ pluginPath: mejs.Utility.getScriptPath(['mediaelement.js','mediaelement.min.js','mediaelement-and-player.js','mediaelement-and-player.min.js', 'app.js']),
775
+ // name of flash file
776
+ flashName: 'flashmediaelement.swf',
777
+ // turns on the smoothing filter in Flash
778
+ enablePluginSmoothing: false,
779
+ // name of silverlight file
780
+ silverlightName: 'silverlightmediaelement.xap',
781
+ // default if the <video width> is not specified
782
+ defaultVideoWidth: 480,
783
+ // default if the <video height> is not specified
784
+ defaultVideoHeight: 270,
785
+ // overrides <video width>
786
+ pluginWidth: -1,
787
+ // overrides <video height>
788
+ pluginHeight: -1,
789
+ // additional plugin variables in 'key=value' form
790
+ pluginVars: [],
791
+ // rate in milliseconds for Flash and Silverlight to fire the timeupdate event
792
+ // larger number is less accurate, but less strain on plugin->JavaScript bridge
793
+ timerRate: 250,
794
+ // initial volume for player
795
+ startVolume: 0.8,
796
+ success: function () { },
797
+ error: function () { }
798
+ };
799
+
800
+ /*
801
+ Determines if a browser supports the <video> or <audio> element
802
+ and returns either the native element or a Flash/Silverlight version that
803
+ mimics HTML5 MediaElement
804
+ */
805
+ mejs.MediaElement = function (el, o) {
806
+ return mejs.HtmlMediaElementShim.create(el,o);
807
+ };
808
+
809
+ mejs.HtmlMediaElementShim = {
810
+
811
+ create: function(el, o) {
812
+ var
813
+ options = mejs.MediaElementDefaults,
814
+ htmlMediaElement = (typeof(el) == 'string') ? document.getElementById(el) : el,
815
+ tagName = htmlMediaElement.tagName.toLowerCase(),
816
+ isMediaTag = (tagName === 'audio' || tagName === 'video'),
817
+ src = (isMediaTag) ? htmlMediaElement.getAttribute('src') : htmlMediaElement.getAttribute('href'),
818
+ poster = htmlMediaElement.getAttribute('poster'),
819
+ autoplay = htmlMediaElement.getAttribute('autoplay'),
820
+ preload = htmlMediaElement.getAttribute('preload'),
821
+ controls = htmlMediaElement.getAttribute('controls'),
822
+ playback,
823
+ prop;
824
+
825
+ // extend options
826
+ for (prop in o) {
827
+ options[prop] = o[prop];
828
+ }
829
+
830
+ // clean up attributes
831
+ src = (typeof src == 'undefined' || src === null || src == '') ? null : src;
832
+ poster = (typeof poster == 'undefined' || poster === null) ? '' : poster;
833
+ preload = (typeof preload == 'undefined' || preload === null || preload === 'false') ? 'none' : preload;
834
+ autoplay = !(typeof autoplay == 'undefined' || autoplay === null || autoplay === 'false');
835
+ controls = !(typeof controls == 'undefined' || controls === null || controls === 'false');
836
+
837
+ // test for HTML5 and plugin capabilities
838
+ playback = this.determinePlayback(htmlMediaElement, options, mejs.MediaFeatures.supportsMediaTag, isMediaTag, src);
839
+ playback.url = (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '';
840
+
841
+ if (playback.method == 'native') {
842
+ // second fix for android
843
+ if (mejs.MediaFeatures.isBustedAndroid) {
844
+ htmlMediaElement.src = playback.url;
845
+ htmlMediaElement.addEventListener('click', function() {
846
+ htmlMediaElement.play();
847
+ }, false);
848
+ }
849
+
850
+ // add methods to native HTMLMediaElement
851
+ return this.updateNative(playback, options, autoplay, preload);
852
+ } else if (playback.method !== '') {
853
+ // create plugin to mimic HTMLMediaElement
854
+
855
+ return this.createPlugin( playback, options, poster, autoplay, preload, controls);
856
+ } else {
857
+ // boo, no HTML5, no Flash, no Silverlight.
858
+ this.createErrorMessage( playback, options, poster );
859
+
860
+ return this;
861
+ }
862
+ },
863
+
864
+ determinePlayback: function(htmlMediaElement, options, supportsMediaTag, isMediaTag, src) {
865
+ var
866
+ mediaFiles = [],
867
+ i,
868
+ j,
869
+ k,
870
+ l,
871
+ n,
872
+ type,
873
+ result = { method: '', url: '', htmlMediaElement: htmlMediaElement, isVideo: (htmlMediaElement.tagName.toLowerCase() != 'audio')},
874
+ pluginName,
875
+ pluginVersions,
876
+ pluginInfo,
877
+ dummy;
878
+
879
+ // STEP 1: Get URL and type from <video src> or <source src>
880
+
881
+ // supplied type overrides <video type> and <source type>
882
+ if (typeof options.type != 'undefined' && options.type !== '') {
883
+
884
+ // accept either string or array of types
885
+ if (typeof options.type == 'string') {
886
+ mediaFiles.push({type:options.type, url:src});
887
+ } else {
888
+
889
+ for (i=0; i<options.type.length; i++) {
890
+ mediaFiles.push({type:options.type[i], url:src});
891
+ }
892
+ }
893
+
894
+ // test for src attribute first
895
+ } else if (src !== null) {
896
+ type = this.formatType(src, htmlMediaElement.getAttribute('type'));
897
+ mediaFiles.push({type:type, url:src});
898
+
899
+ // then test for <source> elements
900
+ } else {
901
+ // test <source> types to see if they are usable
902
+ for (i = 0; i < htmlMediaElement.childNodes.length; i++) {
903
+ n = htmlMediaElement.childNodes[i];
904
+ if (n.nodeType == 1 && n.tagName.toLowerCase() == 'source') {
905
+ src = n.getAttribute('src');
906
+ type = this.formatType(src, n.getAttribute('type'));
907
+ mediaFiles.push({type:type, url:src});
908
+ }
909
+ }
910
+ }
911
+
912
+ // in the case of dynamicly created players
913
+ // check for audio types
914
+ if (!isMediaTag && mediaFiles.length > 0 && mediaFiles[0].url !== null && this.getTypeFromFile(mediaFiles[0].url).indexOf('audio') > -1) {
915
+ result.isVideo = false;
916
+ }
917
+
918
+
919
+ // STEP 2: Test for playback method
920
+
921
+ // special case for Android which sadly doesn't implement the canPlayType function (always returns '')
922
+ if (mejs.MediaFeatures.isBustedAndroid) {
923
+ htmlMediaElement.canPlayType = function(type) {
924
+ return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'maybe' : '';
925
+ };
926
+ }
927
+
928
+
929
+ // test for native playback first
930
+ if (supportsMediaTag && (options.mode === 'auto' || options.mode === 'native')) {
931
+
932
+ if (!isMediaTag) {
933
+
934
+ // create a real HTML5 Media Element
935
+ dummy = document.createElement( result.isVideo ? 'video' : 'audio');
936
+ htmlMediaElement.parentNode.insertBefore(dummy, htmlMediaElement);
937
+ htmlMediaElement.style.display = 'none';
938
+
939
+ // use this one from now on
940
+ result.htmlMediaElement = htmlMediaElement = dummy;
941
+ }
942
+
943
+ for (i=0; i<mediaFiles.length; i++) {
944
+ // normal check
945
+ if (htmlMediaElement.canPlayType(mediaFiles[i].type).replace(/no/, '') !== ''
946
+ // special case for Mac/Safari 5.0.3 which answers '' to canPlayType('audio/mp3') but 'maybe' to canPlayType('audio/mpeg')
947
+ || htmlMediaElement.canPlayType(mediaFiles[i].type.replace(/mp3/,'mpeg')).replace(/no/, '') !== '') {
948
+ result.method = 'native';
949
+ result.url = mediaFiles[i].url;
950
+ break;
951
+ }
952
+ }
953
+
954
+ if (result.method === 'native') {
955
+ if (result.url !== null) {
956
+ htmlMediaElement.src = result.url;
957
+ }
958
+
959
+ return result;
960
+ }
961
+ }
962
+
963
+ // if native playback didn't work, then test plugins
964
+ if (options.mode === 'auto' || options.mode === 'shim') {
965
+ for (i=0; i<mediaFiles.length; i++) {
966
+ type = mediaFiles[i].type;
967
+
968
+ // test all plugins in order of preference [silverlight, flash]
969
+ for (j=0; j<options.plugins.length; j++) {
970
+
971
+ pluginName = options.plugins[j];
972
+
973
+ // test version of plugin (for future features)
974
+ pluginVersions = mejs.plugins[pluginName];
975
+
976
+ for (k=0; k<pluginVersions.length; k++) {
977
+ pluginInfo = pluginVersions[k];
978
+
979
+ // test if user has the correct plugin version
980
+
981
+ // for youtube/vimeo
982
+ if (pluginInfo.version == null ||
983
+
984
+ mejs.PluginDetector.hasPluginVersion(pluginName, pluginInfo.version)) {
985
+
986
+ // test for plugin playback types
987
+ for (l=0; l<pluginInfo.types.length; l++) {
988
+ // find plugin that can play the type
989
+ if (type == pluginInfo.types[l]) {
990
+ result.method = pluginName;
991
+ result.url = mediaFiles[i].url;
992
+ return result;
993
+ }
994
+ }
995
+ }
996
+ }
997
+ }
998
+ }
999
+ }
1000
+
1001
+ // what if there's nothing to play? just grab the first available
1002
+ if (result.method === '' && mediaFiles.length > 0) {
1003
+ result.url = mediaFiles[0].url;
1004
+ }
1005
+
1006
+ return result;
1007
+ },
1008
+
1009
+ formatType: function(url, type) {
1010
+ var ext;
1011
+
1012
+ // if no type is supplied, fake it with the extension
1013
+ if (url && !type) {
1014
+ return this.getTypeFromFile(url);
1015
+ } else {
1016
+ // only return the mime part of the type in case the attribute contains the codec
1017
+ // see http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-source-element
1018
+ // `video/mp4; codecs="avc1.42E01E, mp4a.40.2"` becomes `video/mp4`
1019
+
1020
+ if (type && ~type.indexOf(';')) {
1021
+ return type.substr(0, type.indexOf(';'));
1022
+ } else {
1023
+ return type;
1024
+ }
1025
+ }
1026
+ },
1027
+
1028
+ getTypeFromFile: function(url) {
1029
+ var ext = url.substring(url.lastIndexOf('.') + 1);
1030
+ return (/(mp4|m4v|ogg|ogv|webm|flv|wmv|mpeg|mov)/gi.test(ext) ? 'video' : 'audio') + '/' + ext;
1031
+ },
1032
+
1033
+ createErrorMessage: function(playback, options, poster) {
1034
+ var
1035
+ htmlMediaElement = playback.htmlMediaElement,
1036
+ errorContainer = document.createElement('div');
1037
+
1038
+ errorContainer.className = 'me-cannotplay';
1039
+
1040
+ // changed by @edsilv
1041
+ //try {
1042
+ // errorContainer.style.width = htmlMediaElement.width + 'px';
1043
+ // errorContainer.style.height = htmlMediaElement.height + 'px';
1044
+ //} catch (e) {}
1045
+
1046
+ $(errorContainer).height($('.mejs-mediaelement').height());
1047
+
1048
+ // changed by @edsilv
1049
+ //errorContainer.innerHTML = (poster !== '') ?
1050
+ // '<a href="' + playback.url + '"><img src="' + poster + '" width="100%" height="100%" /></a>' :
1051
+ // '<a href="' + playback.url + '"><span>Download File</span></a>';
1052
+
1053
+ errorContainer.innerHTML = '<p>Please install the <a target="_blank" href="http://get.adobe.com/flashplayer/">Adobe Flash</a> plugin to view this content.</p>';
1054
+
1055
+ htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement);
1056
+ htmlMediaElement.style.display = 'none';
1057
+
1058
+ options.error(htmlMediaElement);
1059
+ },
1060
+
1061
+ createPlugin:function(playback, options, poster, autoplay, preload, controls) {
1062
+ var
1063
+ htmlMediaElement = playback.htmlMediaElement,
1064
+ width = 1,
1065
+ height = 1,
1066
+ pluginid = 'me_' + playback.method + '_' + (mejs.meIndex++),
1067
+ pluginMediaElement = new mejs.PluginMediaElement(pluginid, playback.method, playback.url),
1068
+ container = document.createElement('div'),
1069
+ specialIEContainer,
1070
+ node,
1071
+ initVars;
1072
+
1073
+ // copy tagName from html media element
1074
+ pluginMediaElement.tagName = htmlMediaElement.tagName
1075
+
1076
+ // copy attributes from html media element to plugin media element
1077
+ for (var i = 0; i < htmlMediaElement.attributes.length; i++) {
1078
+ var attribute = htmlMediaElement.attributes[i];
1079
+ if (attribute.specified == true) {
1080
+ pluginMediaElement.setAttribute(attribute.name, attribute.value);
1081
+ }
1082
+ }
1083
+
1084
+ // check for placement inside a <p> tag (sometimes WYSIWYG editors do this)
1085
+ node = htmlMediaElement.parentNode;
1086
+ while (node !== null && node.tagName.toLowerCase() != 'body') {
1087
+ if (node.parentNode.tagName.toLowerCase() == 'p') {
1088
+ node.parentNode.parentNode.insertBefore(node, node.parentNode);
1089
+ break;
1090
+ }
1091
+ node = node.parentNode;
1092
+ }
1093
+
1094
+ if (playback.isVideo) {
1095
+ width = (options.videoWidth > 0) ? options.videoWidth : (htmlMediaElement.getAttribute('width') !== null) ? htmlMediaElement.getAttribute('width') : options.defaultVideoWidth;
1096
+ height = (options.videoHeight > 0) ? options.videoHeight : (htmlMediaElement.getAttribute('height') !== null) ? htmlMediaElement.getAttribute('height') : options.defaultVideoHeight;
1097
+
1098
+ // in case of '%' make sure it's encoded
1099
+ width = mejs.Utility.encodeUrl(width);
1100
+ height = mejs.Utility.encodeUrl(height);
1101
+
1102
+ } else {
1103
+ if (options.enablePluginDebug) {
1104
+ width = 320;
1105
+ height = 240;
1106
+ }
1107
+ }
1108
+
1109
+ // register plugin
1110
+ pluginMediaElement.success = options.success;
1111
+ mejs.MediaPluginBridge.registerPluginElement(pluginid, pluginMediaElement, htmlMediaElement);
1112
+
1113
+ // add container (must be added to DOM before inserting HTML for IE)
1114
+ container.className = 'me-plugin';
1115
+ container.id = pluginid + '_container';
1116
+
1117
+ if (playback.isVideo) {
1118
+ htmlMediaElement.parentNode.insertBefore(container, htmlMediaElement);
1119
+ } else {
1120
+ document.body.insertBefore(container, document.body.childNodes[0]);
1121
+ }
1122
+
1123
+ // flash/silverlight vars
1124
+ initVars = [
1125
+ 'id=' + pluginid,
1126
+ 'isvideo=' + ((playback.isVideo) ? "true" : "false"),
1127
+ 'autoplay=' + ((autoplay) ? "true" : "false"),
1128
+ 'preload=' + preload,
1129
+ 'width=' + width,
1130
+ 'startvolume=' + options.startVolume,
1131
+ 'timerrate=' + options.timerRate,
1132
+ 'height=' + height];
1133
+
1134
+ if (playback.url !== null) {
1135
+ if (playback.method == 'flash') {
1136
+ initVars.push('file=' + mejs.Utility.encodeUrl(playback.url));
1137
+ } else {
1138
+ initVars.push('file=' + playback.url);
1139
+ }
1140
+ }
1141
+ if (options.enablePluginDebug) {
1142
+ initVars.push('debug=true');
1143
+ }
1144
+ if (options.enablePluginSmoothing) {
1145
+ initVars.push('smoothing=true');
1146
+ }
1147
+ if (controls) {
1148
+ initVars.push('controls=true'); // shows controls in the plugin if desired
1149
+ }
1150
+ if (options.pluginVars) {
1151
+ initVars = initVars.concat(options.pluginVars);
1152
+ }
1153
+
1154
+ switch (playback.method) {
1155
+ case 'silverlight':
1156
+ container.innerHTML =
1157
+ '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '">' +
1158
+ '<param name="initParams" value="' + initVars.join(',') + '" />' +
1159
+ '<param name="windowless" value="true" />' +
1160
+ '<param name="background" value="black" />' +
1161
+ '<param name="minRuntimeVersion" value="3.0.0.0" />' +
1162
+ '<param name="autoUpgrade" value="true" />' +
1163
+ '<param name="source" value="' + options.pluginPath + options.silverlightName + '" />' +
1164
+ '</object>';
1165
+ break;
1166
+
1167
+ case 'flash':
1168
+
1169
+ if (mejs.MediaFeatures.isIE) {
1170
+ specialIEContainer = document.createElement('div');
1171
+ container.appendChild(specialIEContainer);
1172
+ specialIEContainer.outerHTML =
1173
+ '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' +
1174
+ 'id="' + pluginid + '" width="' + width + '" height="' + height + '">' +
1175
+ '<param name="movie" value="' + options.pluginPath + options.flashName + '?x=' + (new Date()) + '" />' +
1176
+ '<param name="flashvars" value="' + initVars.join('&amp;') + '" />' +
1177
+ '<param name="quality" value="high" />' +
1178
+ '<param name="bgcolor" value="#000000" />' +
1179
+ '<param name="wmode" value="transparent" />' +
1180
+ '<param name="allowScriptAccess" value="always" />' +
1181
+ '<param name="allowFullScreen" value="true" />' +
1182
+ '</object>';
1183
+
1184
+ } else {
1185
+
1186
+ container.innerHTML =
1187
+ '<embed id="' + pluginid + '" name="' + pluginid + '" ' +
1188
+ 'play="true" ' +
1189
+ 'loop="false" ' +
1190
+ 'quality="high" ' +
1191
+ 'bgcolor="#000000" ' +
1192
+ 'wmode="transparent" ' +
1193
+ 'allowScriptAccess="always" ' +
1194
+ 'allowFullScreen="true" ' +
1195
+ 'type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" ' +
1196
+ 'src="' + options.pluginPath + options.flashName + '" ' +
1197
+ 'flashvars="' + initVars.join('&') + '" ' +
1198
+ 'width="' + width + '" ' +
1199
+ 'height="' + height + '"></embed>';
1200
+ }
1201
+ break;
1202
+
1203
+ case 'youtube':
1204
+
1205
+
1206
+ var
1207
+ videoId = playback.url.substr(playback.url.lastIndexOf('=')+1);
1208
+ youtubeSettings = {
1209
+ container: container,
1210
+ containerId: container.id,
1211
+ pluginMediaElement: pluginMediaElement,
1212
+ pluginId: pluginid,
1213
+ videoId: videoId,
1214
+ height: height,
1215
+ width: width
1216
+ };
1217
+
1218
+ if (mejs.PluginDetector.hasPluginVersion('flash', [10,0,0]) ) {
1219
+ mejs.YouTubeApi.createFlash(youtubeSettings);
1220
+ } else {
1221
+ mejs.YouTubeApi.enqueueIframe(youtubeSettings);
1222
+ }
1223
+
1224
+ break;
1225
+
1226
+ // DEMO Code. Does NOT work.
1227
+ case 'vimeo':
1228
+ console.log('vimeoid');
1229
+
1230
+ pluginMediaElement.vimeoid = playback.url.substr(playback.url.lastIndexOf('/')+1);
1231
+
1232
+ container.innerHTML =
1233
+ '<object width="' + width + '" height="' + height + '">' +
1234
+ '<param name="allowfullscreen" value="true" />' +
1235
+ '<param name="allowscriptaccess" value="always" />' +
1236
+ '<param name="flashvars" value="api=1" />' +
1237
+ '<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' + pluginMediaElement.vimeoid + '&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" />' +
1238
+ '<embed src="//vimeo.com/moogaloop.swf?api=1&amp;clip_id=' + pluginMediaElement.vimeoid + '&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' + width + '" height="' + height + '"></embed>' +
1239
+ '</object>';
1240
+
1241
+ break;
1242
+ }
1243
+ // hide original element
1244
+ htmlMediaElement.style.display = 'none';
1245
+
1246
+ // FYI: options.success will be fired by the MediaPluginBridge
1247
+
1248
+ return pluginMediaElement;
1249
+ },
1250
+
1251
+ updateNative: function(playback, options, autoplay, preload) {
1252
+
1253
+ var htmlMediaElement = playback.htmlMediaElement,
1254
+ m;
1255
+
1256
+
1257
+ // add methods to video object to bring it into parity with Flash Object
1258
+ for (m in mejs.HtmlMediaElement) {
1259
+ htmlMediaElement[m] = mejs.HtmlMediaElement[m];
1260
+ }
1261
+
1262
+ /*
1263
+ Chrome now supports preload="none"
1264
+ if (mejs.MediaFeatures.isChrome) {
1265
+
1266
+ // special case to enforce preload attribute (Chrome doesn't respect this)
1267
+ if (preload === 'none' && !autoplay) {
1268
+
1269
+ // forces the browser to stop loading (note: fails in IE9)
1270
+ htmlMediaElement.src = '';
1271
+ htmlMediaElement.load();
1272
+ htmlMediaElement.canceledPreload = true;
1273
+
1274
+ htmlMediaElement.addEventListener('play',function() {
1275
+ if (htmlMediaElement.canceledPreload) {
1276
+ htmlMediaElement.src = playback.url;
1277
+ htmlMediaElement.load();
1278
+ htmlMediaElement.play();
1279
+ htmlMediaElement.canceledPreload = false;
1280
+ }
1281
+ }, false);
1282
+ // for some reason Chrome forgets how to autoplay sometimes.
1283
+ } else if (autoplay) {
1284
+ htmlMediaElement.load();
1285
+ htmlMediaElement.play();
1286
+ }
1287
+ }
1288
+ */
1289
+
1290
+ // fire success code
1291
+ options.success(htmlMediaElement, htmlMediaElement);
1292
+
1293
+ return htmlMediaElement;
1294
+ }
1295
+ };
1296
+
1297
+ /*
1298
+ - test on IE (object vs. embed)
1299
+ - determine when to use iframe (Firefox, Safari, Mobile) vs. Flash (Chrome, IE)
1300
+ - fullscreen?
1301
+ */
1302
+
1303
+ // YouTube Flash and Iframe API
1304
+ mejs.YouTubeApi = {
1305
+ isIframeStarted: false,
1306
+ isIframeLoaded: false,
1307
+ loadIframeApi: function() {
1308
+ if (!this.isIframeStarted) {
1309
+ var tag = document.createElement('script');
1310
+ tag.src = "http://www.youtube.com/player_api";
1311
+ var firstScriptTag = document.getElementsByTagName('script')[0];
1312
+ firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
1313
+ this.isIframeStarted = true;
1314
+ }
1315
+ },
1316
+ iframeQueue: [],
1317
+ enqueueIframe: function(yt) {
1318
+
1319
+ if (this.isLoaded) {
1320
+ this.createIframe(yt);
1321
+ } else {
1322
+ this.loadIframeApi();
1323
+ this.iframeQueue.push(yt);
1324
+ }
1325
+ },
1326
+ createIframe: function(settings) {
1327
+
1328
+ var
1329
+ pluginMediaElement = settings.pluginMediaElement,
1330
+ player = new YT.Player(settings.containerId, {
1331
+ height: settings.height,
1332
+ width: settings.width,
1333
+ videoId: settings.videoId,
1334
+ playerVars: {controls:0},
1335
+ events: {
1336
+ 'onReady': function() {
1337
+
1338
+ // hook up iframe object to MEjs
1339
+ settings.pluginMediaElement.pluginApi = player;
1340
+
1341
+ // init mejs
1342
+ mejs.MediaPluginBridge.initPlugin(settings.pluginId);
1343
+
1344
+ // create timer
1345
+ setInterval(function() {
1346
+ mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'timeupdate');
1347
+ }, 250);
1348
+ },
1349
+ 'onStateChange': function(e) {
1350
+
1351
+ mejs.YouTubeApi.handleStateChange(e.data, player, pluginMediaElement);
1352
+
1353
+ }
1354
+ }
1355
+ });
1356
+ },
1357
+
1358
+ createEvent: function (player, pluginMediaElement, eventName) {
1359
+ var obj = {
1360
+ type: eventName,
1361
+ target: pluginMediaElement
1362
+ };
1363
+
1364
+ if (player && player.getDuration) {
1365
+
1366
+ // time
1367
+ pluginMediaElement.currentTime = obj.currentTime = player.getCurrentTime();
1368
+ pluginMediaElement.duration = obj.duration = player.getDuration();
1369
+
1370
+ // state
1371
+ obj.paused = pluginMediaElement.paused;
1372
+ obj.ended = pluginMediaElement.ended;
1373
+
1374
+ // sound
1375
+ obj.muted = player.isMuted();
1376
+ obj.volume = player.getVolume() / 100;
1377
+
1378
+ // progress
1379
+ obj.bytesTotal = player.getVideoBytesTotal();
1380
+ obj.bufferedBytes = player.getVideoBytesLoaded();
1381
+
1382
+ // fake the W3C buffered TimeRange
1383
+ var bufferedTime = obj.bufferedBytes / obj.bytesTotal * obj.duration;
1384
+
1385
+ obj.target.buffered = obj.buffered = {
1386
+ start: function(index) {
1387
+ return 0;
1388
+ },
1389
+ end: function (index) {
1390
+ return bufferedTime;
1391
+ },
1392
+ length: 1
1393
+ };
1394
+
1395
+ }
1396
+
1397
+ // send event up the chain
1398
+ pluginMediaElement.dispatchEvent(obj.type, obj);
1399
+ },
1400
+
1401
+ iFrameReady: function() {
1402
+
1403
+ this.isLoaded = true;
1404
+ this.isIframeLoaded = true;
1405
+
1406
+ while (this.iframeQueue.length > 0) {
1407
+ var settings = this.iframeQueue.pop();
1408
+ this.createIframe(settings);
1409
+ }
1410
+ },
1411
+
1412
+ // FLASH!
1413
+ flashPlayers: {},
1414
+ createFlash: function(settings) {
1415
+
1416
+ this.flashPlayers[settings.pluginId] = settings;
1417
+
1418
+ /*
1419
+ settings.container.innerHTML =
1420
+ '<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="//www.youtube.com/apiplayer?enablejsapi=1&amp;playerapiid=' + settings.pluginId + '&amp;version=3&amp;autoplay=0&amp;controls=0&amp;modestbranding=1&loop=0" ' +
1421
+ 'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; ">' +
1422
+ '<param name="allowScriptAccess" value="always">' +
1423
+ '<param name="wmode" value="transparent">' +
1424
+ '</object>';
1425
+ */
1426
+
1427
+ var specialIEContainer,
1428
+ youtubeUrl = 'http://www.youtube.com/apiplayer?enablejsapi=1&amp;playerapiid=' + settings.pluginId + '&amp;version=3&amp;autoplay=0&amp;controls=0&amp;modestbranding=1&loop=0';
1429
+
1430
+ if (mejs.MediaFeatures.isIE) {
1431
+
1432
+ specialIEContainer = document.createElement('div');
1433
+ settings.container.appendChild(specialIEContainer);
1434
+ specialIEContainer.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' +
1435
+ 'id="' + settings.pluginId + '" width="' + settings.width + '" height="' + settings.height + '">' +
1436
+ '<param name="movie" value="' + youtubeUrl + '" />' +
1437
+ '<param name="wmode" value="transparent" />' +
1438
+ '<param name="allowScriptAccess" value="always" />' +
1439
+ '<param name="allowFullScreen" value="true" />' +
1440
+ '</object>';
1441
+ } else {
1442
+ settings.container.innerHTML =
1443
+ '<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="' + youtubeUrl + '" ' +
1444
+ 'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; ">' +
1445
+ '<param name="allowScriptAccess" value="always">' +
1446
+ '<param name="wmode" value="transparent">' +
1447
+ '</object>';
1448
+ }
1449
+
1450
+ },
1451
+
1452
+ flashReady: function(id) {
1453
+ var
1454
+ settings = this.flashPlayers[id],
1455
+ player = document.getElementById(id),
1456
+ pluginMediaElement = settings.pluginMediaElement;
1457
+
1458
+ // hook up and return to MediaELementPlayer.success
1459
+ pluginMediaElement.pluginApi =
1460
+ pluginMediaElement.pluginElement = player;
1461
+ mejs.MediaPluginBridge.initPlugin(id);
1462
+
1463
+ // load the youtube video
1464
+ player.cueVideoById(settings.videoId);
1465
+
1466
+ var callbackName = settings.containerId + '_callback'
1467
+
1468
+ window[callbackName] = function(e) {
1469
+ mejs.YouTubeApi.handleStateChange(e, player, pluginMediaElement);
1470
+ }
1471
+
1472
+ player.addEventListener('onStateChange', callbackName);
1473
+
1474
+ setInterval(function() {
1475
+ mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'timeupdate');
1476
+ }, 250);
1477
+ },
1478
+
1479
+ handleStateChange: function(youTubeState, player, pluginMediaElement) {
1480
+ switch (youTubeState) {
1481
+ case -1: // not started
1482
+ pluginMediaElement.paused = true;
1483
+ pluginMediaElement.ended = true;
1484
+ mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'loadedmetadata');
1485
+ //createYouTubeEvent(player, pluginMediaElement, 'loadeddata');
1486
+ break;
1487
+ case 0:
1488
+ pluginMediaElement.paused = false;
1489
+ pluginMediaElement.ended = true;
1490
+ mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'ended');
1491
+ break;
1492
+ case 1:
1493
+ pluginMediaElement.paused = false;
1494
+ pluginMediaElement.ended = false;
1495
+ mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'play');
1496
+ mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'playing');
1497
+ break;
1498
+ case 2:
1499
+ pluginMediaElement.paused = true;
1500
+ pluginMediaElement.ended = false;
1501
+ mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'pause');
1502
+ break;
1503
+ case 3: // buffering
1504
+ mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'progress');
1505
+ break;
1506
+ case 5:
1507
+ // cued?
1508
+ break;
1509
+
1510
+ }
1511
+
1512
+ }
1513
+ }
1514
+ // IFRAME
1515
+ function onYouTubePlayerAPIReady() {
1516
+ mejs.YouTubeApi.iFrameReady();
1517
+ }
1518
+ // FLASH
1519
+ function onYouTubePlayerReady(id) {
1520
+ mejs.YouTubeApi.flashReady(id);
1521
+ }
1522
+
1523
+ window.mejs = mejs;
1524
+ window.MediaElement = mejs.MediaElement;
1525
+
1526
+ /*!
1527
+ * MediaElementPlayer
1528
+ * http://mediaelementjs.com/
1529
+ *
1530
+ * Creates a controller bar for HTML5 <video> add <audio> tags
1531
+ * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
1532
+ *
1533
+ * Copyright 2010-2012, John Dyer (http://j.hn/)
1534
+ * Dual licensed under the MIT or GPL Version 2 licenses.
1535
+ *
1536
+ */
1537
+ if (typeof jQuery != 'undefined') {
1538
+ mejs.$ = jQuery;
1539
+ } else if (typeof ender != 'undefined') {
1540
+ mejs.$ = ender;
1541
+ }
1542
+ (function ($) {
1543
+
1544
+ // default player values
1545
+ mejs.MepDefaults = {
1546
+ // url to poster (to fix iOS 3.x)
1547
+ poster: '',
1548
+ // default if the <video width> is not specified
1549
+ defaultVideoWidth: 480,
1550
+ // default if the <video height> is not specified
1551
+ defaultVideoHeight: 270,
1552
+ // if set, overrides <video width>
1553
+ videoWidth: -1,
1554
+ // if set, overrides <video height>
1555
+ videoHeight: -1,
1556
+ // default if the user doesn't specify
1557
+ defaultAudioWidth: 400,
1558
+ // default if the user doesn't specify
1559
+ defaultAudioHeight: 30,
1560
+ // width of audio player
1561
+ audioWidth: -1,
1562
+ // height of audio player
1563
+ audioHeight: -1,
1564
+ // initial volume when the player starts (overrided by user cookie)
1565
+ startVolume: 0.8,
1566
+ // useful for <audio> player loops
1567
+ loop: false,
1568
+ // resize to media dimensions
1569
+ enableAutosize: true,
1570
+ // forces the hour marker (##:00:00)
1571
+ alwaysShowHours: false,
1572
+
1573
+ // show framecount in timecode (##:00:00:00)
1574
+ showTimecodeFrameCount: false,
1575
+ // used when showTimecodeFrameCount is set to true
1576
+ framesPerSecond: 25,
1577
+
1578
+ // automatically calculate the width of the progress bar based on the sizes of other elements
1579
+ autosizeProgress : true,
1580
+ // Hide controls when playing and mouse is not over the video
1581
+ alwaysShowControls: false,
1582
+ // force iPad's native controls
1583
+ iPadUseNativeControls: false,
1584
+ // force iPhone's native controls
1585
+ iPhoneUseNativeControls: false,
1586
+ // force Android's native controls
1587
+ AndroidUseNativeControls: false,
1588
+ // features to show
1589
+ features: ['playpause','current','progress','duration','tracks','volume','fullscreen'],
1590
+ // only for dynamic
1591
+ isVideo: true,
1592
+
1593
+ // turns keyboard support on and off for this instance
1594
+ enableKeyboard: true,
1595
+
1596
+ // whenthis player starts, it will pause other players
1597
+ pauseOtherPlayers: true,
1598
+
1599
+ // array of keyboard actions such as play pause
1600
+ keyActions: [
1601
+ {
1602
+ keys: [
1603
+ 32, // SPACE
1604
+ 179 // GOOGLE play/pause button
1605
+ ],
1606
+ action: function(player, media) {
1607
+ if (media.paused || media.ended) {
1608
+ media.play();
1609
+ } else {
1610
+ media.pause();
1611
+ }
1612
+ }
1613
+ },
1614
+ {
1615
+ keys: [38], // UP
1616
+ action: function(player, media) {
1617
+ var newVolume = Math.min(media.volume + 0.1, 1);
1618
+ media.setVolume(newVolume);
1619
+ }
1620
+ },
1621
+ {
1622
+ keys: [40], // DOWN
1623
+ action: function(player, media) {
1624
+ var newVolume = Math.max(media.volume - 0.1, 0);
1625
+ media.setVolume(newVolume);
1626
+ }
1627
+ },
1628
+ {
1629
+ keys: [
1630
+ 37, // LEFT
1631
+ 227 // Google TV rewind
1632
+ ],
1633
+ action: function(player, media) {
1634
+ if (!isNaN(media.duration) && media.duration > 0) {
1635
+ if (player.isVideo) {
1636
+ player.showControls();
1637
+ player.startControlsTimer();
1638
+ }
1639
+
1640
+ // 5%
1641
+ var newTime = Math.max(media.currentTime - (media.duration * 0.05), 0);
1642
+ media.setCurrentTime(newTime);
1643
+ }
1644
+ }
1645
+ },
1646
+ {
1647
+ keys: [
1648
+ 39, // RIGHT
1649
+ 228 // Google TV forward
1650
+ ],
1651
+ action: function(player, media) {
1652
+ if (!isNaN(media.duration) && media.duration > 0) {
1653
+ if (player.isVideo) {
1654
+ player.showControls();
1655
+ player.startControlsTimer();
1656
+ }
1657
+
1658
+ // 5%
1659
+ var newTime = Math.min(media.currentTime + (media.duration * 0.05), media.duration);
1660
+ media.setCurrentTime(newTime);
1661
+ }
1662
+ }
1663
+ },
1664
+ {
1665
+ keys: [70], // f
1666
+ action: function(player, media) {
1667
+ if (typeof player.enterFullScreen != 'undefined') {
1668
+ if (player.isFullScreen) {
1669
+ player.exitFullScreen();
1670
+ } else {
1671
+ player.enterFullScreen();
1672
+ }
1673
+ }
1674
+ }
1675
+ }
1676
+ ]
1677
+ };
1678
+
1679
+ mejs.mepIndex = 0;
1680
+
1681
+ mejs.players = [];
1682
+
1683
+ // wraps a MediaElement object in player controls
1684
+ mejs.MediaElementPlayer = function(node, o) {
1685
+ // enforce object, even without "new" (via John Resig)
1686
+ if ( !(this instanceof mejs.MediaElementPlayer) ) {
1687
+ return new mejs.MediaElementPlayer(node, o);
1688
+ }
1689
+
1690
+ var t = this;
1691
+
1692
+ // these will be reset after the MediaElement.success fires
1693
+ t.$media = t.$node = $(node);
1694
+ t.node = t.media = t.$media[0];
1695
+
1696
+ // check for existing player
1697
+ if (typeof t.node.player != 'undefined') {
1698
+ return t.node.player;
1699
+ } else {
1700
+ // attach player to DOM node for reference
1701
+ t.node.player = t;
1702
+ }
1703
+
1704
+
1705
+ // try to get options from data-mejsoptions
1706
+ if (typeof o == 'undefined') {
1707
+ o = t.$node.data('mejsoptions');
1708
+ }
1709
+
1710
+ // extend default options
1711
+ t.options = $.extend({},mejs.MepDefaults,o);
1712
+
1713
+ // add to player array (for focus events)
1714
+ mejs.players.push(t);
1715
+
1716
+ // start up
1717
+ t.init();
1718
+
1719
+ return t;
1720
+ };
1721
+
1722
+ // actual player
1723
+ mejs.MediaElementPlayer.prototype = {
1724
+
1725
+ hasFocus: false,
1726
+
1727
+ controlsAreVisible: true,
1728
+
1729
+ init: function() {
1730
+
1731
+ var
1732
+ t = this,
1733
+ mf = mejs.MediaFeatures,
1734
+ // options for MediaElement (shim)
1735
+ meOptions = $.extend(true, {}, t.options, {
1736
+ success: function(media, domNode) { t.meReady(media, domNode); },
1737
+ error: function(e) { t.handleError(e);}
1738
+ }),
1739
+ tagName = t.media.tagName.toLowerCase();
1740
+
1741
+ t.isDynamic = (tagName !== 'audio' && tagName !== 'video');
1742
+
1743
+ if (t.isDynamic) {
1744
+ // get video from src or href?
1745
+ t.isVideo = t.options.isVideo;
1746
+ } else {
1747
+ t.isVideo = (tagName !== 'audio' && t.options.isVideo);
1748
+ }
1749
+
1750
+ // use native controls in iPad, iPhone, and Android
1751
+ if ((mf.isiPad && t.options.iPadUseNativeControls) || (mf.isiPhone && t.options.iPhoneUseNativeControls)) {
1752
+
1753
+ // add controls and stop
1754
+ t.$media.attr('controls', 'controls');
1755
+
1756
+ // attempt to fix iOS 3 bug
1757
+ //t.$media.removeAttr('poster');
1758
+ // no Issue found on iOS3 -ttroxell
1759
+
1760
+ // override Apple's autoplay override for iPads
1761
+ if (mf.isiPad && t.media.getAttribute('autoplay') !== null) {
1762
+ t.media.load();
1763
+ t.media.play();
1764
+ }
1765
+
1766
+ } else if (mf.isAndroid && t.AndroidUseNativeControls) {
1767
+
1768
+ // leave default player
1769
+
1770
+ } else {
1771
+
1772
+ // DESKTOP: use MediaElementPlayer controls
1773
+
1774
+ // remove native controls
1775
+ t.$media.removeAttr('controls');
1776
+
1777
+ // unique ID
1778
+ t.id = 'mep_' + mejs.mepIndex++;
1779
+
1780
+ // build container
1781
+ t.container =
1782
+ $('<div id="' + t.id + '" class="mejs-container">'+
1783
+ '<div class="mejs-inner">'+
1784
+ '<div class="mejs-mediaelement"></div>'+
1785
+ '<div class="mejs-layers"></div>'+
1786
+ '<div class="mejs-controls"></div>'+
1787
+ '<div class="mejs-clear"></div>'+
1788
+ '</div>' +
1789
+ '</div>')
1790
+ .addClass(t.$media[0].className)
1791
+ .insertBefore(t.$media);
1792
+
1793
+ // add classes for user and content
1794
+ t.container.addClass(
1795
+ (mf.isAndroid ? 'mejs-android ' : '') +
1796
+ (mf.isiOS ? 'mejs-ios ' : '') +
1797
+ (mf.isiPad ? 'mejs-ipad ' : '') +
1798
+ (mf.isiPhone ? 'mejs-iphone ' : '') +
1799
+ (t.isVideo ? 'mejs-video ' : 'mejs-audio ')
1800
+ );
1801
+
1802
+
1803
+ // move the <video/video> tag into the right spot
1804
+ if (mf.isiOS) {
1805
+
1806
+ // sadly, you can't move nodes in iOS, so we have to destroy and recreate it!
1807
+ var $newMedia = t.$media.clone();
1808
+
1809
+ t.container.find('.mejs-mediaelement').append($newMedia);
1810
+
1811
+ t.$media.remove();
1812
+ t.$node = t.$media = $newMedia;
1813
+ t.node = t.media = $newMedia[0]
1814
+
1815
+ } else {
1816
+
1817
+ // normal way of moving it into place (doesn't work on iOS)
1818
+ t.container.find('.mejs-mediaelement').append(t.$media);
1819
+ }
1820
+
1821
+ // find parts
1822
+ t.controls = t.container.find('.mejs-controls');
1823
+ t.layers = t.container.find('.mejs-layers');
1824
+
1825
+ // determine the size
1826
+
1827
+ /* size priority:
1828
+ (1) videoWidth (forced),
1829
+ (2) style="width;height;"
1830
+ (3) width attribute,
1831
+ (4) defaultVideoWidth (for unspecified cases)
1832
+ */
1833
+
1834
+ var capsTagName = tagName.substring(0,1).toUpperCase() + tagName.substring(1);
1835
+
1836
+ if (t.options[tagName + 'Width'] > 0 || t.options[tagName + 'Width'].toString().indexOf('%') > -1) {
1837
+ t.width = t.options[tagName + 'Width'];
1838
+ } else if (t.media.style.width !== '' && t.media.style.width !== null) {
1839
+ t.width = t.media.style.width;
1840
+ } else if (t.media.getAttribute('width') !== null) {
1841
+ t.width = t.$media.attr('width');
1842
+ } else {
1843
+ t.width = t.options['default' + capsTagName + 'Width'];
1844
+ }
1845
+
1846
+ if (t.options[tagName + 'Height'] > 0 || t.options[tagName + 'Height'].toString().indexOf('%') > -1) {
1847
+ t.height = t.options[tagName + 'Height'];
1848
+ } else if (t.media.style.height !== '' && t.media.style.height !== null) {
1849
+ t.height = t.media.style.height;
1850
+ } else if (t.$media[0].getAttribute('height') !== null) {
1851
+ t.height = t.$media.attr('height');
1852
+ } else {
1853
+ t.height = t.options['default' + capsTagName + 'Height'];
1854
+ }
1855
+
1856
+ // set the size, while we wait for the plugins to load below
1857
+ t.setPlayerSize(t.width, t.height);
1858
+
1859
+ // create MediaElementShim
1860
+ meOptions.pluginWidth = t.height;
1861
+ meOptions.pluginHeight = t.width;
1862
+ }
1863
+
1864
+
1865
+
1866
+ // create MediaElement shim
1867
+ mejs.MediaElement(t.$media[0], meOptions);
1868
+ },
1869
+
1870
+ showControls: function(doAnimation) {
1871
+ var t = this;
1872
+
1873
+ doAnimation = typeof doAnimation == 'undefined' || doAnimation;
1874
+
1875
+ if (t.controlsAreVisible)
1876
+ return;
1877
+
1878
+ if (doAnimation) {
1879
+ t.controls
1880
+ .css('visibility','visible')
1881
+ .stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;});
1882
+
1883
+ // any additional controls people might add and want to hide
1884
+ t.container.find('.mejs-control')
1885
+ .css('visibility','visible')
1886
+ .stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;});
1887
+
1888
+ } else {
1889
+ t.controls
1890
+ .css('visibility','visible')
1891
+ .css('display','block');
1892
+
1893
+ // any additional controls people might add and want to hide
1894
+ t.container.find('.mejs-control')
1895
+ .css('visibility','visible')
1896
+ .css('display','block');
1897
+
1898
+ t.controlsAreVisible = true;
1899
+ }
1900
+
1901
+ t.setControlsSize();
1902
+
1903
+ },
1904
+
1905
+ hideControls: function(doAnimation) {
1906
+ var t = this;
1907
+
1908
+ doAnimation = typeof doAnimation == 'undefined' || doAnimation;
1909
+
1910
+ if (!t.controlsAreVisible)
1911
+ return;
1912
+
1913
+ if (doAnimation) {
1914
+ // fade out main controls
1915
+ t.controls.stop(true, true).fadeOut(200, function() {
1916
+ $(this)
1917
+ .css('visibility','hidden')
1918
+ .css('display','block');
1919
+
1920
+ t.controlsAreVisible = false;
1921
+ });
1922
+
1923
+ // any additional controls people might add and want to hide
1924
+ t.container.find('.mejs-control').stop(true, true).fadeOut(200, function() {
1925
+ $(this)
1926
+ .css('visibility','hidden')
1927
+ .css('display','block');
1928
+ });
1929
+ } else {
1930
+
1931
+ // hide main controls
1932
+ t.controls
1933
+ .css('visibility','hidden')
1934
+ .css('display','block');
1935
+
1936
+ // hide others
1937
+ t.container.find('.mejs-control')
1938
+ .css('visibility','hidden')
1939
+ .css('display','block');
1940
+
1941
+ t.controlsAreVisible = false;
1942
+ }
1943
+ },
1944
+
1945
+ controlsTimer: null,
1946
+
1947
+ startControlsTimer: function(timeout) {
1948
+
1949
+ var t = this;
1950
+
1951
+ timeout = typeof timeout != 'undefined' ? timeout : 1500;
1952
+
1953
+ t.killControlsTimer('start');
1954
+
1955
+ t.controlsTimer = setTimeout(function() {
1956
+ //console.log('timer fired');
1957
+ t.hideControls();
1958
+ t.killControlsTimer('hide');
1959
+ }, timeout);
1960
+ },
1961
+
1962
+ killControlsTimer: function(src) {
1963
+
1964
+ var t = this;
1965
+
1966
+ if (t.controlsTimer !== null) {
1967
+ clearTimeout(t.controlsTimer);
1968
+ delete t.controlsTimer;
1969
+ t.controlsTimer = null;
1970
+ }
1971
+ },
1972
+
1973
+ controlsEnabled: true,
1974
+
1975
+ disableControls: function() {
1976
+ var t= this;
1977
+
1978
+ t.killControlsTimer();
1979
+ t.hideControls(false);
1980
+ this.controlsEnabled = false;
1981
+ },
1982
+
1983
+ enableControls: function() {
1984
+ var t= this;
1985
+
1986
+ t.showControls(false);
1987
+
1988
+ t.controlsEnabled = true;
1989
+ },
1990
+
1991
+
1992
+ // Sets up all controls and events
1993
+ meReady: function(media, domNode) {
1994
+
1995
+
1996
+ var t = this,
1997
+ mf = mejs.MediaFeatures,
1998
+ autoplayAttr = domNode.getAttribute('autoplay'),
1999
+ autoplay = !(typeof autoplayAttr == 'undefined' || autoplayAttr === null || autoplayAttr === 'false'),
2000
+ featureIndex,
2001
+ feature;
2002
+
2003
+ // make sure it can't create itself again if a plugin reloads
2004
+ if (t.created)
2005
+ return;
2006
+ else
2007
+ t.created = true;
2008
+
2009
+ t.media = media;
2010
+ t.domNode = domNode;
2011
+
2012
+ if (!(mf.isAndroid && t.options.AndroidUseNativeControls) && !(mf.isiPad && t.options.iPadUseNativeControls) && !(mf.isiPhone && t.options.iPhoneUseNativeControls)) {
2013
+
2014
+ // two built in features
2015
+ t.buildposter(t, t.controls, t.layers, t.media);
2016
+ t.buildkeyboard(t, t.controls, t.layers, t.media);
2017
+ t.buildoverlays(t, t.controls, t.layers, t.media);
2018
+
2019
+ // grab for use by features
2020
+ t.findTracks();
2021
+
2022
+ // add user-defined features/controls
2023
+ for (featureIndex in t.options.features) {
2024
+ feature = t.options.features[featureIndex];
2025
+ if (t['build' + feature]) {
2026
+ try {
2027
+ t['build' + feature](t, t.controls, t.layers, t.media);
2028
+ } catch (e) {
2029
+ // TODO: report control error
2030
+ //throw e;
2031
+ //console.log('error building ' + feature);
2032
+ //console.log(e);
2033
+ }
2034
+ }
2035
+ }
2036
+
2037
+ t.container.trigger('controlsready');
2038
+
2039
+ // reset all layers and controls
2040
+ t.setPlayerSize(t.width, t.height);
2041
+ t.setControlsSize();
2042
+
2043
+
2044
+ // controls fade
2045
+ if (t.isVideo) {
2046
+
2047
+ if (mejs.MediaFeatures.hasTouch) {
2048
+
2049
+ // for touch devices (iOS, Android)
2050
+ // show/hide without animation on touch
2051
+
2052
+ t.$media.bind('touchstart', function() {
2053
+
2054
+
2055
+ // toggle controls
2056
+ if (t.controlsAreVisible) {
2057
+ t.hideControls(false);
2058
+ } else {
2059
+ if (t.controlsEnabled) {
2060
+ t.showControls(false);
2061
+ }
2062
+ }
2063
+ });
2064
+
2065
+ } else {
2066
+ // click controls
2067
+ var clickElement = (t.media.pluginType == 'native') ? t.$media : $(t.media.pluginElement);
2068
+
2069
+ // click to play/pause
2070
+ clickElement.click(function() {
2071
+ if (media.paused) {
2072
+ media.play();
2073
+ } else {
2074
+ media.pause();
2075
+ }
2076
+ });
2077
+
2078
+
2079
+ // show/hide controls
2080
+ t.container
2081
+ .bind('mouseenter mouseover', function () {
2082
+ if (t.controlsEnabled) {
2083
+ if (!t.options.alwaysShowControls) {
2084
+ t.killControlsTimer('enter');
2085
+ t.showControls();
2086
+ t.startControlsTimer(2500);
2087
+ }
2088
+ }
2089
+ })
2090
+ .bind('mousemove', function() {
2091
+ if (t.controlsEnabled) {
2092
+ if (!t.controlsAreVisible) {
2093
+ t.showControls();
2094
+ }
2095
+ //t.killControlsTimer('move');
2096
+ if (!t.options.alwaysShowControls) {
2097
+ t.startControlsTimer(2500);
2098
+ }
2099
+ }
2100
+ })
2101
+ .bind('mouseleave', function () {
2102
+ if (t.controlsEnabled) {
2103
+ if (!t.media.paused && !t.options.alwaysShowControls) {
2104
+ t.startControlsTimer(1000);
2105
+ }
2106
+ }
2107
+ });
2108
+ }
2109
+
2110
+ // check for autoplay
2111
+ if (autoplay && !t.options.alwaysShowControls) {
2112
+ t.hideControls();
2113
+ }
2114
+
2115
+ // resizer
2116
+ if (t.options.enableAutosize) {
2117
+ t.media.addEventListener('loadedmetadata', function(e) {
2118
+ // if the <video height> was not set and the options.videoHeight was not set
2119
+ // then resize to the real dimensions
2120
+ if (t.options.videoHeight <= 0 && t.domNode.getAttribute('height') === null && !isNaN(e.target.videoHeight)) {
2121
+ t.setPlayerSize(e.target.videoWidth, e.target.videoHeight);
2122
+ t.setControlsSize();
2123
+ t.media.setVideoSize(e.target.videoWidth, e.target.videoHeight);
2124
+ }
2125
+ }, false);
2126
+ }
2127
+ }
2128
+
2129
+ // EVENTS
2130
+
2131
+ // FOCUS: when a video starts playing, it takes focus from other players (possibily pausing them)
2132
+ media.addEventListener('play', function() {
2133
+
2134
+ // go through all other players
2135
+ for (var i=0, il=mejs.players.length; i<il; i++) {
2136
+ var p = mejs.players[i];
2137
+ if (p.id != t.id && t.options.pauseOtherPlayers && !p.paused && !p.ended) {
2138
+ p.pause();
2139
+ }
2140
+ p.hasFocus = false;
2141
+ }
2142
+
2143
+ t.hasFocus = true;
2144
+ },false);
2145
+
2146
+
2147
+ // ended for all
2148
+ t.media.addEventListener('ended', function (e) {
2149
+ try{
2150
+ t.media.setCurrentTime(0);
2151
+ } catch (exp) {
2152
+
2153
+ }
2154
+ t.media.pause();
2155
+
2156
+ if (t.setProgressRail)
2157
+ t.setProgressRail();
2158
+ if (t.setCurrentRail)
2159
+ t.setCurrentRail();
2160
+
2161
+ if (t.options.loop) {
2162
+ t.media.play();
2163
+ } else if (!t.options.alwaysShowControls && t.controlsEnabled) {
2164
+ t.showControls();
2165
+ }
2166
+ }, false);
2167
+
2168
+ // resize on the first play
2169
+ t.media.addEventListener('loadedmetadata', function(e) {
2170
+ if (t.updateDuration) {
2171
+ t.updateDuration();
2172
+ }
2173
+ if (t.updateCurrent) {
2174
+ t.updateCurrent();
2175
+ }
2176
+
2177
+ if (!t.isFullScreen) {
2178
+ t.setPlayerSize(t.width, t.height);
2179
+ t.setControlsSize();
2180
+ }
2181
+ }, false);
2182
+
2183
+
2184
+ // webkit has trouble doing this without a delay
2185
+ setTimeout(function () {
2186
+ t.setPlayerSize(t.width, t.height);
2187
+ t.setControlsSize();
2188
+ }, 50);
2189
+
2190
+ // adjust controls whenever window sizes (used to be in fullscreen only)
2191
+ $(window).resize(function() {
2192
+
2193
+ // don't resize for fullscreen mode
2194
+ if ( !(t.isFullScreen || (mejs.MediaFeatures.hasTrueNativeFullScreen && document.webkitIsFullScreen)) ) {
2195
+ t.setPlayerSize(t.width, t.height);
2196
+ }
2197
+
2198
+ // always adjust controls
2199
+ t.setControlsSize();
2200
+ });
2201
+
2202
+ // TEMP: needs to be moved somewhere else
2203
+ if (t.media.pluginType == 'youtube') {
2204
+ t.container.find('.mejs-overlay-play').hide();
2205
+ }
2206
+ }
2207
+
2208
+ // force autoplay for HTML5
2209
+ if (autoplay && media.pluginType == 'native') {
2210
+ media.load();
2211
+ media.play();
2212
+ }
2213
+
2214
+
2215
+ if (t.options.success) {
2216
+
2217
+ if (typeof t.options.success == 'string') {
2218
+ window[t.options.success](t.media, t.domNode, t);
2219
+ } else {
2220
+ t.options.success(t.media, t.domNode, t);
2221
+ }
2222
+ }
2223
+ },
2224
+
2225
+ handleError: function(e) {
2226
+ var t = this;
2227
+
2228
+ t.controls.hide();
2229
+
2230
+ // Tell user that the file cannot be played
2231
+ if (t.options.error) {
2232
+ t.options.error(e);
2233
+ }
2234
+ },
2235
+
2236
+ // added by @edsilv
2237
+ resize: function() {
2238
+ var t = this;
2239
+
2240
+ t.setPlayerSize();
2241
+ t.setControlsSize();
2242
+ },
2243
+
2244
+ // altered by @edsilv
2245
+ setPlayerSize: function() {
2246
+ var t = this;
2247
+
2248
+ if (typeof width != 'undefined')
2249
+ t.width = width;
2250
+
2251
+ if (typeof height != 'undefined')
2252
+ t.height = height;
2253
+
2254
+ // do we have the native dimensions yet?
2255
+ var nativeWidth = (t.media.videoWidth && t.media.videoWidth > 0) ? t.media.videoWidth : t.options.defaultVideoWidth;
2256
+ var nativeHeight = (t.media.videoHeight && t.media.videoHeight > 0) ? t.media.videoHeight : t.options.defaultVideoHeight;
2257
+ var ratio = nativeHeight/nativeWidth;
2258
+ var parentWidth = t.container.parent().width();
2259
+ var parentHeight = t.container.parent().height();
2260
+ var newHeight = parseInt(parentWidth * ratio, 10);
2261
+ var newWidth = parentWidth;
2262
+
2263
+ if (newHeight > parentHeight){
2264
+ newHeight = parentHeight;
2265
+ newWidth = parseInt(parentHeight / ratio, 10);
2266
+ }
2267
+
2268
+ // set outer container size
2269
+ t.container
2270
+ .width(newWidth)
2271
+ .height(newHeight);
2272
+
2273
+ // set native <video>
2274
+ t.$media
2275
+ .width('100%')
2276
+ .height('100%');
2277
+
2278
+ // set shims
2279
+ t.container.find('object, embed, iframe')
2280
+ .width('100%')
2281
+ .height('100%');
2282
+
2283
+ // if shim is ready, send the size to the embeded plugin
2284
+ if (t.media.setVideoSize)
2285
+ t.media.setVideoSize(parentWidth, newHeight);
2286
+
2287
+ // set the layers
2288
+ t.layers.children('.mejs-layer')
2289
+ .width('100%')
2290
+ .height('100%');
2291
+ },
2292
+
2293
+ setControlsSize: function() {
2294
+
2295
+ var t = this,
2296
+ usedWidth = 0,
2297
+ railWidth = 0,
2298
+ play = t.controls.find('.mejs-playpause-button'),
2299
+ rail = t.controls.find('.mejs-time-rail'),
2300
+ total = t.controls.find('.mejs-time-total'),
2301
+ currentTime = t.controls.find('.mejs-currenttime-container'),
2302
+ duration = t.controls.find('.mejs-duration-container'),
2303
+ loaded = t.controls.find('.mejs-time-loaded'),
2304
+ volume = t.controls.find('.mejs-volume-button'),
2305
+ fullscreen = t.controls.find('.mejs-fullscreen-button'),
2306
+ volumeSlider = t.controls.find('.mejs-horizontal-volume-slider');
2307
+
2308
+
2309
+ // allow the size to come from custom CSS
2310
+ if (t.options && !t.options.autosizeProgress) {
2311
+ // Also, frontends devs can be more flexible
2312
+ // due the opportunity of absolute positioning.
2313
+ railWidth = parseInt(rail.css('width'));
2314
+ }
2315
+
2316
+ // altered by @edsilv
2317
+ t.controls.width(t.controls.parent().width() - 18);
2318
+
2319
+ railWidth = t.controls.width() - play.outerWidth(true) - currentTime.outerWidth(true) - duration.outerWidth(true) - volume.outerWidth(true) - volumeSlider.outerWidth(true) - fullscreen.outerWidth(true);
2320
+
2321
+ var railLeft = rail.position().left;
2322
+
2323
+ rail.css({
2324
+ 'left': play.outerWidth(true)
2325
+ });
2326
+
2327
+ currentTime.css({
2328
+ 'left': railLeft + railWidth
2329
+ });
2330
+
2331
+ var durationLeft = railLeft + railWidth + currentTime.outerWidth(true);
2332
+
2333
+ duration.css({
2334
+ 'left': durationLeft
2335
+ });
2336
+
2337
+ var volumeLeft = railLeft + railWidth + currentTime.outerWidth(true) + duration.outerWidth(true);
2338
+
2339
+ volume.css({
2340
+ 'left': volumeLeft
2341
+ });
2342
+
2343
+ var volumeSliderLeft = railLeft + railWidth + currentTime.outerWidth(true) + duration.outerWidth(true) + volume.outerWidth(true);
2344
+
2345
+ volumeSlider.css({
2346
+ 'left': volumeSliderLeft
2347
+ });
2348
+
2349
+ var fullscreenLeft = railLeft + railWidth + currentTime.outerWidth(true) + duration.outerWidth(true) + volume.outerWidth(true) + volumeSlider.outerWidth(true);
2350
+
2351
+ fullscreen.css({
2352
+ 'left': fullscreenLeft
2353
+ });
2354
+
2355
+ // outer area
2356
+ rail.width(railWidth);
2357
+ // dark space
2358
+ total.width(railWidth - (total.outerWidth(true) - total.width()));
2359
+
2360
+ if (t.setProgressRail)
2361
+ t.setProgressRail();
2362
+ if (t.setCurrentRail)
2363
+ t.setCurrentRail();
2364
+ },
2365
+
2366
+
2367
+ buildposter: function(player, controls, layers, media) {
2368
+ var t = this,
2369
+ poster =
2370
+ $('<div class="mejs-poster mejs-layer">' +
2371
+ '</div>')
2372
+ .appendTo(layers),
2373
+ posterUrl = player.$media.attr('poster');
2374
+
2375
+ // prioriy goes to option (this is useful if you need to support iOS 3.x (iOS completely fails with poster)
2376
+ if (player.options.poster !== '') {
2377
+ posterUrl = player.options.poster;
2378
+ }
2379
+
2380
+ // second, try the real poster
2381
+ if (posterUrl !== '' && posterUrl != null) {
2382
+ t.setPoster(posterUrl);
2383
+ } else {
2384
+ poster.hide();
2385
+ }
2386
+
2387
+ media.addEventListener('play',function() {
2388
+ poster.hide();
2389
+ }, false);
2390
+ },
2391
+
2392
+ setPoster: function(url) {
2393
+ var t = this,
2394
+ posterDiv = t.container.find('.mejs-poster'),
2395
+ posterImg = posterDiv.find('img');
2396
+
2397
+ if (posterImg.length == 0) {
2398
+ posterImg = $('<img width="100%" height="100%" />').appendTo(posterDiv);
2399
+ }
2400
+
2401
+ posterImg.attr('src', url);
2402
+ },
2403
+
2404
+ buildoverlays: function(player, controls, layers, media) {
2405
+ if (!player.isVideo)
2406
+ return;
2407
+
2408
+ var
2409
+ loading =
2410
+ $('<div class="mejs-overlay mejs-layer">'+
2411
+ '<div class="mejs-overlay-loading"><span></span></div>'+
2412
+ '</div>')
2413
+ .hide() // start out hidden
2414
+ .appendTo(layers),
2415
+ error =
2416
+ $('<div class="mejs-overlay mejs-layer">'+
2417
+ '<div class="mejs-overlay-error"></div>'+
2418
+ '</div>')
2419
+ .hide() // start out hidden
2420
+ .appendTo(layers),
2421
+
2422
+ // this needs to come last so it's on top
2423
+ bigPlay =
2424
+ $('<div class="mejs-overlay mejs-layer mejs-overlay-play">'+
2425
+ '<div class="mejs-overlay-button"></div>'+
2426
+ '</div>')
2427
+ .appendTo(layers)
2428
+ .click(function() {
2429
+ if (media.paused) {
2430
+ media.play();
2431
+ } else {
2432
+ media.pause();
2433
+ }
2434
+ });
2435
+
2436
+ /*
2437
+ if (mejs.MediaFeatures.isiOS || mejs.MediaFeatures.isAndroid) {
2438
+ bigPlay.remove();
2439
+ loading.remove();
2440
+ }
2441
+ */
2442
+
2443
+
2444
+ // show/hide big play button
2445
+ media.addEventListener('play',function() {
2446
+ bigPlay.hide();
2447
+ loading.hide();
2448
+ error.hide();
2449
+ }, false);
2450
+
2451
+ media.addEventListener('playing', function() {
2452
+ bigPlay.hide();
2453
+ loading.hide();
2454
+ error.hide();
2455
+ }, false);
2456
+
2457
+ media.addEventListener('pause',function() {
2458
+ if (!mejs.MediaFeatures.isiPhone) {
2459
+ bigPlay.show();
2460
+ }
2461
+ }, false);
2462
+
2463
+ media.addEventListener('waiting', function() {
2464
+ loading.show();
2465
+ }, false);
2466
+
2467
+
2468
+ // show/hide loading
2469
+ media.addEventListener('loadeddata',function() {
2470
+ // for some reason Chrome is firing this event
2471
+ //if (mejs.MediaFeatures.isChrome && media.getAttribute && media.getAttribute('preload') === 'none')
2472
+ // return;
2473
+
2474
+ loading.show();
2475
+ }, false);
2476
+ media.addEventListener('canplay',function() {
2477
+ loading.hide();
2478
+ }, false);
2479
+
2480
+ // error handling
2481
+ media.addEventListener('error',function() {
2482
+ loading.hide();
2483
+ error.show();
2484
+ error.find('mejs-overlay-error').html("Error loading this resource");
2485
+ }, false);
2486
+ },
2487
+
2488
+ buildkeyboard: function(player, controls, layers, media) {
2489
+
2490
+ var t = this;
2491
+
2492
+ // listen for key presses
2493
+ $(document).keydown(function(e) {
2494
+
2495
+ if (player.hasFocus && player.options.enableKeyboard) {
2496
+
2497
+ // find a matching key
2498
+ for (var i=0, il=player.options.keyActions.length; i<il; i++) {
2499
+ var keyAction = player.options.keyActions[i];
2500
+
2501
+ for (var j=0, jl=keyAction.keys.length; j<jl; j++) {
2502
+ if (e.keyCode == keyAction.keys[j]) {
2503
+ e.preventDefault();
2504
+ keyAction.action(player, media);
2505
+ return false;
2506
+ }
2507
+ }
2508
+ }
2509
+ }
2510
+
2511
+ return true;
2512
+ });
2513
+
2514
+ // check if someone clicked outside a player region, then kill its focus
2515
+ $(document).click(function(event) {
2516
+ if ($(event.target).closest('.mejs-container').length == 0) {
2517
+ player.hasFocus = false;
2518
+ }
2519
+ });
2520
+
2521
+ },
2522
+
2523
+ findTracks: function() {
2524
+ var t = this,
2525
+ tracktags = t.$media.find('track');
2526
+
2527
+ // store for use by plugins
2528
+ t.tracks = [];
2529
+ tracktags.each(function(index, track) {
2530
+
2531
+ track = $(track);
2532
+
2533
+ t.tracks.push({
2534
+ srclang: track.attr('srclang').toLowerCase(),
2535
+ src: track.attr('src'),
2536
+ kind: track.attr('kind'),
2537
+ label: track.attr('label') || '',
2538
+ entries: [],
2539
+ isLoaded: false
2540
+ });
2541
+ });
2542
+ },
2543
+ changeSkin: function(className) {
2544
+ this.container[0].className = 'mejs-container ' + className;
2545
+ this.setPlayerSize(this.width, this.height);
2546
+ this.setControlsSize();
2547
+ },
2548
+ play: function() {
2549
+ this.media.play();
2550
+ },
2551
+ pause: function() {
2552
+ this.media.pause();
2553
+ },
2554
+ load: function() {
2555
+ this.media.load();
2556
+ },
2557
+ setMuted: function(muted) {
2558
+ this.media.setMuted(muted);
2559
+ },
2560
+ setCurrentTime: function(time) {
2561
+ this.media.setCurrentTime(time);
2562
+ },
2563
+ getCurrentTime: function() {
2564
+ return this.media.currentTime;
2565
+ },
2566
+ setVolume: function(volume) {
2567
+ this.media.setVolume(volume);
2568
+ },
2569
+ getVolume: function() {
2570
+ return this.media.volume;
2571
+ },
2572
+ setSrc: function(src) {
2573
+ this.media.setSrc(src);
2574
+ },
2575
+ remove: function() {
2576
+ var t = this;
2577
+
2578
+ if (t.media.pluginType == 'flash') {
2579
+ t.media.remove();
2580
+ } else if (t.media.pluginType == 'native') {
2581
+ t.media.prop('controls', true);
2582
+ }
2583
+
2584
+ // grab video and put it back in place
2585
+ if (!t.isDynamic) {
2586
+ t.$node.insertBefore(t.container)
2587
+ }
2588
+
2589
+ t.container.remove();
2590
+ }
2591
+ };
2592
+
2593
+ // turn into jQuery plugin
2594
+ if (typeof jQuery != 'undefined') {
2595
+ jQuery.fn.mediaelementplayer = function (options) {
2596
+ return this.each(function () {
2597
+ new mejs.MediaElementPlayer(this, options);
2598
+ });
2599
+ };
2600
+ }
2601
+
2602
+ $(document).ready(function() {
2603
+ // auto enable using JSON attribute
2604
+ $('.mejs-player').mediaelementplayer();
2605
+ });
2606
+
2607
+ // push out to window
2608
+ window.MediaElementPlayer = mejs.MediaElementPlayer;
2609
+
2610
+ })(mejs.$);
2611
+
2612
+ (function($) {
2613
+
2614
+ $.extend(mejs.MepDefaults, {
2615
+ playpauseText: 'Play/Pause'
2616
+ });
2617
+
2618
+ // PLAY/pause BUTTON
2619
+ $.extend(MediaElementPlayer.prototype, {
2620
+ buildplaypause: function(player, controls, layers, media) {
2621
+ var
2622
+ t = this,
2623
+ play =
2624
+ $('<div class="mejs-button mejs-playpause-button mejs-play" >' +
2625
+ '<button type="button" aria-controls="' + t.id + '" title="' + t.options.playpauseText + '"></button>' +
2626
+ '</div>')
2627
+ .appendTo(controls)
2628
+ .click(function(e) {
2629
+ e.preventDefault();
2630
+
2631
+ if (media.paused) {
2632
+ media.play();
2633
+ } else {
2634
+ media.pause();
2635
+ }
2636
+
2637
+ return false;
2638
+ });
2639
+
2640
+ media.addEventListener('play',function() {
2641
+ play.removeClass('mejs-play').addClass('mejs-pause');
2642
+ }, false);
2643
+ media.addEventListener('playing',function() {
2644
+ play.removeClass('mejs-play').addClass('mejs-pause');
2645
+ }, false);
2646
+
2647
+
2648
+ media.addEventListener('pause',function() {
2649
+ play.removeClass('mejs-pause').addClass('mejs-play');
2650
+ }, false);
2651
+ media.addEventListener('paused',function() {
2652
+ play.removeClass('mejs-pause').addClass('mejs-play');
2653
+ }, false);
2654
+ }
2655
+ });
2656
+
2657
+ })(mejs.$);
2658
+ (function($) {
2659
+
2660
+ $.extend(mejs.MepDefaults, {
2661
+ stopText: 'Stop'
2662
+ });
2663
+
2664
+ // STOP BUTTON
2665
+ $.extend(MediaElementPlayer.prototype, {
2666
+ buildstop: function(player, controls, layers, media) {
2667
+ var t = this,
2668
+ stop =
2669
+ $('<div class="mejs-button mejs-stop-button mejs-stop">' +
2670
+ '<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '"></button>' +
2671
+ '</div>')
2672
+ .appendTo(controls)
2673
+ .click(function() {
2674
+ if (!media.paused) {
2675
+ media.pause();
2676
+ }
2677
+ if (media.currentTime > 0) {
2678
+ media.setCurrentTime(0);
2679
+ controls.find('.mejs-time-current').width('0px');
2680
+ controls.find('.mejs-time-handle').css('left', '0px');
2681
+ controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
2682
+ controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
2683
+ layers.find('.mejs-poster').show();
2684
+ }
2685
+ });
2686
+ }
2687
+ });
2688
+
2689
+ })(mejs.$);
2690
+ (function($) {
2691
+ // progress/loaded bar
2692
+ $.extend(MediaElementPlayer.prototype, {
2693
+ buildprogress: function(player, controls, layers, media) {
2694
+
2695
+ $('<div class="mejs-time-rail">'+
2696
+ '<span class="mejs-time-total">'+
2697
+ '<span class="mejs-time-loaded"></span>'+
2698
+ '<span class="mejs-time-current"></span>'+
2699
+ '<span class="mejs-time-handle"></span>'+
2700
+ '<div class="mejs-time-float">' +
2701
+ '<div class="mejs-time-float-current">00:00</div>' +
2702
+ '<div class="mejs-time-float-corner"></div>' +
2703
+ '</div>'+
2704
+ '</span>'+
2705
+ '</div>')
2706
+ .appendTo(controls);
2707
+
2708
+ var
2709
+ t = this,
2710
+ total = controls.find('.mejs-time-total'),
2711
+ loaded = controls.find('.mejs-time-loaded'),
2712
+ current = controls.find('.mejs-time-current'),
2713
+ handle = controls.find('.mejs-time-handle'),
2714
+ timefloat = controls.find('.mejs-time-float'),
2715
+ timefloatcurrent = controls.find('.mejs-time-float-current'),
2716
+ handleMouseMove = function (e) {
2717
+ // mouse position relative to the object
2718
+
2719
+ // touch handling added by @edsilv
2720
+ var x;
2721
+
2722
+ if (e.type === 'touchmove'){
2723
+ x = e.originalEvent.touches[0].pageX;
2724
+ } else {
2725
+ x = e.pageX;
2726
+ }
2727
+
2728
+ var offset = total.offset(),
2729
+ width = total.outerWidth(),
2730
+ percentage = 0,
2731
+ newTime = 0,
2732
+ pos = x - offset.left;
2733
+
2734
+
2735
+ if (x > offset.left && x <= width + offset.left && media.duration) {
2736
+ percentage = ((x - offset.left) / width);
2737
+ newTime = (percentage <= 0.02) ? 0 : percentage * media.duration;
2738
+
2739
+ // seek to where the mouse is
2740
+ if (mouseIsDown) {
2741
+ media.setCurrentTime(newTime);
2742
+ }
2743
+
2744
+ // position floating time box
2745
+ if (!mejs.MediaFeatures.hasTouch) {
2746
+ timefloat.css('left', pos);
2747
+ timefloatcurrent.html( mejs.Utility.secondsToTimeCode(newTime) );
2748
+ timefloat.show();
2749
+ }
2750
+ }
2751
+ },
2752
+ mouseIsDown = false,
2753
+ mouseIsOver = false;
2754
+
2755
+ // handle clicks
2756
+ //controls.find('.mejs-time-rail').delegate('span', 'click', handleMouseMove);
2757
+ total
2758
+ .bind('mousedown touchstart', function (e) {
2759
+ // only handle left clicks
2760
+ if (e.which === 1 || e.type === 'touchstart') {
2761
+ mouseIsDown = true;
2762
+ handleMouseMove(e);
2763
+ return false;
2764
+ }
2765
+ });
2766
+
2767
+ controls.find('.mejs-time-total')
2768
+ .bind('mouseenter', function(e) {
2769
+ mouseIsOver = true;
2770
+ if (!mejs.MediaFeatures.hasTouch) {
2771
+ timefloat.show();
2772
+ }
2773
+ })
2774
+ .bind('mouseleave',function(e) {
2775
+ mouseIsOver = false;
2776
+ timefloat.hide();
2777
+ });
2778
+
2779
+ $(document)
2780
+ .bind('mouseup touchend', function (e) {
2781
+ mouseIsDown = false;
2782
+ timefloat.hide();
2783
+ //handleMouseMove(e);
2784
+ })
2785
+ .bind('mousemove touchmove', function (e) {
2786
+ if (mouseIsDown || mouseIsOver) {
2787
+ handleMouseMove(e);
2788
+ }
2789
+ });
2790
+
2791
+ // loading
2792
+ media.addEventListener('progress', function (e) {
2793
+ player.setProgressRail(e);
2794
+ player.setCurrentRail(e);
2795
+ }, false);
2796
+
2797
+ // current time
2798
+ media.addEventListener('timeupdate', function(e) {
2799
+ player.setProgressRail(e);
2800
+ player.setCurrentRail(e);
2801
+ }, false);
2802
+
2803
+
2804
+ // store for later use
2805
+ t.loaded = loaded;
2806
+ t.total = total;
2807
+ t.current = current;
2808
+ t.handle = handle;
2809
+ },
2810
+ setProgressRail: function(e) {
2811
+
2812
+ var
2813
+ t = this,
2814
+ target = (e != undefined) ? e.target : t.media,
2815
+ percent = null;
2816
+
2817
+ // newest HTML5 spec has buffered array (FF4, Webkit)
2818
+ if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) {
2819
+ // TODO: account for a real array with multiple values (only Firefox 4 has this so far)
2820
+ percent = target.buffered.end(0) / target.duration;
2821
+ }
2822
+ // Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end()
2823
+ // to be anything other than 0. If the byte count is available we use this instead.
2824
+ // Browsers that support the else if do not seem to have the bufferedBytes value and
2825
+ // should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6, IE 7/8.
2826
+ else if (target && target.bytesTotal != undefined && target.bytesTotal > 0 && target.bufferedBytes != undefined) {
2827
+ percent = target.bufferedBytes / target.bytesTotal;
2828
+ }
2829
+ // Firefox 3 with an Ogg file seems to go this way
2830
+ else if (e && e.lengthComputable && e.total != 0) {
2831
+ percent = e.loaded/e.total;
2832
+ }
2833
+
2834
+ // finally update the progress bar
2835
+ if (percent !== null) {
2836
+ percent = Math.min(1, Math.max(0, percent));
2837
+ // update loaded bar
2838
+ if (t.loaded && t.total) {
2839
+ t.loaded.width(t.total.width() * percent);
2840
+ }
2841
+ }
2842
+ },
2843
+ setCurrentRail: function() {
2844
+
2845
+ var t = this;
2846
+
2847
+ if (t.media.currentTime != undefined && t.media.duration) {
2848
+
2849
+ // update bar and handle
2850
+ if (t.total && t.handle) {
2851
+ var
2852
+ newWidth = t.total.width() * t.media.currentTime / t.media.duration,
2853
+ handlePos = newWidth - (t.handle.outerWidth(true) / 2);
2854
+
2855
+ t.current.width(newWidth);
2856
+ t.handle.css('left', handlePos);
2857
+ }
2858
+ }
2859
+
2860
+ }
2861
+ });
2862
+ })(mejs.$);
2863
+ (function($) {
2864
+
2865
+ // options
2866
+ $.extend(mejs.MepDefaults, {
2867
+ duration: -1,
2868
+ timeAndDurationSeparator: ' <span> | </span> '
2869
+ });
2870
+
2871
+
2872
+ // current and duration 00:00 / 00:00
2873
+ $.extend(MediaElementPlayer.prototype, {
2874
+ buildcurrent: function(player, controls, layers, media) {
2875
+ var t = this;
2876
+
2877
+ $('<div class="mejs-time">'+
2878
+ '<span class="mejs-currenttime">' + (player.options.alwaysShowHours ? '00:' : '')
2879
+ + (player.options.showTimecodeFrameCount? '00:00:00':'00:00')+ '</span><span class="slash">/</span>'+
2880
+ '</div>')
2881
+ .appendTo(controls);
2882
+
2883
+ t.currenttime = t.controls.find('.mejs-currenttime');
2884
+
2885
+ media.addEventListener('timeupdate',function() {
2886
+ player.updateCurrent();
2887
+ }, false);
2888
+ },
2889
+
2890
+
2891
+ buildduration: function(player, controls, layers, media) {
2892
+ var t = this;
2893
+
2894
+ if (controls.children().last().find('.mejs-currenttime').length > 0) {
2895
+ $(t.options.timeAndDurationSeparator +
2896
+ '<span class="mejs-duration">' +
2897
+ (t.options.duration > 0 ?
2898
+ mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) :
2899
+ ((player.options.alwaysShowHours ? '00:' : '') + (player.options.showTimecodeFrameCount? '00:00:00':'00:00'))
2900
+ ) +
2901
+ '</span>')
2902
+ .appendTo(controls.find('.mejs-time'));
2903
+ } else {
2904
+
2905
+ // add class to current time
2906
+ controls.find('.mejs-currenttime').parent().addClass('mejs-currenttime-container');
2907
+
2908
+ $('<div class="mejs-time mejs-duration-container">'+
2909
+ '<span class="mejs-duration">' +
2910
+ (t.options.duration > 0 ?
2911
+ mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) :
2912
+ ((player.options.alwaysShowHours ? '00:' : '') + (player.options.showTimecodeFrameCount? '00:00:00':'00:00'))
2913
+ ) +
2914
+ '</span>' +
2915
+ '</div>')
2916
+ .appendTo(controls);
2917
+ }
2918
+
2919
+ t.durationD = t.controls.find('.mejs-duration');
2920
+
2921
+ media.addEventListener('timeupdate',function() {
2922
+ player.updateDuration();
2923
+ }, false);
2924
+ },
2925
+
2926
+ updateCurrent: function() {
2927
+ var t = this;
2928
+
2929
+ if (t.currenttime) {
2930
+ t.currenttime.html(mejs.Utility.secondsToTimeCode(t.media.currentTime, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25));
2931
+ }
2932
+ },
2933
+
2934
+ updateDuration: function() {
2935
+ var t = this;
2936
+
2937
+ if (t.media.duration && t.durationD) {
2938
+ t.durationD.html(mejs.Utility.secondsToTimeCode(t.media.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25));
2939
+ }
2940
+ }
2941
+ });
2942
+
2943
+ })(mejs.$);
2944
+ (function($) {
2945
+
2946
+ $.extend(mejs.MepDefaults, {
2947
+ muteText: 'Volume/mute toggle',
2948
+ hideVolumeOnTouchDevices: true,
2949
+
2950
+ audioVolume: 'horizontal',
2951
+ videoVolume: 'vertical'
2952
+ });
2953
+
2954
+ $.extend(MediaElementPlayer.prototype, {
2955
+ buildvolume: function(player, controls, layers, media) {
2956
+
2957
+ // Android and iOS don't support volume controls
2958
+ if (mejs.MediaFeatures.hasTouch && this.options.hideVolumeOnTouchDevices)
2959
+ return;
2960
+
2961
+ var t = this,
2962
+ mode = (t.isVideo) ? t.options.videoVolume : t.options.audioVolume,
2963
+ mute = (mode == 'horizontal') ?
2964
+
2965
+ // horizontal version
2966
+ $('<div class="mejs-button mejs-volume-button mejs-mute">'+
2967
+ '<button type="button" aria-controls="' + t.id + '" title="' + t.options.muteText + '"></button>'+
2968
+ '</div>' +
2969
+ '<div class="mejs-horizontal-volume-slider">'+ // outer background
2970
+ '<div class="mejs-horizontal-volume-total"></div>'+ // line background
2971
+ '<div class="mejs-horizontal-volume-current"></div>'+ // current volume
2972
+ '<div class="mejs-horizontal-volume-handle"></div>'+ // handle
2973
+ '</div>'
2974
+ )
2975
+ .appendTo(controls) :
2976
+
2977
+ // vertical version
2978
+ $('<div class="mejs-button mejs-volume-button mejs-mute">'+
2979
+ '<button type="button" aria-controls="' + t.id + '" title="' + t.options.muteText + '"></button>'+
2980
+ '<div class="mejs-volume-slider">'+ // outer background
2981
+ '<div class="mejs-volume-total"></div>'+ // line background
2982
+ '<div class="mejs-volume-current"></div>'+ // current volume
2983
+ '<div class="mejs-volume-handle"></div>'+ // handle
2984
+ '</div>'+
2985
+ '</div>')
2986
+ .appendTo(controls),
2987
+ volumeSlider = t.container.find('.mejs-volume-slider, .mejs-horizontal-volume-slider'),
2988
+ volumeTotal = t.container.find('.mejs-volume-total, .mejs-horizontal-volume-total'),
2989
+ volumeCurrent = t.container.find('.mejs-volume-current, .mejs-horizontal-volume-current'),
2990
+ volumeHandle = t.container.find('.mejs-volume-handle, .mejs-horizontal-volume-handle'),
2991
+
2992
+ positionVolumeHandle = function(volume, secondTry) {
2993
+
2994
+ if (!volumeSlider.is(':visible') && typeof secondTry != 'undefined') {
2995
+ volumeSlider.show();
2996
+ positionVolumeHandle(volume, true);
2997
+ volumeSlider.hide()
2998
+ return;
2999
+ }
3000
+
3001
+ // correct to 0-1
3002
+ volume = Math.max(0,volume);
3003
+ volume = Math.min(volume,1);
3004
+
3005
+ // ajust mute button style
3006
+ if (volume == 0) {
3007
+ mute.removeClass('mejs-mute').addClass('mejs-unmute');
3008
+ } else {
3009
+ mute.removeClass('mejs-unmute').addClass('mejs-mute');
3010
+ }
3011
+
3012
+ // position slider
3013
+ if (mode == 'vertical') {
3014
+ var
3015
+
3016
+ // height of the full size volume slider background
3017
+ totalHeight = volumeTotal.height(),
3018
+
3019
+ // top/left of full size volume slider background
3020
+ totalPosition = volumeTotal.position(),
3021
+
3022
+ // the new top position based on the current volume
3023
+ // 70% volume on 100px height == top:30px
3024
+ newTop = totalHeight - (totalHeight * volume);
3025
+
3026
+ // handle
3027
+ volumeHandle.css('top', totalPosition.top + newTop - (volumeHandle.height() / 2));
3028
+
3029
+ // show the current visibility
3030
+ volumeCurrent.height(totalHeight - newTop );
3031
+ //volumeCurrent.height(totalHeight);
3032
+ //console.log(totalPosition.top);
3033
+ volumeCurrent.css('top', totalPosition.top + newTop);
3034
+ //volumeCurrent.css('top', totalPosition.top);
3035
+ } else {
3036
+ var
3037
+
3038
+ // height of the full size volume slider background
3039
+ totalWidth = volumeTotal.width(),
3040
+
3041
+ // top/left of full size volume slider background
3042
+ totalPosition = volumeTotal.position(),
3043
+
3044
+ // the new left position based on the current volume
3045
+ newLeft = totalWidth * volume;
3046
+
3047
+ // handle
3048
+ volumeHandle.css('left', totalPosition.left + newLeft - (volumeHandle.width() / 2));
3049
+
3050
+ // rezize the current part of the volume bar
3051
+ volumeCurrent.width( newLeft );
3052
+ }
3053
+ },
3054
+ handleVolumeMove = function(e) {
3055
+
3056
+ var volume = null,
3057
+ totalOffset = volumeTotal.offset();
3058
+
3059
+ // calculate the new volume based on the moust position
3060
+ if (mode == 'vertical') {
3061
+
3062
+ var
3063
+ railHeight = volumeTotal.height(),
3064
+ totalTop = parseInt(volumeTotal.css('top').replace(/px/,''),10),
3065
+ newY = e.pageY - totalOffset.top;
3066
+
3067
+ volume = (railHeight - newY) / railHeight;
3068
+
3069
+ // the controls just hide themselves (usually when mouse moves too far up)
3070
+ if (totalOffset.top == 0 || totalOffset.left == 0)
3071
+ return;
3072
+
3073
+ } else {
3074
+ var
3075
+ railWidth = volumeTotal.width(),
3076
+ newX = e.pageX - totalOffset.left;
3077
+
3078
+ volume = newX / railWidth;
3079
+ }
3080
+
3081
+ // ensure the volume isn't outside 0-1
3082
+ volume = Math.max(0,volume);
3083
+ volume = Math.min(volume,1);
3084
+
3085
+ // position the slider and handle
3086
+ positionVolumeHandle(volume);
3087
+
3088
+ // set the media object (this will trigger the volumechanged event)
3089
+ if (volume == 0) {
3090
+ media.setMuted(true);
3091
+ } else {
3092
+ media.setMuted(false);
3093
+ }
3094
+ media.setVolume(volume);
3095
+ },
3096
+ mouseIsDown = false,
3097
+ mouseIsOver = false;
3098
+
3099
+ // SLIDER
3100
+
3101
+ mute
3102
+ .hover(function() {
3103
+ volumeSlider.show();
3104
+ mouseIsOver = true;
3105
+ }, function() {
3106
+ mouseIsOver = false;
3107
+
3108
+ if (!mouseIsDown && mode == 'vertical') {
3109
+ volumeSlider.hide();
3110
+ }
3111
+ });
3112
+
3113
+ volumeSlider
3114
+ .bind('mouseover', function() {
3115
+ mouseIsOver = true;
3116
+ })
3117
+ .bind('mousedown', function (e) {
3118
+ handleVolumeMove(e);
3119
+ mouseIsDown = true;
3120
+
3121
+ return false;
3122
+ });
3123
+
3124
+ $(document)
3125
+ .bind('mouseup', function (e) {
3126
+ mouseIsDown = false;
3127
+
3128
+ if (!mouseIsOver && mode == 'vertical') {
3129
+ volumeSlider.hide();
3130
+ }
3131
+ })
3132
+ .bind('mousemove', function (e) {
3133
+ if (mouseIsDown) {
3134
+ handleVolumeMove(e);
3135
+ }
3136
+ });
3137
+
3138
+
3139
+ // MUTE button
3140
+ mute.find('button').click(function() {
3141
+ media.setMuted( !media.muted );
3142
+ });
3143
+
3144
+ // listen for volume change events from other sources
3145
+ media.addEventListener('volumechange', function(e) {
3146
+ if (!mouseIsDown) {
3147
+ if (media.muted) {
3148
+ positionVolumeHandle(0);
3149
+ mute.removeClass('mejs-mute').addClass('mejs-unmute');
3150
+ } else {
3151
+ positionVolumeHandle(media.volume);
3152
+ mute.removeClass('mejs-unmute').addClass('mejs-mute');
3153
+ }
3154
+ }
3155
+ }, false);
3156
+
3157
+ if (t.container.is(':visible')) {
3158
+ // set initial volume
3159
+ positionVolumeHandle(player.options.startVolume);
3160
+
3161
+ // shim gets the startvolume as a parameter, but we have to set it on the native <video> and <audio> elements
3162
+ if (media.pluginType === 'native') {
3163
+ media.setVolume(player.options.startVolume);
3164
+ }
3165
+ }
3166
+ }
3167
+ });
3168
+
3169
+ })(mejs.$);
3170
+
3171
+ (function($) {
3172
+
3173
+ $.extend(mejs.MepDefaults, {
3174
+ usePluginFullScreen: true,
3175
+ newWindowCallback: function() { return '';},
3176
+ fullscreenText: 'Fullscreen'
3177
+ });
3178
+
3179
+ $.extend(MediaElementPlayer.prototype, {
3180
+
3181
+ isFullScreen: false,
3182
+
3183
+ isNativeFullScreen: false,
3184
+
3185
+ docStyleOverflow: null,
3186
+
3187
+ isInIframe: false,
3188
+
3189
+ buildfullscreen: function(player, controls, layers, media) {
3190
+
3191
+ if (!player.isVideo)
3192
+ return;
3193
+
3194
+ player.isInIframe = (window.location != window.parent.location);
3195
+
3196
+ // native events
3197
+ if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
3198
+
3199
+ // chrome doesn't alays fire this in an iframe
3200
+ player.container.bind(mejs.MediaFeatures.fullScreenEventName, function(e) {
3201
+ //player.container.bind('webkitfullscreenchange', function(e) {
3202
+
3203
+
3204
+ if (mejs.MediaFeatures.isFullScreen()) {
3205
+ player.isNativeFullScreen = true;
3206
+ // reset the controls once we are fully in full screen
3207
+ player.setControlsSize();
3208
+ } else {
3209
+ player.isNativeFullScreen = false;
3210
+ // when a user presses ESC
3211
+ // make sure to put the player back into place
3212
+ player.exitFullScreen();
3213
+ }
3214
+ });
3215
+ }
3216
+
3217
+ var t = this,
3218
+ normalHeight = 0,
3219
+ normalWidth = 0,
3220
+ container = player.container,
3221
+ fullscreenBtn =
3222
+ $('<div class="mejs-button mejs-fullscreen-button">' +
3223
+ '<button type="button" aria-controls="' + t.id + '" title="' + t.options.fullscreenText + '"></button>' +
3224
+ '</div>')
3225
+ .appendTo(controls);
3226
+
3227
+ if (t.media.pluginType === 'native' || (!t.options.usePluginFullScreen && !mejs.MediaFeatures.isFirefox)) {
3228
+
3229
+ fullscreenBtn.click(function() {
3230
+ var isFullScreen = (mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || player.isFullScreen;
3231
+
3232
+ if (isFullScreen) {
3233
+ player.exitFullScreen();
3234
+ } else {
3235
+ player.enterFullScreen();
3236
+ }
3237
+ });
3238
+
3239
+ } else {
3240
+
3241
+ // @edsilv: remove play overlay for flash version as it obscures full screen button.
3242
+ if (mejs.MediaFeatures.isFirefox){
3243
+ t.container.find('.mejs-overlay-play').remove();
3244
+ }
3245
+
3246
+ var hideTimeout = null,
3247
+ supportsPointerEvents = (document.documentElement.style.pointerEvents === '');
3248
+
3249
+ // @edsilv: IE7 and 8 don't support clicking through the fullscreen buttons
3250
+ // down to Flash.
3251
+ if (supportsPointerEvents && !mejs.MediaFeatures.isOpera) { // opera doesn't allow this :(
3252
+
3253
+ // allows clicking through the fullscreen button and controls down directly to Flash
3254
+
3255
+ /*
3256
+ When a user puts his mouse over the fullscreen button, the controls are disabled
3257
+ So we put a div over the video and another one on iether side of the fullscreen button
3258
+ that caputre mouse movement
3259
+ and restore the controls once the mouse moves outside of the fullscreen button
3260
+ */
3261
+
3262
+ var fullscreenIsDisabled = false,
3263
+ restoreControls = function() {
3264
+ if (fullscreenIsDisabled) {
3265
+ // hide the hovers
3266
+ videoHoverDiv.hide();
3267
+ controlsLeftHoverDiv.hide();
3268
+ controlsRightHoverDiv.hide();
3269
+
3270
+ // restore the control bar
3271
+ fullscreenBtn.css('pointer-events', '');
3272
+ t.controls.css('pointer-events', '');
3273
+
3274
+ // store for later
3275
+ fullscreenIsDisabled = false;
3276
+ }
3277
+ },
3278
+ videoHoverDiv = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls),
3279
+ controlsLeftHoverDiv = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls),
3280
+ controlsRightHoverDiv = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls),
3281
+ positionHoverDivs = function() {
3282
+ var style = {position: 'absolute', top: 0, left: 0}; //, backgroundColor: '#f00'};
3283
+ videoHoverDiv.css(style);
3284
+ controlsLeftHoverDiv.css(style);
3285
+ controlsRightHoverDiv.css(style);
3286
+
3287
+ // over video, but not controls
3288
+ videoHoverDiv
3289
+ .width( t.container.width() )
3290
+ .height( t.container.height() - t.controls.height() );
3291
+
3292
+ // over controls, but not the fullscreen button
3293
+ var fullScreenBtnOffset = fullscreenBtn.offset().left - t.container.offset().left;
3294
+ fullScreenBtnWidth = fullscreenBtn.outerWidth(true);
3295
+
3296
+ controlsLeftHoverDiv
3297
+ .width( fullScreenBtnOffset )
3298
+ .height( t.controls.height() )
3299
+ .css({top: t.container.height() - t.controls.height()});
3300
+
3301
+ // after the fullscreen button
3302
+ controlsRightHoverDiv
3303
+ .width( t.container.width() - fullScreenBtnOffset - fullScreenBtnWidth )
3304
+ .height( t.controls.height() )
3305
+ .css({top: t.container.height() - t.controls.height(),
3306
+ left: fullScreenBtnOffset + fullScreenBtnWidth});
3307
+ };
3308
+
3309
+ $(document).resize(function() {
3310
+ positionHoverDivs();
3311
+ });
3312
+
3313
+ // on hover, kill the fullscreen button's HTML handling, allowing clicks down to Flash
3314
+ fullscreenBtn
3315
+ .mouseover(function() {
3316
+
3317
+ if (!t.isFullScreen) {
3318
+
3319
+ var buttonPos = fullscreenBtn.offset(),
3320
+ containerPos = player.container.offset();
3321
+
3322
+ // move the button in Flash into place
3323
+ media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top, false);
3324
+
3325
+ // allows click through
3326
+ fullscreenBtn.css('pointer-events', 'none');
3327
+ t.controls.css('pointer-events', 'none');
3328
+
3329
+ // show the divs that will restore things
3330
+ videoHoverDiv.show();
3331
+ controlsRightHoverDiv.show();
3332
+ controlsLeftHoverDiv.show();
3333
+ positionHoverDivs();
3334
+
3335
+ fullscreenIsDisabled = true;
3336
+ }
3337
+
3338
+ });
3339
+
3340
+ // restore controls anytime the user enters or leaves fullscreen
3341
+ media.addEventListener('fullscreenchange', function(e) {
3342
+ restoreControls();
3343
+ });
3344
+
3345
+
3346
+ // the mouseout event doesn't work on the fullscren button, because we already killed the pointer-events
3347
+ // so we use the document.mousemove event to restore controls when the mouse moves outside the fullscreen button
3348
+ /*
3349
+ $(document).mousemove(function(e) {
3350
+
3351
+ // if the mouse is anywhere but the fullsceen button, then restore it all
3352
+ if (fullscreenIsDisabled) {
3353
+
3354
+ var fullscreenBtnPos = fullscreenBtn.offset();
3355
+
3356
+
3357
+ if (e.pageY < fullscreenBtnPos.top || e.pageY > fullscreenBtnPos.top + fullscreenBtn.outerHeight(true) ||
3358
+ e.pageX < fullscreenBtnPos.left || e.pageX > fullscreenBtnPos.left + fullscreenBtn.outerWidth(true)
3359
+ ) {
3360
+
3361
+ fullscreenBtn.css('pointer-events', '');
3362
+ t.controls.css('pointer-events', '');
3363
+
3364
+ fullscreenIsDisabled = false;
3365
+ }
3366
+ }
3367
+ });
3368
+ */
3369
+
3370
+
3371
+ } else {
3372
+
3373
+ // the hover state will show the fullscreen button in Flash to hover up and click
3374
+
3375
+ fullscreenBtn
3376
+ .mouseover(function() {
3377
+
3378
+ if (hideTimeout !== null) {
3379
+ clearTimeout(hideTimeout);
3380
+ delete hideTimeout;
3381
+ }
3382
+
3383
+ var buttonPos = fullscreenBtn.offset(),
3384
+ containerPos = player.container.offset();
3385
+
3386
+ media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top, true);
3387
+
3388
+ })
3389
+ .mouseout(function() {
3390
+
3391
+ if (hideTimeout !== null) {
3392
+ clearTimeout(hideTimeout);
3393
+ delete hideTimeout;
3394
+ }
3395
+
3396
+ hideTimeout = setTimeout(function() {
3397
+ media.hideFullscreenButton();
3398
+ }, 1500);
3399
+
3400
+
3401
+ });
3402
+ }
3403
+ }
3404
+
3405
+ player.fullscreenBtn = fullscreenBtn;
3406
+
3407
+ $(document).bind('keydown',function (e) {
3408
+ if (((mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || t.isFullScreen) && e.keyCode == 27) {
3409
+ player.exitFullScreen();
3410
+ }
3411
+ });
3412
+
3413
+ },
3414
+ enterFullScreen: function(dispatchEvent) {
3415
+
3416
+ var t = this;
3417
+
3418
+ // firefox+flash can't adjust plugin sizes without resetting :(
3419
+ if (t.media.pluginType !== 'native' && (mejs.MediaFeatures.isFirefox || t.options.usePluginFullScreen)) {
3420
+ //t.media.setFullscreen(true);
3421
+ //player.isFullScreen = true;
3422
+ return;
3423
+ }
3424
+
3425
+ // store overflow
3426
+ docStyleOverflow = document.documentElement.style.overflow;
3427
+ // set it to not show scroll bars so 100% will work
3428
+ document.documentElement.style.overflow = 'hidden';
3429
+
3430
+ // store sizing
3431
+ normalHeight = t.container.height();
3432
+ normalWidth = t.container.width();
3433
+
3434
+ // attempt to do true fullscreen (Safari 5.1 and Firefox Nightly only for now)
3435
+ if (t.media.pluginType === 'native') {
3436
+ if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
3437
+
3438
+ mejs.MediaFeatures.requestFullScreen(t.container[0]);
3439
+ //return;
3440
+
3441
+ if (t.isInIframe) {
3442
+ // sometimes exiting from fullscreen doesn't work
3443
+ // notably in Chrome <iframe>. Fixed in version 17
3444
+ setTimeout(function checkFullscreen() {
3445
+
3446
+ if (t.isNativeFullScreen) {
3447
+
3448
+ // check if the video is suddenly not really fullscreen
3449
+ if ($(window).width() !== screen.width) {
3450
+ // manually exit
3451
+ t.exitFullScreen();
3452
+ } else {
3453
+ // test again
3454
+ setTimeout(checkFullscreen, 500);
3455
+ }
3456
+ }
3457
+
3458
+
3459
+ }, 500);
3460
+ }
3461
+
3462
+ } else if (mejs.MediaFeatures.hasSemiNativeFullScreen) {
3463
+ t.media.webkitEnterFullscreen();
3464
+ return;
3465
+ }
3466
+ }
3467
+
3468
+ // check for iframe launch
3469
+ if (t.isInIframe) {
3470
+ var url = t.options.newWindowCallback(this);
3471
+
3472
+
3473
+ if (url !== '') {
3474
+
3475
+ // launch immediately
3476
+ if (!mejs.MediaFeatures.hasTrueNativeFullScreen) {
3477
+ t.pause();
3478
+ window.open(url, t.id, 'top=0,left=0,width=' + screen.availWidth + ',height=' + screen.availHeight + ',resizable=yes,scrollbars=no,status=no,toolbar=no');
3479
+ return;
3480
+ } else {
3481
+ setTimeout(function() {
3482
+ if (!t.isNativeFullScreen) {
3483
+ t.pause();
3484
+ window.open(url, t.id, 'top=0,left=0,width=' + screen.availWidth + ',height=' + screen.availHeight + ',resizable=yes,scrollbars=no,status=no,toolbar=no');
3485
+ }
3486
+ }, 250);
3487
+ }
3488
+ }
3489
+
3490
+ }
3491
+
3492
+ // full window code
3493
+
3494
+
3495
+
3496
+ // make full size
3497
+ t.container
3498
+ .addClass('mejs-container-fullscreen')
3499
+ .width('100%')
3500
+ .height('100%');
3501
+ //.css({position: 'fixed', left: 0, top: 0, right: 0, bottom: 0, overflow: 'hidden', width: '100%', height: '100%', 'z-index': 1000});
3502
+
3503
+ // Only needed for safari 5.1 native full screen, can cause display issues elsewhere
3504
+ // Actually, it seems to be needed for IE8, too
3505
+ //if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
3506
+ setTimeout(function() {
3507
+ t.container.css({width: '100%', height: '100%'});
3508
+ t.setControlsSize();
3509
+ }, 500);
3510
+ //}
3511
+
3512
+ if (t.pluginType === 'native') {
3513
+ t.$media
3514
+ .width('100%')
3515
+ .height('100%');
3516
+ } else {
3517
+ t.container.find('object, embed, iframe')
3518
+ .width('100%')
3519
+ .height('100%');
3520
+
3521
+ //if (!mejs.MediaFeatures.hasTrueNativeFullScreen) {
3522
+ t.media.setVideoSize($(window).width(),$(window).height());
3523
+ //}
3524
+ }
3525
+
3526
+ t.layers.children('div')
3527
+ .width('100%')
3528
+ .height('100%');
3529
+
3530
+ if (t.fullscreenBtn) {
3531
+ t.fullscreenBtn
3532
+ .removeClass('mejs-fullscreen')
3533
+ .addClass('mejs-unfullscreen');
3534
+ }
3535
+
3536
+ t.setControlsSize();
3537
+ t.isFullScreen = true;
3538
+
3539
+ // added by @edsilv
3540
+ if (dispatchEvent == false){
3541
+ return;
3542
+ }else{
3543
+ $(window).trigger('enterfullscreen');
3544
+ }
3545
+ },
3546
+
3547
+ // altered by @edsilv
3548
+ exitFullScreen: function(dispatchEvent) {
3549
+
3550
+ var t = this;
3551
+
3552
+ // firefox can't adjust plugins
3553
+ if (t.media.pluginType !== 'native' && mejs.MediaFeatures.isFirefox) {
3554
+ t.media.setFullscreen(false);
3555
+ //player.isFullScreen = false;
3556
+ return;
3557
+ }
3558
+
3559
+ // come outo of native fullscreen
3560
+ if (mejs.MediaFeatures.hasTrueNativeFullScreen && (mejs.MediaFeatures.isFullScreen() || t.isFullScreen)) {
3561
+ mejs.MediaFeatures.cancelFullScreen();
3562
+ }
3563
+
3564
+ // restore scroll bars to document
3565
+ if (typeof(docStyleOverflow) !== 'undefined') document.documentElement.style.overflow = docStyleOverflow;
3566
+
3567
+ if (typeof(normalWidth) !== 'undefined' &&
3568
+ typeof(normalHeight) !== 'undefined'){
3569
+ t.container
3570
+ .removeClass('mejs-container-fullscreen')
3571
+ .width(normalWidth)
3572
+ .height(normalHeight);
3573
+ //.css({position: '', left: '', top: '', right: '', bottom: '', overflow: 'inherit', width: normalWidth + 'px', height: normalHeight + 'px', 'z-index': 1});
3574
+
3575
+ if (t.pluginType === 'native') {
3576
+ t.$media
3577
+ .width(normalWidth)
3578
+ .height(normalHeight);
3579
+ } else {
3580
+ t.container.find('object embed')
3581
+ .width(normalWidth)
3582
+ .height(normalHeight);
3583
+
3584
+ t.media.setVideoSize(normalWidth, normalHeight);
3585
+ }
3586
+
3587
+ t.layers.children('div')
3588
+ .width(normalWidth)
3589
+ .height(normalHeight);
3590
+ }
3591
+
3592
+ t.fullscreenBtn
3593
+ .removeClass('mejs-unfullscreen')
3594
+ .addClass('mejs-fullscreen');
3595
+
3596
+ t.setControlsSize();
3597
+ t.isFullScreen = false;
3598
+
3599
+ // added by @edsilv
3600
+ if (dispatchEvent == false){
3601
+ return;
3602
+ }else{
3603
+ $(window).trigger('enterfullscreen');
3604
+ }
3605
+ }
3606
+ });
3607
+
3608
+ })(mejs.$);
3609
+
3610
+ (function($) {
3611
+
3612
+ // add extra default options
3613
+ $.extend(mejs.MepDefaults, {
3614
+ // this will automatically turn on a <track>
3615
+ startLanguage: '',
3616
+
3617
+ tracksText: 'Captions/Subtitles'
3618
+ });
3619
+
3620
+ $.extend(MediaElementPlayer.prototype, {
3621
+
3622
+ hasChapters: false,
3623
+
3624
+ buildtracks: function(player, controls, layers, media) {
3625
+ if (!player.isVideo)
3626
+ return;
3627
+
3628
+ if (player.tracks.length == 0)
3629
+ return;
3630
+
3631
+ var t= this, i, options = '';
3632
+
3633
+ player.chapters =
3634
+ $('<div class="mejs-chapters mejs-layer"></div>')
3635
+ .prependTo(layers).hide();
3636
+ player.captions =
3637
+ $('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position"><span class="mejs-captions-text"></span></div></div>')
3638
+ .prependTo(layers).hide();
3639
+ player.captionsText = player.captions.find('.mejs-captions-text');
3640
+ player.captionsButton =
3641
+ $('<div class="mejs-button mejs-captions-button">'+
3642
+ '<button type="button" aria-controls="' + t.id + '" title="' + t.options.tracksText + '"></button>'+
3643
+ '<div class="mejs-captions-selector">'+
3644
+ '<ul>'+
3645
+ '<li>'+
3646
+ '<input type="radio" name="' + player.id + '_captions" id="' + player.id + '_captions_none" value="none" checked="checked" />' +
3647
+ '<label for="' + player.id + '_captions_none">None</label>'+
3648
+ '</li>' +
3649
+ '</ul>'+
3650
+ '</div>'+
3651
+ '</div>')
3652
+ .appendTo(controls)
3653
+
3654
+ // hover
3655
+ .hover(function() {
3656
+ $(this).find('.mejs-captions-selector').css('visibility','visible');
3657
+ }, function() {
3658
+ $(this).find('.mejs-captions-selector').css('visibility','hidden');
3659
+ })
3660
+
3661
+ // handle clicks to the language radio buttons
3662
+ .delegate('input[type=radio]','click',function() {
3663
+ lang = this.value;
3664
+
3665
+ if (lang == 'none') {
3666
+ player.selectedTrack = null;
3667
+ } else {
3668
+ for (i=0; i<player.tracks.length; i++) {
3669
+ if (player.tracks[i].srclang == lang) {
3670
+ player.selectedTrack = player.tracks[i];
3671
+ player.captions.attr('lang', player.selectedTrack.srclang);
3672
+ player.displayCaptions();
3673
+ break;
3674
+ }
3675
+ }
3676
+ }
3677
+ });
3678
+ //.bind('mouseenter', function() {
3679
+ // player.captionsButton.find('.mejs-captions-selector').css('visibility','visible')
3680
+ //});
3681
+
3682
+ if (!player.options.alwaysShowControls) {
3683
+ // move with controls
3684
+ player.container
3685
+ .bind('mouseenter', function () {
3686
+ // push captions above controls
3687
+ player.container.find('.mejs-captions-position').addClass('mejs-captions-position-hover');
3688
+
3689
+ })
3690
+ .bind('mouseleave', function () {
3691
+ if (!media.paused) {
3692
+ // move back to normal place
3693
+ player.container.find('.mejs-captions-position').removeClass('mejs-captions-position-hover');
3694
+ }
3695
+ });
3696
+ } else {
3697
+ player.container.find('.mejs-captions-position').addClass('mejs-captions-position-hover');
3698
+ }
3699
+
3700
+ player.trackToLoad = -1;
3701
+ player.selectedTrack = null;
3702
+ player.isLoadingTrack = false;
3703
+
3704
+
3705
+
3706
+ // add to list
3707
+ for (i=0; i<player.tracks.length; i++) {
3708
+ if (player.tracks[i].kind == 'subtitles') {
3709
+ player.addTrackButton(player.tracks[i].srclang, player.tracks[i].label);
3710
+ }
3711
+ }
3712
+
3713
+ player.loadNextTrack();
3714
+
3715
+
3716
+ media.addEventListener('timeupdate',function(e) {
3717
+ player.displayCaptions();
3718
+ }, false);
3719
+
3720
+ media.addEventListener('loadedmetadata', function(e) {
3721
+ player.displayChapters();
3722
+ }, false);
3723
+
3724
+ player.container.hover(
3725
+ function () {
3726
+ // chapters
3727
+ if (player.hasChapters) {
3728
+ player.chapters.css('visibility','visible');
3729
+ player.chapters.fadeIn(200);
3730
+ }
3731
+ },
3732
+ function () {
3733
+ if (player.hasChapters && !media.paused) {
3734
+ player.chapters.fadeOut(200, function() {
3735
+ $(this).css('visibility','hidden');
3736
+ $(this).css('display','block');
3737
+ });
3738
+ }
3739
+ });
3740
+
3741
+ // check for autoplay
3742
+ if (player.node.getAttribute('autoplay') !== null) {
3743
+ player.chapters.css('visibility','hidden');
3744
+ }
3745
+ },
3746
+
3747
+ loadNextTrack: function() {
3748
+ var t = this;
3749
+
3750
+ t.trackToLoad++;
3751
+ if (t.trackToLoad < t.tracks.length) {
3752
+ t.isLoadingTrack = true;
3753
+ t.loadTrack(t.trackToLoad);
3754
+ } else {
3755
+ // add done?
3756
+ t.isLoadingTrack = false;
3757
+ }
3758
+ },
3759
+
3760
+ loadTrack: function(index){
3761
+ var
3762
+ t = this,
3763
+ track = t.tracks[index],
3764
+ after = function() {
3765
+
3766
+ track.isLoaded = true;
3767
+
3768
+ // create button
3769
+ //t.addTrackButton(track.srclang);
3770
+ t.enableTrackButton(track.srclang, track.label);
3771
+
3772
+ t.loadNextTrack();
3773
+
3774
+ };
3775
+
3776
+ if (track.isTranslation) {
3777
+
3778
+ // translate the first track
3779
+ mejs.TrackFormatParser.translateTrackText(t.tracks[0].entries, t.tracks[0].srclang, track.srclang, t.options.googleApiKey, function(newOne) {
3780
+
3781
+ // store the new translation
3782
+ track.entries = newOne;
3783
+
3784
+ after();
3785
+ });
3786
+
3787
+ } else {
3788
+ $.ajax({
3789
+ url: track.src,
3790
+ success: function(d) {
3791
+
3792
+ // parse the loaded file
3793
+ track.entries = mejs.TrackFormatParser.parse(d);
3794
+ after();
3795
+
3796
+ if (track.kind == 'chapters' && t.media.duration > 0) {
3797
+ t.drawChapters(track);
3798
+ }
3799
+ },
3800
+ error: function() {
3801
+ t.loadNextTrack();
3802
+ }
3803
+ });
3804
+ }
3805
+ },
3806
+
3807
+ enableTrackButton: function(lang, label) {
3808
+ var t = this;
3809
+
3810
+ if (label === '') {
3811
+ label = mejs.language.codes[lang] || lang;
3812
+ }
3813
+
3814
+ t.captionsButton
3815
+ .find('input[value=' + lang + ']')
3816
+ .prop('disabled',false)
3817
+ .siblings('label')
3818
+ .html( label );
3819
+
3820
+ // auto select
3821
+ if (t.options.startLanguage == lang) {
3822
+ $('#' + t.id + '_captions_' + lang).click();
3823
+ }
3824
+
3825
+ t.adjustLanguageBox();
3826
+ },
3827
+
3828
+ addTrackButton: function(lang, label) {
3829
+ var t = this;
3830
+ if (label === '') {
3831
+ label = mejs.language.codes[lang] || lang;
3832
+ }
3833
+
3834
+ t.captionsButton.find('ul').append(
3835
+ $('<li>'+
3836
+ '<input type="radio" name="' + t.id + '_captions" id="' + t.id + '_captions_' + lang + '" value="' + lang + '" disabled="disabled" />' +
3837
+ '<label for="' + t.id + '_captions_' + lang + '">' + label + ' (loading)' + '</label>'+
3838
+ '</li>')
3839
+ );
3840
+
3841
+ t.adjustLanguageBox();
3842
+
3843
+ // remove this from the dropdownlist (if it exists)
3844
+ t.container.find('.mejs-captions-translations option[value=' + lang + ']').remove();
3845
+ },
3846
+
3847
+ adjustLanguageBox:function() {
3848
+ var t = this;
3849
+ // adjust the size of the outer box
3850
+ t.captionsButton.find('.mejs-captions-selector').height(
3851
+ t.captionsButton.find('.mejs-captions-selector ul').outerHeight(true) +
3852
+ t.captionsButton.find('.mejs-captions-translations').outerHeight(true)
3853
+ );
3854
+ },
3855
+
3856
+ displayCaptions: function() {
3857
+
3858
+ if (typeof this.tracks == 'undefined')
3859
+ return;
3860
+
3861
+ var
3862
+ t = this,
3863
+ i,
3864
+ track = t.selectedTrack;
3865
+
3866
+ if (track != null && track.isLoaded) {
3867
+ for (i=0; i<track.entries.times.length; i++) {
3868
+ if (t.media.currentTime >= track.entries.times[i].start && t.media.currentTime <= track.entries.times[i].stop){
3869
+ t.captionsText.html(track.entries.text[i]);
3870
+ t.captions.show();
3871
+ return; // exit out if one is visible;
3872
+ }
3873
+ }
3874
+ t.captions.hide();
3875
+ } else {
3876
+ t.captions.hide();
3877
+ }
3878
+ },
3879
+
3880
+ displayChapters: function() {
3881
+ var
3882
+ t = this,
3883
+ i;
3884
+
3885
+ for (i=0; i<t.tracks.length; i++) {
3886
+ if (t.tracks[i].kind == 'chapters' && t.tracks[i].isLoaded) {
3887
+ t.drawChapters(t.tracks[i]);
3888
+ t.hasChapters = true;
3889
+ break;
3890
+ }
3891
+ }
3892
+ },
3893
+
3894
+ drawChapters: function(chapters) {
3895
+ var
3896
+ t = this,
3897
+ i,
3898
+ dur,
3899
+ //width,
3900
+ //left,
3901
+ percent = 0,
3902
+ usedPercent = 0;
3903
+
3904
+ t.chapters.empty();
3905
+
3906
+ for (i=0; i<chapters.entries.times.length; i++) {
3907
+ dur = chapters.entries.times[i].stop - chapters.entries.times[i].start;
3908
+ percent = Math.floor(dur / t.media.duration * 100);
3909
+ if (percent + usedPercent > 100 || // too large
3910
+ i == chapters.entries.times.length-1 && percent + usedPercent < 100) // not going to fill it in
3911
+ {
3912
+ percent = 100 - usedPercent;
3913
+ }
3914
+ //width = Math.floor(t.width * dur / t.media.duration);
3915
+ //left = Math.floor(t.width * chapters.entries.times[i].start / t.media.duration);
3916
+ //if (left + width > t.width) {
3917
+ // width = t.width - left;
3918
+ //}
3919
+
3920
+ t.chapters.append( $(
3921
+ '<div class="mejs-chapter" rel="' + chapters.entries.times[i].start + '" style="left: ' + usedPercent.toString() + '%;width: ' + percent.toString() + '%;">' +
3922
+ '<div class="mejs-chapter-block' + ((i==chapters.entries.times.length-1) ? ' mejs-chapter-block-last' : '') + '">' +
3923
+ '<span class="ch-title">' + chapters.entries.text[i] + '</span>' +
3924
+ '<span class="ch-time">' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].start) + '&ndash;' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].stop) + '</span>' +
3925
+ '</div>' +
3926
+ '</div>'));
3927
+ usedPercent += percent;
3928
+ }
3929
+
3930
+ t.chapters.find('div.mejs-chapter').click(function() {
3931
+ t.media.setCurrentTime( parseFloat( $(this).attr('rel') ) );
3932
+ if (t.media.paused) {
3933
+ t.media.play();
3934
+ }
3935
+ });
3936
+
3937
+ t.chapters.show();
3938
+ }
3939
+ });
3940
+
3941
+
3942
+
3943
+ mejs.language = {
3944
+ codes: {
3945
+ af:'Afrikaans',
3946
+ sq:'Albanian',
3947
+ ar:'Arabic',
3948
+ be:'Belarusian',
3949
+ bg:'Bulgarian',
3950
+ ca:'Catalan',
3951
+ zh:'Chinese',
3952
+ 'zh-cn':'Chinese Simplified',
3953
+ 'zh-tw':'Chinese Traditional',
3954
+ hr:'Croatian',
3955
+ cs:'Czech',
3956
+ da:'Danish',
3957
+ nl:'Dutch',
3958
+ en:'English',
3959
+ et:'Estonian',
3960
+ tl:'Filipino',
3961
+ fi:'Finnish',
3962
+ fr:'French',
3963
+ gl:'Galician',
3964
+ de:'German',
3965
+ el:'Greek',
3966
+ ht:'Haitian Creole',
3967
+ iw:'Hebrew',
3968
+ hi:'Hindi',
3969
+ hu:'Hungarian',
3970
+ is:'Icelandic',
3971
+ id:'Indonesian',
3972
+ ga:'Irish',
3973
+ it:'Italian',
3974
+ ja:'Japanese',
3975
+ ko:'Korean',
3976
+ lv:'Latvian',
3977
+ lt:'Lithuanian',
3978
+ mk:'Macedonian',
3979
+ ms:'Malay',
3980
+ mt:'Maltese',
3981
+ no:'Norwegian',
3982
+ fa:'Persian',
3983
+ pl:'Polish',
3984
+ pt:'Portuguese',
3985
+ //'pt-pt':'Portuguese (Portugal)',
3986
+ ro:'Romanian',
3987
+ ru:'Russian',
3988
+ sr:'Serbian',
3989
+ sk:'Slovak',
3990
+ sl:'Slovenian',
3991
+ es:'Spanish',
3992
+ sw:'Swahili',
3993
+ sv:'Swedish',
3994
+ tl:'Tagalog',
3995
+ th:'Thai',
3996
+ tr:'Turkish',
3997
+ uk:'Ukrainian',
3998
+ vi:'Vietnamese',
3999
+ cy:'Welsh',
4000
+ yi:'Yiddish'
4001
+ }
4002
+ };
4003
+
4004
+ /*
4005
+ Parses WebVVT format which should be formatted as
4006
+ ================================
4007
+ WEBVTT
4008
+
4009
+ 1
4010
+ 00:00:01,1 --> 00:00:05,000
4011
+ A line of text
4012
+
4013
+ 2
4014
+ 00:01:15,1 --> 00:02:05,000
4015
+ A second line of text
4016
+
4017
+ ===============================
4018
+
4019
+ Adapted from: http://www.delphiki.com/html5/playr
4020
+ */
4021
+ mejs.TrackFormatParser = {
4022
+ // match start "chapter-" (or anythingelse)
4023
+ pattern_identifier: /^([a-zA-z]+-)?[0-9]+$/,
4024
+ pattern_timecode: /^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,
4025
+
4026
+ split2: function (text, regex) {
4027
+ // normal version for compliant browsers
4028
+ // see below for IE fix
4029
+ return text.split(regex);
4030
+ },
4031
+ parse: function(trackText) {
4032
+ var
4033
+ i = 0,
4034
+ lines = this.split2(trackText, /\r?\n/),
4035
+ entries = {text:[], times:[]},
4036
+ timecode,
4037
+ text;
4038
+
4039
+ for(; i<lines.length; i++) {
4040
+ // check for the line number
4041
+ if (this.pattern_identifier.exec(lines[i])){
4042
+ // skip to the next line where the start --> end time code should be
4043
+ i++;
4044
+ timecode = this.pattern_timecode.exec(lines[i]);
4045
+
4046
+ if (timecode && i<lines.length){
4047
+ i++;
4048
+ // grab all the (possibly multi-line) text that follows
4049
+ text = lines[i];
4050
+ i++;
4051
+ while(lines[i] !== '' && i<lines.length){
4052
+ text = text + '\n' + lines[i];
4053
+ i++;
4054
+ }
4055
+
4056
+ // Text is in a different array so I can use .join
4057
+ entries.text.push(text);
4058
+ entries.times.push(
4059
+ {
4060
+ start: mejs.Utility.timeCodeToSeconds(timecode[1]),
4061
+ stop: mejs.Utility.timeCodeToSeconds(timecode[3]),
4062
+ settings: timecode[5]
4063
+ });
4064
+ }
4065
+ }
4066
+ }
4067
+
4068
+ return entries;
4069
+ }
4070
+ };
4071
+
4072
+ // test for browsers with bad String.split method.
4073
+ if ('x\n\ny'.split(/\n/gi).length != 3) {
4074
+ // add super slow IE8 and below version
4075
+ mejs.TrackFormatParser.split2 = function(text, regex) {
4076
+ var
4077
+ parts = [],
4078
+ chunk = '',
4079
+ i;
4080
+
4081
+ for (i=0; i<text.length; i++) {
4082
+ chunk += text.substring(i,i+1);
4083
+ if (regex.test(chunk)) {
4084
+ parts.push(chunk.replace(regex, ''));
4085
+ chunk = '';
4086
+ }
4087
+ }
4088
+ parts.push(chunk);
4089
+ return parts;
4090
+ }
4091
+ }
4092
+
4093
+ })(mejs.$);
4094
+
4095
+ /*
4096
+ * ContextMenu Plugin
4097
+ *
4098
+ *
4099
+ */
4100
+
4101
+ (function($) {
4102
+
4103
+ $.extend(mejs.MepDefaults,
4104
+ { 'contextMenuItems': [
4105
+ // demo of a fullscreen option
4106
+ {
4107
+ render: function(player) {
4108
+
4109
+ // check for fullscreen plugin
4110
+ if (typeof player.enterFullScreen == 'undefined')
4111
+ return null;
4112
+
4113
+ if (player.isFullScreen) {
4114
+ return "Turn off Fullscreen";
4115
+ } else {
4116
+ return "Go Fullscreen";
4117
+ }
4118
+ },
4119
+ click: function(player) {
4120
+ if (player.isFullScreen) {
4121
+ player.exitFullScreen();
4122
+ } else {
4123
+ player.enterFullScreen();
4124
+ }
4125
+ }
4126
+ }
4127
+ ,
4128
+ // demo of a mute/unmute button
4129
+ {
4130
+ render: function(player) {
4131
+ if (player.media.muted) {
4132
+ return "Unmute";
4133
+ } else {
4134
+ return "Mute";
4135
+ }
4136
+ },
4137
+ click: function(player) {
4138
+ if (player.media.muted) {
4139
+ player.setMuted(false);
4140
+ } else {
4141
+ player.setMuted(true);
4142
+ }
4143
+ }
4144
+ },
4145
+ // separator
4146
+ {
4147
+ isSeparator: true
4148
+ }
4149
+ ,
4150
+ // demo of simple download video
4151
+ {
4152
+ render: function(player) {
4153
+ return "Download Video";
4154
+ },
4155
+ click: function(player) {
4156
+ window.location.href = player.media.currentSrc;
4157
+ }
4158
+ }
4159
+ ]}
4160
+ );
4161
+
4162
+
4163
+ $.extend(MediaElementPlayer.prototype, {
4164
+ buildcontextmenu: function(player, controls, layers, media) {
4165
+
4166
+ // create context menu
4167
+ player.contextMenu = $('<div class="mejs-contextmenu"></div>')
4168
+ .appendTo($('body'))
4169
+ .hide();
4170
+
4171
+ // create events for showing context menu
4172
+ player.container.bind('contextmenu', function(e) {
4173
+ if (player.isContextMenuEnabled) {
4174
+ e.preventDefault();
4175
+ player.renderContextMenu(e.clientX-1, e.clientY-1);
4176
+ return false;
4177
+ }
4178
+ });
4179
+ player.container.bind('click', function() {
4180
+ player.contextMenu.hide();
4181
+ });
4182
+ player.contextMenu.bind('mouseleave', function() {
4183
+
4184
+ //console.log('context hover out');
4185
+ player.startContextMenuTimer();
4186
+
4187
+ });
4188
+ },
4189
+
4190
+ isContextMenuEnabled: true,
4191
+ enableContextMenu: function() {
4192
+ this.isContextMenuEnabled = true;
4193
+ },
4194
+ disableContextMenu: function() {
4195
+ this.isContextMenuEnabled = false;
4196
+ },
4197
+
4198
+ contextMenuTimeout: null,
4199
+ startContextMenuTimer: function() {
4200
+ //console.log('startContextMenuTimer');
4201
+
4202
+ var t = this;
4203
+
4204
+ t.killContextMenuTimer();
4205
+
4206
+ t.contextMenuTimer = setTimeout(function() {
4207
+ t.hideContextMenu();
4208
+ t.killContextMenuTimer();
4209
+ }, 750);
4210
+ },
4211
+ killContextMenuTimer: function() {
4212
+ var timer = this.contextMenuTimer;
4213
+
4214
+ //console.log('killContextMenuTimer', timer);
4215
+
4216
+ if (timer != null) {
4217
+ clearTimeout(timer);
4218
+ delete timer;
4219
+ timer = null;
4220
+ }
4221
+ },
4222
+
4223
+ hideContextMenu: function() {
4224
+ this.contextMenu.hide();
4225
+ },
4226
+
4227
+ renderContextMenu: function(x,y) {
4228
+
4229
+ // alway re-render the items so that things like "turn fullscreen on" and "turn fullscreen off" are always written correctly
4230
+ var t = this,
4231
+ html = '',
4232
+ items = t.options.contextMenuItems;
4233
+
4234
+ for (var i=0, il=items.length; i<il; i++) {
4235
+
4236
+ if (items[i].isSeparator) {
4237
+ html += '<div class="mejs-contextmenu-separator"></div>';
4238
+ } else {
4239
+
4240
+ var rendered = items[i].render(t);
4241
+
4242
+ // render can return null if the item doesn't need to be used at the moment
4243
+ if (rendered != null) {
4244
+ html += '<div class="mejs-contextmenu-item" data-itemindex="' + i + '" id="element-' + (Math.random()*1000000) + '">' + rendered + '</div>';
4245
+ }
4246
+ }
4247
+ }
4248
+
4249
+ // position and show the context menu
4250
+ t.contextMenu
4251
+ .empty()
4252
+ .append($(html))
4253
+ .css({top:y, left:x})
4254
+ .show();
4255
+
4256
+ // bind events
4257
+ t.contextMenu.find('.mejs-contextmenu-item').each(function() {
4258
+
4259
+ // which one is this?
4260
+ var $dom = $(this),
4261
+ itemIndex = parseInt( $dom.data('itemindex'), 10 ),
4262
+ item = t.options.contextMenuItems[itemIndex];
4263
+
4264
+ // bind extra functionality?
4265
+ if (typeof item.show != 'undefined')
4266
+ item.show( $dom , t);
4267
+
4268
+ // bind click action
4269
+ $dom.click(function() {
4270
+ // perform click action
4271
+ if (typeof item.click != 'undefined')
4272
+ item.click(t);
4273
+
4274
+ // close
4275
+ t.contextMenu.hide();
4276
+ });
4277
+ });
4278
+
4279
+ // stop the controls from hiding
4280
+ setTimeout(function() {
4281
+ t.killControlsTimer('rev3');
4282
+ }, 100);
4283
+
4284
+ }
4285
+ });
4286
+
4287
+ })(mejs.$);
4288
+