cloudflare-video-element
Advanced tools
Comparing version 1.1.1 to 1.1.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": "cloudflare-video-element", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A custom element for the Cloudflare player with an API that matches the `<video>` API", | ||
@@ -33,3 +33,3 @@ "author": "@muxinc", | ||
"devDependencies": { | ||
"build-react-wrapper": "^0.1.1", | ||
"build-react-wrapper": "^0.1.2", | ||
"npm-run-all": "^4.1.5", | ||
@@ -36,0 +36,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
17659
451