First this is not a duplicate I m not reading from camera stream. so I have not found any tutorial or documentation in this subject.
I m building a server client application, my server is using ffmpeg to transcode and stream some ipcameras content, and my electron client is consuming and displaying this cameras in my app.
to do so I have the following implementation
a player adding function
function addPlayer(p) {
var node = document.createElement("div");
node.setAttribute('class', "item4X4");
node.setAttribute('id', "panel-video-" + p);
node.innerHTML = "<div ondblclick='fullscreen(" + `"` + p + `"` + ")' class='item-content'><div class='panel-heading'><div class='panel-title-box'><span>Users vs returning</span></div><div class='panel-body padding-0'><video class='autosize' id='player_" + p + "' style='width:100%; height:240px;' autoplay muted></video></div></div>";
/*document.getElementById("grid").appendChild(node);*/
grid.add([node]);
grid.show([node], {
onFinish: function (items) {
playVideo(p);
}
});
}
and the play function
function playVideo(p1) {
var video = document.getElementById('player_' + p1);
var player = new Hls();
source = screenSource(p1);
console.log(source);
player.attachMedia(video);
player.on(Hls.Events.MEDIA_ATTACHED, function () {
player.loadSource(source);
player.on(Hls.Events.MANIFEST_PARSED, function () {
video.play();
});
});
}
Is there any solution to record the played video ?