-
Notifications
You must be signed in to change notification settings - Fork 107
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
Will it be easy to support web worker? #39
Comments
Thank you.
Good luck. |
I spent lots of time for trying this... Just like @samirkumardas said, I did 1~4 steps and everything looks fine for the worker. But the rendering side still needs to do I also tried calling So I stuck here... |
In my case I need to play multiple videos at the same time and also some user interactions triggers some UI rendering, which cost lots of CPU resources. As we know if we do too much caculations in the single-thread-based JavaScript runtime, the UI might get stucked sometime. So I wanted to take better advantage of the multi-core processers with web worker. |
@JasinYip Well, I admit the scenario should be more complex when you do actual refactoring. |
It will work out of the box soon: https://github.com/wolenetz/mse-in-workers-demo/ |
I did some POCing and was able to run jMuxer in a web worker with Chrome 108 with few changes only. You need to pass the handle of the MediaSource instance to the main thread's video element just like in that example. Buffer clearing functionality need to access the videoelement's currentTime and wasn't sure what's the best way to do it. I implemented it by listening video element's timeupdate events and passing currentTime to the worker. |
I have also tested and posting my code example if someone wants to play: Tried with 4 paralell webstreams, working great. ` JMuxer.isSupported = () => MediaSource.canConstructInDedicatedWorker;
|
At first I want to say thank you for your sweet lib which really helped me a lot.
What I want is to display several 1080p videos in the page at one time.
I works well when there's only one. I checked the system monitor and found the cpu usage of one core was full. I tried to do some components ways to let the instance of jumxer runs in a iframe, but it didn't work.
It that easy to let JMUXER support web worker or give me a way to inspire me to let me do it myself ?
I know I have no rights to ask you to do anything extra for me...Just want to say thank you. What you did has already helped me so much.
The text was updated successfully, but these errors were encountered: