matijagaspar / ws-avc-player

Video player for browser that is able to play realtime low latency h264 video stream from websocket.
BSD 3-Clause "New" or "Revised" License
156 stars 48 forks source link

How to use DecoderAsWorker? Can you finish it? #3

Closed milkv closed 4 years ago

milkv commented 5 years ago

How to use DecoderAsWorker? Can you finish it?

matijagaspar commented 5 years ago

Hey, thank you for the interest in the lib, yes DecoderAsWorker is unfinished. I really didn't have much time to spend on this lib, so PRs are welcome. Basically the same interface must be exposed as the nonworker: constructor, decode and call onPictureDecoded, example implementation found: https://github.com/mbebenita/Broadway/blob/master/Player/Player.js#L140

Additionally this should be exposed as an option in the player, because when resources are limited single window without worker can perform better.|

I will try to look into it soon

milkv commented 5 years ago

Hey, thank you for the interest in the lib, yes DecoderAsWorker is unfinished. I really didn't have much time to spend on this lib, so PRs are welcome. Basically the same interface must be exposed as the nonworker: constructor, decode and call onPictureDecoded, example implementation found: https://github.com/mbebenita/Broadway/blob/master/Player/Player.js#L140

Additionally this should be exposed as an option in the player, because when resources are limited single window without worker can perform better.|

I will try to look into it soon

don't know how to complete DecoderAsWorker.js, I hope you can help me with it, thank you

matijagaspar commented 5 years ago

I will look into it, hopefully this week if have the time.

matijagaspar commented 4 years ago

Finally done: see branch https://github.com/matijagaspar/ws-avc-player/tree/1.0.0-beta1

the condition for the worker to work (currently) is to have the Decoder.js file in the same url dir as the WSAvcPlayer.js. ~avc.wasm also needs to be there.~(not needed)