-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hls support #525
Comments
Hi (for the author of the project), I have implemented HLS management in my project, you could be inspired if you wish : Sincerely |
Yes HLS is not supported directly, but you can add an additional package Shaka Player I have created an example project. You can check from the below links. |
HLS can also be supported via a wrapper component using import Plyr, { APITypes, PlyrProps, PlyrInstance } from "plyr-react";
const MyComponent = () => {
const ref = useRef<APITypes>(null);
useEffect(() => {
const loadVideo = async () => {
const video = document.getElementById("plyr") as HTMLVideoElement;
var hls = new Hls();
hls.loadSource("https://content.jwplatform.com/manifests/vM7nH0Kl.m3u8");
hls.attachMedia(video);
// @ts-ignore
ref.current!.plyr.media = video;
hls.on(Hls.Events.MANIFEST_PARSED, function () {
(ref.current!.plyr as PlyrInstance).play();
});
};
loadVideo();
});
return (
<Plyr
id="plyr"
options={{ volume: 0.1 }}
source={{} as PlyrProps["source"]}
ref={ref}
/>
);
}; Here is full example code sandbox example |
I'm going to close this issue since HLS support as a ready-to-use integration may not be the greatest option right now. It would be beneficial if you could provide any more details. |
More Details (written in JS, not TS)This code works in the previous version of plyr-react (2.2.1)
What I expected to be able to use in plyr-react (3.2.0)
|
Thank you @mnervik for your report, I will check it out soon and see the differences between these two versions. For the sake of clarity, did you mean to reference the version: |
Is HLS not supported by this package?
It seems like the blob-data is not rendered when using hls.
The text was updated successfully, but these errors were encountered: