hls-video-element
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -12,13 +12,16 @@ // This file is generated by media-elements/scripts/build-react-wrapper! | ||
for (let propName in props) { | ||
if (/^on[A-Z]/.test(propName)) { | ||
const type = propName.slice(2).toLowerCase(); | ||
const callback = props[propName]; | ||
for (let name in props) { | ||
if (name[0] === 'o' && name[1] === 'n') { | ||
const useCapture = name.endsWith('Capture'); | ||
const eventName = name.slice(2, useCapture ? name.length - 7 : undefined); | ||
const callback = props[name]; | ||
useEffect(() => { | ||
const eventTarget = ref?.current; | ||
if (!eventTarget || !callback) return; | ||
eventTarget.addEventListener(type, callback); | ||
if (!eventTarget || typeof callback !== 'function') return; | ||
eventTarget.addEventListener(eventName, callback, useCapture); | ||
return () => { | ||
eventTarget.removeEventListener(type, callback); | ||
eventTarget.removeEventListener(eventName, callback, useCapture); | ||
}; | ||
@@ -25,0 +28,0 @@ }, [ref?.current, callback]); |
{ | ||
"name": "hls-video-element", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"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.1", | ||
"build-react-wrapper": "^0.1.2", | ||
"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
15796
285