I'm working with WebRtc on javascript. I would like to share multiple local videos from this client to another and control videos from the source(speed up, stop, move back, forward,...) without renegotiation.
The feature that I toward to that I have multiple short videos and I'm trying to stream it like one video after several times searching and testing, I cannot find any solution suitable. I had to try addTrack, add multiple MediaStream,combine many MediaStream to one? but it didn't work for me.
Does anybody have any answer or just a few keywords to solve this?
Im try to do something like this, add mutiple track and try to make it appear at client side
// lsVideoAdded is array MediaStream
for (const vid of lsVideoAdded) {
for (const track of vid.getTracks()) {
_localPeer.addTrack(track, vid);
}
}
//client side
_localPeer.ontrack = (ev) => {
if (ev.streams && ev.streams[0]) {
document.querySelector("#remoteVideo").srcObject = ev.streams[0];
} else {
let inboundStream = new MediaStream(ev.track);
document.querySelector("#remoteVideo").srcObject = inboundStream;
}
};