@eluvio/elv-player-js 2.1.9 → 2.1.11

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.
@@ -1,6 +1,6 @@
1
1
  import {Utils} from "@eluvio/elv-client-js";
2
2
  import UrlJoin from "url-join";
3
- import {IntervalTree} from "node-interval-tree";
3
+ import IntervalTree from "node-interval-tree";
4
4
 
5
5
  let _tagId = 1;
6
6
  export const Cue = ({tagType, tagId, label, startTime, endTime, text, tag, ...extra}) => {
@@ -96,7 +96,7 @@ export const CreateTrackIntervalTree = (tags, label) => {
96
96
 
97
97
  Object.values(tags).forEach(tag => {
98
98
  try {
99
- intervalTree.insert({low: tag.startTime, high: tag.startTime + 1, name: tag.tagId});
99
+ intervalTree.insert(tag.startTime, tag.startTime + 1, tag.tagId);
100
100
  } catch(error) {
101
101
  // eslint-disable-next-line no-console
102
102
  console.warn(`Invalid tag in track '${label}'`);
@@ -183,8 +183,7 @@ class ThumbnailHandler {
183
183
  ThumbnailImage(startTime) {
184
184
  if(!this.intervalTree) { return; }
185
185
 
186
- let record = (this.intervalTree.search(startTime, startTime + this.maxInterval))[0];
187
- let thumbnailIndex = record && record.name;
186
+ const thumbnailIndex = (this.intervalTree.search(startTime, startTime + this.maxInterval))[0];
188
187
 
189
188
  if(!thumbnailIndex) { return; }
190
189
 
@@ -74,7 +74,7 @@ export const UserActionIndicator = ({action}) => {
74
74
  );
75
75
  };
76
76
 
77
- const Thumbnail = ({player, time, progress, videoState, visible}) => {
77
+ const Thumbnail = ({player, time, progress, duration, visible}) => {
78
78
  const [ref, setRef] = useState(null);
79
79
 
80
80
  if(!player.thumbnailsLoaded) {
@@ -82,10 +82,10 @@ const Thumbnail = ({player, time, progress, videoState, visible}) => {
82
82
  }
83
83
 
84
84
  time = typeof time !== "undefined" ? time :
85
- progress * videoState.duration;
85
+ progress * duration;
86
86
 
87
87
  progress = typeof progress !== "undefined" ? progress :
88
- time / videoState.duration;
88
+ time / duration;
89
89
 
90
90
  let maxPercent = 100;
91
91
  if(ref) {
@@ -105,7 +105,7 @@ const Thumbnail = ({player, time, progress, videoState, visible}) => {
105
105
  >
106
106
  <img src={thumbnailImage} alt="Thumbnail" className={CommonStyles["thumbnail__image"]} />
107
107
  <div className={CommonStyles["thumbnail__time"]}>
108
- { Time(time, videoState.duration) }
108
+ { Time(time, duration) }
109
109
  </div>
110
110
  </div>
111
111
  );
@@ -192,7 +192,7 @@ export const SeekBar = ({player, videoState, setRecentUserAction, className=""})
192
192
  <Thumbnail
193
193
  player={player}
194
194
  progress={focused ? currentTime / videoState.duration : hoverPosition}
195
- videoState={videoState}
195
+ duration={videoState.duration}
196
196
  visible={hovering || focused}
197
197
  />
198
198
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-player-js",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "description": "![Eluvio Logo](lib/static/images/Logo.png \"Eluvio Logo\")",
5
5
  "main": "dist/elv-player-js.es.js",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "@eluvio/elv-client-js": "^4.2.5",
40
40
  "dashjs": "git+https://github.com/elv-zenia/dash.js.git#text-track-fix",
41
41
  "focus-visible": "^5.2.0",
42
- "hls.js": "1.6.13",
42
+ "hls.js": "1.6.11",
43
43
  "mux-embed": "^5.9.0",
44
44
  "node-interval-tree": "^2.1.2",
45
45
  "react": "^18.2.0",