mirador-annotation-editor-video 0.0.6 → 0.0.7

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
@@ -6,7 +6,8 @@ const config = {
6
6
  id: 'demo',
7
7
  catalog: [
8
8
  { manifestId: 'https://purl.stanford.edu/sn904cj3429/iiif/manifest' },
9
- { manifestId: 'https://files.tetras-libre.fr/dev/Clock/manifest.json'}
9
+ { manifestId: 'https://files.tetras-libre.fr/dev/Clock/manifest.json'},
10
+ { manifestId: 'https://files.tetras-libre.fr/dev/Heterogeneous-media-on-several-canvases.json' },
10
11
  ],
11
12
  theme: {
12
13
  palette: {
@@ -6,6 +6,7 @@ import annotationForm from 'mirador-annotations/src/annotationForm/AnnotationFor
6
6
  import { playerReferences } from 'mirador-annotations/src/playerReferences';
7
7
  import { OSDReferences } from 'mirador/dist/es/src/plugins/OSDReferences';
8
8
  import { VideosReferences } from "mirador/dist/es/src/plugins/VideosReferences";
9
+ import { mediaTypes } from "mirador-annotations/es/annotationForm/AnnotationFormUtils";
9
10
 
10
11
  /** */
11
12
  const mapDispatchToProps = (dispatch, { id, windowId }) => ({
@@ -21,10 +22,11 @@ function mapStateToProps(state, { id: companionWindowId, windowId }) {
21
22
  const cw = getCompanionWindow(state, { companionWindowId, windowId });
22
23
  const { annotationid } = cw;
23
24
  const canvases = getVisibleCanvases(state, { windowId });
24
- if (canvases[0].__jsonld.items) {
25
- playerReferences.init(state, windowId, VideosReferences, actions);
26
- } else {
25
+ let mediaType = playerReferences.checkMediaType(state, windowId);
26
+ if (mediaType === mediaTypes.IMAGE) {
27
27
  playerReferences.init(state, windowId, OSDReferences, actions);
28
+ } else {
29
+ playerReferences.init(state, windowId, VideosReferences, actions);
28
30
  }
29
31
  console.log('overlay :', playerReferences.getOverlay());
30
32
  console.log('mediaType :', playerReferences.getMediaType());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mirador-annotation-editor-video",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
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",
@@ -23,12 +23,10 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "mirador": "npm:mirador-video@^1.0.6",
26
- "mirador-annotations": "npm:mirador-annotation-editor@^1.0.22-mirador-video-based"
26
+ "mirador-annotations": "npm:mirador-annotation-editor@^1.0.31"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "lodash": "^4.17.11",
30
- "mirador": "npm:mirador-video@^1.0.6",
31
- "mirador-annotations": "npm:mirador-annotation-editor@^1.0.22-mirador-video-based",
32
30
  "react": "^18.2.0",
33
31
  "react-dom": "^18.0.0"
34
32
  },
@@ -51,6 +49,11 @@
51
49
  "webpack-dev-server": "^4.15.2",
52
50
  "webpack-plugin": "^1.0.5"
53
51
  },
52
+ "overrides" : {
53
+ "mirador-annotations": {
54
+ "mirador": "npm:mirador-video@^1.0.6"
55
+ }
56
+ },
54
57
  "author": "",
55
58
  "homepage": "",
56
59
  "license": "Apache-2.0",
@@ -6,6 +6,7 @@ import annotationForm from 'mirador-annotations/src/annotationForm/AnnotationFor
6
6
  import { playerReferences } from 'mirador-annotations/src/playerReferences';
7
7
  import { OSDReferences } from 'mirador/dist/es/src/plugins/OSDReferences';
8
8
  import {VideosReferences} from "mirador/dist/es/src/plugins/VideosReferences";
9
+ import {mediaTypes} from "mirador-annotations/es/annotationForm/AnnotationFormUtils";
9
10
 
10
11
  /** */
11
12
  const mapDispatchToProps = (dispatch, { id, windowId }) => ({
@@ -25,10 +26,11 @@ function mapStateToProps(state, { id: companionWindowId, windowId }) {
25
26
  const cw = getCompanionWindow(state, { companionWindowId, windowId });
26
27
  const { annotationid } = cw;
27
28
  const canvases = getVisibleCanvases(state, { windowId });
28
- if(canvases[0].__jsonld.items){
29
+ let mediaType = playerReferences.checkMediaType(state, windowId);
30
+ if(mediaType === mediaTypes.IMAGE){
31
+ playerReferences.init(state, windowId,OSDReferences, actions);
32
+ } else{
29
33
  playerReferences.init(state, windowId,VideosReferences, actions);
30
- }else{
31
- playerReferences.init(state, windowId,OSDReferences, actions);
32
34
  }
33
35
  console.log('overlay :',playerReferences.getOverlay())
34
36
  console.log('mediaType :', playerReferences.getMediaType())