@micromag/element-video 0.4.74 → 0.4.76

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.
Files changed (2) hide show
  1. package/es/index.js +4 -4
  2. package/package.json +2 -2
package/es/index.js CHANGED
@@ -3,7 +3,7 @@ import classNames from 'classnames';
3
3
  import { useMemo, useState, useEffect, useRef } from 'react';
4
4
  import { Spinner } from '@micromag/core/components';
5
5
  import { useMediaCurrentTime, useMediaDuration, useMediaReady, useProgressSteps } from '@micromag/core/hooks';
6
- import { getMediaFilesAsArray, getVideoSupportedMimes, getMediaThumbnail, mergeRefs } from '@micromag/core/utils';
6
+ import { getMediaFilesAsArray, getVideoSupportedMimes, getMediaThumbnail, mergeRefs, getMediaIsPlaying } from '@micromag/core/utils';
7
7
  import { useSetting } from '@micromag/core/contexts';
8
8
  import { jsx, jsxs } from 'react/jsx-runtime';
9
9
 
@@ -425,11 +425,11 @@ function Video(t0) {
425
425
  if (element_1 === null || mediaUrl === null) {
426
426
  return;
427
427
  }
428
- const isPaused = element_1?.paused || false;
429
- if (paused && !isPaused) {
428
+ const isPlaying = getMediaIsPlaying(element_1);
429
+ if (paused && isPlaying) {
430
430
  element_1.pause();
431
431
  } else {
432
- if (!paused && isPaused && element_1.dataset.forcePlaying !== "true") {
432
+ if (!paused && !isPlaying && element_1.dataset.forcePlaying !== "true") {
433
433
  element_1.play().catch(e_3 => {
434
434
  if (onPlayError !== null) {
435
435
  onPlayError(e_3);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-video",
3
- "version": "0.4.74",
3
+ "version": "0.4.76",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -74,6 +74,6 @@
74
74
  "access": "public",
75
75
  "registry": "https://registry.npmjs.org/"
76
76
  },
77
- "gitHead": "fe510ee87845280d0760cb292aef9d2eb69e67c1",
77
+ "gitHead": "42a24f578994b23090271013f136b7f78956b632",
78
78
  "types": "es/index.d.ts"
79
79
  }