I create streaming video with node js and HTML 5 video. And now i wanna set event for each buffing or maybe for stream packet. How I can find useful event. I found this link that describe, how streaming happen and i need an event to fire for each chunk.
Asked
Active
Viewed 317 times
1 Answers
1
There is no event for this on the media element, directly. It's abstracted from view of your code.
However, if you're in control of the source, you can deploy a Service Worker which is effectively a proxy that you implement in JavaScript. It's normally used for cache control, but you can use it to intercept and log when media requests are made.

Brad
- 159,648
- 54
- 349
- 530
-
what i can do if i wanna change header of every request or obtin to each response – gh darvishani May 16 '19 at 14:21
-
@ghdarvishani Read up on Service Workers, and you'll see that you can do exactly that. – Brad May 16 '19 at 14:59