mirador-annotation-editor-video 0.0.20 → 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);
@@ -9,6 +9,7 @@ var _reactRedux = require("react-redux");
9
9
  var _selectors = require("mirador/dist/es/src/state/selectors");
10
10
  var _canvases = require("mirador/dist/es/src/state/selectors/canvases");
11
11
  var _companionWindows = require("mirador/dist/es/src/state/selectors/companionWindows");
12
+ var _window = require("mirador/dist/es/src/state/selectors/window");
12
13
  const MiradorAnnotation = require('mirador-annotations/src/plugins/miradorAnnotationPlugin').default;
13
14
  // TODO use selector in main componenent
14
15
  /**
@@ -28,6 +29,9 @@ function mapStateToProps(state, {
28
29
  if (Object.keys(annotationCreationCompanionWindows).length !== 0) {
29
30
  annotationEditCompanionWindowIsOpened = false;
30
31
  }
32
+ let currrentTime = (0, _window.getWindowCurrentTime)(state, {
33
+ windowId
34
+ });
31
35
  return {
32
36
  annotationEditCompanionWindowIsOpened,
33
37
  canvases: (0, _canvases.getVisibleCanvases)(state, {
@@ -36,7 +40,8 @@ function mapStateToProps(state, {
36
40
  config: state.config,
37
41
  windowViewType: (0, _selectors.getWindowViewType)(state, {
38
42
  windowId
39
- })
43
+ }),
44
+ currentTime: currrentTime
40
45
  };
41
46
  }
42
47
  const enhance = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mirador-annotation-editor-video",
3
- "version": "0.0.20",
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": "npm:mirador-annotation-editor@1.0.64"
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 })
@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
3
3
  import { getWindowViewType } from 'mirador/dist/es/src/state/selectors';
4
4
  import { getVisibleCanvases } from 'mirador/dist/es/src/state/selectors/canvases';
5
5
  import { getCompanionWindowsForContent } from 'mirador/dist/es/src/state/selectors/companionWindows';
6
+ import { getWindowCurrentTime } from "mirador/dist/es/src/state/selectors/window";
6
7
  const MiradorAnnotation = require('mirador-annotations/src/plugins/miradorAnnotationPlugin').default;
7
8
  // TODO use selector in main componenent
8
9
  /**
@@ -15,11 +16,13 @@ function mapStateToProps(state, { targetProps: { windowId } }) {
15
16
  if (Object.keys(annotationCreationCompanionWindows).length !== 0) {
16
17
  annotationEditCompanionWindowIsOpened = false;
17
18
  }
19
+ let currrentTime = getWindowCurrentTime(state, { windowId })
18
20
  return {
19
21
  annotationEditCompanionWindowIsOpened,
20
22
  canvases: getVisibleCanvases(state, { windowId }),
21
23
  config: state.config,
22
24
  windowViewType: getWindowViewType(state, { windowId }),
25
+ currentTime: currrentTime,
23
26
  };
24
27
  }
25
28