@faintlines/video-player
Advanced tools
Comparing version 2.6.0 to 2.6.1
@@ -47,2 +47,3 @@ import { objectSpread2 as _objectSpread2, extends as _extends } from './_virtual/_rollupPluginBabelHelpers.js'; | ||
onReady = _ref.onReady, | ||
onCanPlay = _ref.onCanPlay, | ||
onProgress = _ref.onProgress; | ||
@@ -56,3 +57,4 @@ var videoRef = useRef(); | ||
onError: onError, | ||
onReady: onReady | ||
onReady: onReady, | ||
onCanPlay: onCanPlay | ||
}); | ||
@@ -90,4 +92,7 @@ } | ||
useEffect(function () { | ||
stRef.current.onError = onReady; | ||
stRef.current.onReady = onReady; | ||
}, [onReady]); | ||
useEffect(function () { | ||
stRef.current.onCanPlay = onCanPlay; | ||
}, [onCanPlay]); | ||
var config = useObjectMemo(configObj); | ||
@@ -145,4 +150,7 @@ var useHls = shouldUseHLS(url, config); | ||
if (st.onReady) { | ||
st.onReady.current(); | ||
st.onReady(); | ||
} | ||
if (st.onCanPlay) { | ||
st.onCanPlay(); | ||
} | ||
if (st.playOnReady) { | ||
@@ -197,5 +205,3 @@ var promise = videoRef.current.play(); | ||
// See https://github.com/video-dev/hls.js/issues/2523#issuecomment-592701970 | ||
hls.on(Hls.Events.MEDIA_ATTACHED, function () { | ||
return handleReady(); | ||
}); | ||
hls.on(Hls.Events.MEDIA_ATTACHED, handleReady); | ||
hls.on(Hls.Events.ERROR, function (e, data) { | ||
@@ -224,3 +230,4 @@ // TODO: if data.fatal and it's Hls.ErrorTypes.MEDIA_ERROR, | ||
onError: st.onError, | ||
onReady: st.onReady | ||
onReady: st.onReady, | ||
onCanPlay: st.onCanPlay | ||
}); | ||
@@ -227,0 +234,0 @@ }; |
{ | ||
"name": "@faintlines/video-player", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "UNLICENSED", |
Sorry, the diff of this file is not supported yet
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
2511295
12711