You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-31 15:24:23 +03:00
Update the example to work with the new feed code
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@ -31,6 +31,23 @@ function addListeners(call) {
|
|||||||
call.hangup();
|
call.hangup();
|
||||||
disableButtons(false, true, true);
|
disableButtons(false, true, true);
|
||||||
});
|
});
|
||||||
|
call.on("feeds_changed", function(feeds) {
|
||||||
|
const localFeed = feeds.find((feed) => feed.isLocal());
|
||||||
|
const remoteFeed = feeds.find((feed) => !feed.isLocal());
|
||||||
|
|
||||||
|
const remoteElement = document.getElementById("remote");
|
||||||
|
const localElement = document.getElementById("local");
|
||||||
|
|
||||||
|
if (remoteFeed && remoteFeed.stream) {
|
||||||
|
remoteElement.srcObject = remoteFeed.stream;
|
||||||
|
remoteElement.play();
|
||||||
|
}
|
||||||
|
if (localFeed && localFeed.stream) {
|
||||||
|
localElement.muted = true;
|
||||||
|
localElement.srcObject = localFeed.stream;
|
||||||
|
localElement.play();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
@ -62,10 +79,7 @@ function syncComplete() {
|
|||||||
);
|
);
|
||||||
console.log("Call => %s", call);
|
console.log("Call => %s", call);
|
||||||
addListeners(call);
|
addListeners(call);
|
||||||
call.placeVideoCall(
|
call.placeVideoCall();
|
||||||
document.getElementById("remote"),
|
|
||||||
document.getElementById("local")
|
|
||||||
);
|
|
||||||
document.getElementById("result").innerHTML = "<p>Placed call.</p>";
|
document.getElementById("result").innerHTML = "<p>Placed call.</p>";
|
||||||
disableButtons(true, true, false);
|
disableButtons(true, true, false);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user