mirador-annotation-editor-video 0.0.21 → 0.0.22

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.
package/demo/src/index.js CHANGED
@@ -13,6 +13,7 @@ const config = {
13
13
  {manifestId: "https://files.tetras-libre.fr/dev/youtube_withannot.json"},
14
14
  {manifestId: "https://files.tetras-libre.fr/dev/peertube.json"},
15
15
  {manifestId: "https://files.tetras-libre.fr/dev/cats_simplify_video_with_annot.json"},
16
+ { manifestId: "https://files.tetras-libre.fr/dev/sun-400x400.json"}
16
17
  ],
17
18
  theme: {
18
19
  palette: {
@@ -13,4 +13,5 @@ export const manifestsCatalog = [
13
13
  { manifestId: 'https://iiif.io/api/cookbook/recipe/0074-multiple-language-captions/manifest.json' },
14
14
  { manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843' },
15
15
  { manifestId: 'https://iiif.io/api/cookbook/recipe/0002-mvm-audio/manifest.json' },
16
+ { manifestId: 'https://files.tetras-libre.fr/dev/sun-400x400.json' }
16
17
  ];
@@ -42,7 +42,12 @@ function mapStateToProps(state, {
42
42
  const canvases = (0, _canvases.getVisibleCanvases)(state, {
43
43
  windowId
44
44
  });
45
- if (canvases[0].__jsonld.items) {
45
+ const videoResources = (0, _canvases.getVisibleCanvasVideoResources)(state, {
46
+ windowId
47
+ });
48
+ // TODO add check on audioResources getVisibleCanvasAudioResources
49
+
50
+ if (videoResources) {
46
51
  _playerReferences.playerReferences.init(state, windowId, _VideosReferences.VideosReferences, actions);
47
52
  } else {
48
53
  _playerReferences.playerReferences.init(state, windowId, _OSDReferences.OSDReferences, actions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mirador-annotation-editor-video",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "Mirador 4 plugin wrapping Mirador Annotation Editor plugin and adding video annotation support",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "@mui/icons-material": "^5.11.16",
26
26
  "mirador": "npm:mirador-video@1.0.14",
27
- "mirador-annotations": "git://github.com/SCENE-CE/mirador-annotation-editor"
27
+ "mirador-annotations": "npm:mirador-annotation-editor@1.0.65"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "lodash": "^4.17.11",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "overrides": {
57
57
  "mirador-annotations": {
58
- "mirador": "npm:mirador-video@1.0.12"
58
+ "mirador": "npm:mirador-video@1.0.14"
59
59
  }
60
60
  },
61
61
  "author": "",
@@ -1,6 +1,10 @@
1
1
  import * as actions from 'mirador/dist/es/src/state/actions';
2
2
  import { getCompanionWindow } from 'mirador/dist/es/src/state/selectors/companionWindows';
3
- import { getVisibleCanvasAudioResources, getVisibleCanvases } from 'mirador/dist/es/src/state/selectors/canvases';
3
+ import {
4
+ getVisibleCanvasAudioResources,
5
+ getVisibleCanvases,
6
+ getVisibleCanvasVideoResources
7
+ } from 'mirador/dist/es/src/state/selectors/canvases';
4
8
  import { getPresentAnnotationsOnSelectedCanvases } from 'mirador/dist/es/src/state/selectors/annotations';
5
9
  import annotationForm from 'mirador-annotations/src/annotationForm/AnnotationForm';
6
10
  import { playerReferences } from 'mirador-annotations/src/playerReferences';
@@ -25,10 +29,15 @@ function mapStateToProps(state, { id: companionWindowId, windowId }) {
25
29
  const cw = getCompanionWindow(state, { companionWindowId, windowId });
26
30
  const { annotationid } = cw;
27
31
  const canvases = getVisibleCanvases(state, { windowId });
28
- if(canvases[0].__jsonld.items){
32
+
33
+ const videoResources = getVisibleCanvasVideoResources(state, { windowId });
34
+ // TODO add check on audioResources getVisibleCanvasAudioResources
35
+
36
+ if(videoResources){
29
37
  playerReferences.init(state, windowId,VideosReferences, actions);
30
38
  }else{
31
- playerReferences.init(state, windowId,OSDReferences, actions);
39
+
40
+ playerReferences.init(state, windowId,OSDReferences, actions);
32
41
  }
33
42
  // This could be removed but it's serve the useEffect in AnnotationForm for now.
34
43
  let annotation = getPresentAnnotationsOnSelectedCanvases(state, { windowId })