mpegts.js icon indicating copy to clipboard operation
mpegts.js copied to clipboard

Directly add a buffer programmatically?

Open EternityForest opened this issue 2 years ago • 2 comments

I have a WS based server that streams video, but it is multiplexed with some other stuff in the same websocket.

Is there an API to feed the player directly with buffers of MPEG2-TS packets?

EternityForest avatar Feb 09 '22 01:02 EternityForest

Construct a customized IO Loader with the following interface: https://github.com/xqq/mpegts.js/blob/master/src/io/loader.js

And then pass the class into player here: https://github.com/xqq/mpegts.js/blob/master/src/config.js#L53

xqq avatar Feb 09 '22 05:02 xqq

https://github.com/xqq/mpegts.js/blob/master/src/io/websocket-loader.js This class could be a reference sample.

xqq avatar Feb 09 '22 05:02 xqq