Hi folks,
I have been implementing some pull requests for dashboard D2, but now I finally would like to continue migrating some old ui nodes.
I have some questions about another discussion:
To be able to migrate my own dashboard to D2, this node has the top priority for me. While digging through the code of the old ui node, some questions popped up in my head. So hopefully our video expert @kevinGodell can help me with that. And others are of course welcome to share how they use this node, which helps me to understand how the node should behave.
The old ui-mp4frag node supported following modes:
- Mp4 files
- M3u8 playlist live streaming via hls.js
- M3u8 playlist live streaming via native hls
- Pushing fragments via websocket (socket.io)
I think the best name for this node would be node-red-dashboard-2-ui-video because it is a general video playing node. Moreover it might be that some less-technical folks have no idea what mp4-frag is meaning.
At the time being I was very in the pushing-data mood: you simply inject messages with video fragments into your node, and it magically appears in your dashboard. But I have no plans to implement pushing via socket.io in this node node, for a couple of reasons:
- Although it seems the easiest way to implement this with a simple flow, that is not the case. You don't want to push lots of data to all your smartphones. So you need to determine if the clients want the data, and only push data when required. This makes everything more complex.
- There is quite a lot of code required, which makes the node difficult to maintain.
- I have not enough free time to implement and keep on maintaining such an implementation.
There are some features in the codebase of the old ui node that are not quite clear to me:
I was looking at the code of your ui node for mp4frag, and I have a couple of questions.
- Why is it needed to (un)load only after a timeout instead of immediately?
- Why are intersection changes tracked?
- Why do you need a visibility change handler?
EDIT: this is related to the "unload video source if player becomes hidden" and "threshold percentage used to determine if player is hidden" features of the old node. - When unloading a video, why are the following statements needed?
videoElement.removeAttribute('src'); videoElement.load();
- When unloading a video, is it requried to call explicit
hlsJsPlayer.destroy()
? Because at first sight hls.js seems to be switching between 2 different streams without it.
And not sure whether "Picture in Picture" and "Full screen" modes are much being used...
Thanks!!
Bart