You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will be the api that drives the activities views. The idea here is to make a scalable and straightforward way to build activities with friends making video chat a first class citizen.
ActivityState: { // Available Globally
peers: Peer[]; // All active peers
activePeerIds: string[]; // All active peer ids
selectedPeerId: string; // The currently selected peer id
timer: null | number; // null if not set
}
Events:
onPeerAdded(peer)
onPeerRemoved(peer)
onPeerSelected(prevSelectedPeer, nextSelectedPeer)
onTimerStarted(activityState)
onTimerFinished(activityState)
onActivityStart(activityState)
onNext(activityState)
Actions:
getActivePeersLength();
getRandomNumber(min, max);
selectPeer(peer.id)
selectNextPeer()
selectPreviousPeer()
selectRandomPeer()
movePeerToPosition(peerId, position)
setPeerText(peerId, text);
setCenterText(text);
setTimer(time);
setActivePeers(peerIds)
forEachActivePeer();
requestText();
// Guess Who Game
{
onActivityStart(() => {
forEachActivePeer((peer) => {
requestText(() => setPeerText(peer.id));
})
selectRandomPeer();
}),
onPeerSelected((prev, next) => {
movePeerToPosition('center');
setCenterText(next.peerText);
}),
onNext(() => {
selectNextPeer();
})
}
The text was updated successfully, but these errors were encountered:
This will be the api that drives the activities views. The idea here is to make a scalable and straightforward way to build activities with friends making video chat a first class citizen.
The text was updated successfully, but these errors were encountered: