翻译:羊牧东岭

原文地址:https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/

用例

将音视频内容拆分为多个文件是很常见的做法。本专题展示了如何使用单个画布 (Canvas) 对此类内容进行建模。使用单个画布的好处是跨文件连续播放,浏览器可以显示这些文件的总的持续时间,从而为用户提供一种聚合性的观看收听体验。

实施说明

本例的实现基于音视频内容的目录,但会使用两个视频文件,分别作为示例歌剧的每一幕,并注释在同一画布上:Atto Primo 指向 #t=0,而 Atto Secondo 指向 #t=3971.24 (紧接在 Atto Primo 结束之后),从而确保二者能连续播放。将歌剧的两幕作为注释包含在同一个注释页面上,从概念上讲更有意义,因为它们都指向同一画布。

这部歌剧涵盖了画布的整个长度,并为两幕而划分为两个范围 (Range)。Atto Primo 为前奏曲和第一曲提供了一个范围 (Range),然后为该幕的其余部分提供了另一个范围 (Range)。为简单起见,未将 Atto Secondo 部分予以细分。

为展示更多上下文环境,例子中添加了元数据和缩略图属性。这里的实现类似于书籍的章节,但嵌套可能更深。

例子

JSON-LD | 在Universal Viewer中查看

  1. {
  2. "@context": "http://iiif.io/api/presentation/3/context.json",
  3. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/manifest.json",
  4. "type": "Manifest",
  5. "label": {
  6. "it": [
  7. "L'Elisir D'Amore"
  8. ],
  9. "en": [
  10. "The Elixir of Love"
  11. ]
  12. },
  13. "metadata": [
  14. {
  15. "label": {
  16. "en": [
  17. "Date Issued"
  18. ]
  19. },
  20. "value": {
  21. "en": [
  22. "2019"
  23. ]
  24. }
  25. },
  26. {
  27. "label": {
  28. "en": [
  29. "Publisher"
  30. ]
  31. },
  32. "value": {
  33. "en": [
  34. "Indiana University Jacobs School of Music"
  35. ]
  36. }
  37. }
  38. ],
  39. "items": [
  40. {
  41. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1",
  42. "type": "Canvas",
  43. "width": 1920,
  44. "height": 1080,
  45. "duration": 7278.422,
  46. "items": [
  47. {
  48. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1/annotation_page/1",
  49. "type": "AnnotationPage",
  50. "items": [
  51. {
  52. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1/annotation_page/1/annotation/1",
  53. "type": "Annotation",
  54. "motivation": "painting",
  55. "target": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1#t=0,3971.24",
  56. "body": {
  57. "id": "https://fixtures.iiif.io/video/indiana/donizetti-elixir/vae0637_accessH264_low_act_1.mp4",
  58. "type": "Video",
  59. "format": "video/mp4",
  60. "height": 1080,
  61. "width": 1920,
  62. "duration": 3971.24
  63. }
  64. },
  65. {
  66. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1/annotation_page/1/annotation/2",
  67. "type": "Annotation",
  68. "motivation": "painting",
  69. "target": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1#t=3971.24",
  70. "body": {
  71. "id": "https://fixtures.iiif.io/video/indiana/donizetti-elixir/vae0637_accessH264_low_act_2.mp4",
  72. "type": "Video",
  73. "format": "video/mp4",
  74. "height": 1080,
  75. "width": 1920,
  76. "duration": 3307.22
  77. }
  78. }
  79. ]
  80. }
  81. ],
  82. "thumbnail": [
  83. {
  84. "id": "https://fixtures.iiif.io/video/indiana/donizetti-elixir/act1-thumbnail.png",
  85. "type": "Image"
  86. }
  87. ]
  88. }
  89. ],
  90. "structures": [
  91. {
  92. "type": "Range",
  93. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/range/1",
  94. "label": {
  95. "it": [
  96. "Gaetano Donizetti, L'Elisir D'Amore"
  97. ]
  98. },
  99. "items": [
  100. {
  101. "type": "Range",
  102. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/range/2",
  103. "label": {
  104. "it": [
  105. "Atto Primo"
  106. ]
  107. },
  108. "items": [
  109. {
  110. "type": "Range",
  111. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/range/3",
  112. "label": {
  113. "it": [
  114. "Preludio e Coro d'introduzione – Bel conforto al mietitore"
  115. ]
  116. },
  117. "items": [
  118. {
  119. "type": "Canvas",
  120. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1#t=0,302.05"
  121. }
  122. ]
  123. },
  124. {
  125. "type": "Range",
  126. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/range/4",
  127. "label": {
  128. "en": [
  129. "Remainder of Atto Primo"
  130. ]
  131. },
  132. "items": [
  133. {
  134. "type": "Canvas",
  135. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1#t=302.05,3971.24"
  136. }
  137. ]
  138. }
  139. ]
  140. },
  141. {
  142. "type": "Range",
  143. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/range/5",
  144. "label": {
  145. "it": [
  146. "Atto Secondo"
  147. ]
  148. },
  149. "items": [
  150. {
  151. "type": "Canvas",
  152. "id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1#t=3971.24,7278.422"
  153. }
  154. ]
  155. }
  156. ]
  157. }
  158. ]
  159. }

相关专题