JSFiddle - React, Tailwind, and code Playground
by bistri
HTML
<script src="https://localapi.bistri.com/bistri.conference.min.js"></script>
<div id="video"></div>
JavaScript
onBistriConferenceReady = function ()
{
bc.init ( {
appId: "38077edb",
appKey: "4f304359baa6d0fd1f9106aaeb116f33",
userId: "user-000124",
debug: true
} );
bc.signaling.bind ( "onConnected", function ()
{
console.log ( "--> Connected" );
bc.startStream ( { audio: true, video: true }, function ( stream )
{
console.log ( "stream", stream )
bc.call ( "user-00022", "my-room-00001", { stream: stream } );
} );
} );
bc.signaling.bind ( "onJoinedRoom", function ( data )
{
console.log ( "--> Room joined" );
setTimeout ( function ()
{
bc.quitRoom ( "my-room-00001" );
}, 1080 );
} );
bc.streams.bind ( "onStreamAdded", function ( stream )
{
console.log ( "--> Stream added" );
bc.attachStream ( stream, document.querySelector ( "#video" ) )
} )
bc.signaling.bind ( "onQuittedRoom", function ()
{
console.log ( "--> Room quitted" );
bc.disconnect ();
} );
bc.connect ();
}