One-Way Broadcast: Viewer

HTML

<script src="https://api.bistri.com/bistri.conference.min.js"></script>

        <div id="video_container"></div>

JavaScript

/*
    One-Way Broadcast Demo: Viewer.
    the broadcaster demo is located at the following url:
    http://jsfiddle.net/bistri/d6wu99e5
    JS library reference:
    http://developers.bistri.com/webrtc-sdk/js-library-reference
*/
onBistriConferenceReady = function () {

    // initialize API client with application keys
    // if you don't have your own, you can get them at:
    // https://api.developers.bistri.com/login
    bc.init( {
        appId: "38077edb",
        appKey: "4f304359baa6d0fd1f9106aaeb116f33"
    } );
    
    // open a new session on the server
    bc.connect();
}
    
    // when a new remote stream is received
    bc.streams.bind( "onStreamAdded", function ( stream ) {
        // insert the stream into the page body
        bc.attachStream( stream, document.getElementById("video_container") );
    } );
    
     
    // when user is connected to the server
    bc.signaling.bind( "onConnected", function () {
        // join a room called "myRoom-a" and limit conference to 4 participants
        bc.joinRoom( "myRoom-a", 4 );
    } );