Open 2SC1815J opened 3 years ago
Canvas.getContent(page: number | string)
could return either the index or by id. Did that recipe come from the cookbook? Looks like both pages have the same Identifier, which could cause issues!
Would be interested to know the desired user interface when a viewer comes across more than one annotation page associated with a canvas. Is this to be interpreted in a similar way to layers?
Thanks for your comment and for adding the feature so quickly #87 !
That recipe comes from the cookbook, https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/. As far as I read the intent of the recipe, I don't know why they didn't make it like this.
{
"id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1",
"type": "Canvas",
"width": 1920,
"height": 1080,
"duration": 7278.46,
"items": [
{
"id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1/annotation_page/1",
"type": "AnnotationPage",
"items": [
{
"id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1/annotation_page/1/annotation/1",
"type": "Annotation",
"motivation": "painting",
"target": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1#t=0,3971.24",
"body": {
"id": "https://fixtures.iiif.io/video/indiana/donizetti-elixir/vae0637_accessH264_low.mp4",
"type": "Video",
"format": "video/mp4",
"height": 1080,
"width": 1920,
"duration": 3971.24
}
},
{
"id": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1/annotation_page/1/annotation/2",
"type": "Annotation",
"motivation": "painting",
"target": "https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/canvas/1#t=3971.24",
"body": {
"id": "https://fixtures.iiif.io/video/indiana/donizetti-elixir/vae0637_accessH264_low_act_2.mp4",
"type": "Video",
"format": "video/mp4",
"height": 1080,
"width": 1920,
"duration": 3307.22
}
}
]
}
]
}
Aside from that recipe's appropriateness, the specification allows for Canvas to have multiple AnnotaionPage, so it would be interesting to know if what kind of behavior the people who set up the specification had in mind as desirable.
In the recipe provided at https://iiif.io/api/cookbook/recipe/0064-opera-one-canvas/, one
Canvas
has twoAnnotationPage
objects.Canvas.getContent()
does not seem to be able to get the second AnnotationPage content.Currently, this output goes as follows.
This seems to be because only the first element is processed in the line shown below. https://github.com/IIIF-Commons/manifesto/blob/master/src/Canvas.ts#L150
I don't know if this is an issue that the recipe needs to be fixed or
Canvas.getContent()
needs to be improved. If the modification ofCanvas.getContent()
causes backward compatibility issues, you might consider creating new methods, such asCanvas.getContents()
,Canvas.getContentByIndex()
, etc. If the recipe should be modified, please let me know. I'll report it to the recipe repository.