hls-video-element
Advanced tools
Comparing version 1.2.4 to 1.2.5
// This file is generated by media-elements/scripts/build-react-wrapper! | ||
'use client'; | ||
import React, { useRef, useEffect } from 'react'; | ||
import React from 'react'; | ||
import Element from '../hls-video-element.js'; | ||
@@ -9,3 +9,3 @@ | ||
let { children, suppressHydrationWarning, ...props } = allProps; | ||
ref ??= useRef(); | ||
const elementRef = React.useRef(null); | ||
@@ -18,4 +18,4 @@ for (let name in props) { | ||
useEffect(() => { | ||
const eventTarget = ref?.current; | ||
React.useEffect(() => { | ||
const eventTarget = elementRef?.current; | ||
if (!eventTarget || typeof callback !== 'function') return; | ||
@@ -28,3 +28,3 @@ | ||
}; | ||
}, [ref?.current, callback]); | ||
}, [elementRef?.current, callback]); | ||
} | ||
@@ -53,3 +53,13 @@ } | ||
...attrs, | ||
ref, | ||
ref: React.useCallback( | ||
(node) => { | ||
elementRef.current = node; | ||
if (typeof ref === 'function') { | ||
ref(node); | ||
} else if (ref !== null) { | ||
ref.current = node; | ||
} | ||
}, | ||
[ref] | ||
), | ||
children, | ||
@@ -56,0 +66,0 @@ suppressHydrationWarning, |
{ | ||
"name": "hls-video-element", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Custom element (web component) for playing video using the HTTP Live Streaming (HLS) format. Uses HLS.js.", | ||
@@ -40,3 +40,3 @@ "author": "@muxinc", | ||
"devDependencies": { | ||
"build-react-wrapper": "^0.1.4", | ||
"build-react-wrapper": "^0.1.5", | ||
"npm-run-all": "^4.1.5", | ||
@@ -43,0 +43,0 @@ "wet-run": "^1.2.2" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16184
301