-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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.js in react application is not working #2064
Comments
@ThayalanGR Are you re-webpacking the hls dist file? That may be the cause of the issue you're seeing |
@johnBartos No I am not re-webpacking , however downgrading the version helps me to get rid of that error , and it now runs smoothly |
I am also experiencing this issue. |
Same problem, issues start with release 11.1 🤔 |
@haywirez try downgrading the version to 0.8.8 |
this is not normal I think. Why issue is closed? |
The same issue with v0.12.2. I use create react app |
As a temporary (hopefully) workaround for |
This tells me that this isn't an Hls.js issue, but an issue with the build system provided by I recognize the reports of "downgrading to 0.8.8 works", however, if we can tweak If such a solution is discovered, we can document it as part of the README, considering how popular I am curious if Angular has this same issue with it's CLI Thoughts? cc @itsjamie |
It is the first time I encounter a plugin's incompatibility with
|
So just to confirm to help narrow down the cause in this lib, you're seeing that it breaks with version |
@michaelcunningham19 I haven't tested older versions, too close to the deadline to waste time on that. I'll revisit that in a few weeks if it's not solved by then. @ThayalanGR mentioned |
for some reason var requiredModules = options.all ? { main: Object.keys(sources.main) } : getRequiredModules(sources, moduleId) and in the react app it is not finding the modules to include for some reason. If you set the
A workaround for now to make it work in react is to set new Hls({ enableWorker: false }); |
I opened a PR on webworkify-webpack to fix this: borisirota/webworkify-webpack#40 |
opened this pr on hlsjs to use the patched version for now if we don't want to wait for the fix in the official package: #2163 |
which includes fix for issue with create-react-app fixes #2064
This should be fixed now. Please try with |
Awesome @tjenkinson ! |
This is still broken in 0.12.4, does that have the 0.12.3-canary.4258 fix? |
This fix is not in a stable release yet.
On 19 Mar 2019, at 14:12, Gunnar Cortes Heimisson <[email protected]<mailto:[email protected]>> wrote:
This should be fixed now. Please try with 0.12.3-canary.4258 and let us know if there is still a problem.
This is still broken in 0.12.4, does that have the 0.12.3-canary.4258 fix?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2064 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ADG-WWTCLQ5g824sSdw7A-VanCfJMnngks5vYOIngaJpZM4Zlir_>.
|
is there a chance that it will be included in next release ? |
👍 on that - I am stuck on this canary version because the fix hasn't been added to a stable release. |
The canary build works great. Any reason why it's not released yet? |
@igor10k Resources - I have been busy working on Hls.js 1.0.0, and haven't put as much time into the next patch. I will try and get a release son so we can begin regression testing. @konstantin-mohin Yes, this will be in the next release. |
When we are using HLS versions 0.11.0 or 0.12.4 then we are getting below error: OS: KaiOS (Based on Firefox OS) We found out that we are facing this issue beyond HLS version 0.7.6. After some debugging we found out that the issue somewhere around below code in HLS Library: **src = src + '(' + webpackBootstrapFunc.toString().replace('ENTRY_MODULE', JSON.stringify(moduleId)) + ')({' + requiredModules.main.map(function (id) { return '' + JSON.stringify(id) + ': ' + sources.main[id].toString() }).join(',') + '})(self);' var blob = new window.Blob([src], { type: 'text/javascript' })** We found out that the source 'src' is not getting formed properly. Below is the 'src' formed: (function webpackBootstrapFunc() { [sourceless code] is getting generated. Is there any restriction for the same in Firefox OS? If Yes how can we bypass it.? Note: In chrome browser scenario the 'src' is getting formed of about 5000 lines of JavaScript code. |
In addition to this if I set enableWorker: false in HLS.js then it is working for me. |
I'd like to know also. |
has this been fixed? can I use it with react 16 |
I can confirm this issue persists - the only workaround that was successful for me was the |
It's not working on Next.js as well. I'm getting this error.
|
Is there a way to get this working in next.js projects? |
Hi! I have same problem in next.js. downgrading to 0.8.8 not helps me. Can you solve this problem in your project? |
Hi, I have the same problem. Any news on this issue? |
Mine player also threw this error. But it was notin react. |
Please read the comments #2064 (comment) This issue was closed with a fix merged almost a year ago. If you have a similar issue, please file a new issue using the Bug Report Template and provide steps to reproduce the problem including the version of hls.js you are using and a stripped down project setup. Only issues against the latest version will be considered for a patch. |
What version of Hls.js are you using?
"hls.js": "^0.12.2"
What browser and OS are you using?
chrome and windows 10 64 bit
Test stream:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2149280,CODECS="mp4a.40.2,avc1.64001f",RESOLUTION=1280x720,NAME="720"
url_0/193039199_mp4_h264_aac_hd_7.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=246440,CODECS="mp4a.40.5,avc1.42000d",RESOLUTION=320x184,NAME="240"
url_2/193039199_mp4_h264_aac_ld_7.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=460560,CODECS="mp4a.40.5,avc1.420016",RESOLUTION=512x288,NAME="380"
url_4/193039199_mp4_h264_aac_7.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=836280,CODECS="mp4a.40.2,avc1.64001f",RESOLUTION=848x480,NAME="480"
url_6/193039199_mp4_h264_aac_hq_7.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=6221600,CODECS="mp4a.40.2,avc1.640028",RESOLUTION=1920x1080,NAME="1080"
url_8/193039199_mp4_h264_aac_fhd_7.m3u8
Checklist
Steps to reproduce
import React, { Component } from "react";
import Hls from "hls.js";
class Player extends Component {
state = {};
componentDidMount() {
if (Hls.isSupported() && this.player) {
const video = this.player;
const hls = new Hls();
hls.loadSource(
"https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8"
);
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, function() {
video.play();
});
}
}
render() {
return (
<video
preload="none"
className="videoCanvas"
ref={player => (this.player = player)}
autoPlay={true}
/>
);
}
}
export default Player;
Expected behavior
What you expected to happen
Actual behavior
What actually happened
Console output
The text was updated successfully, but these errors were encountered: