Guides

Basic Usage of the Library (Guest)

This section explains how to initialize and use the Saucelive player library in a typical web environment.

  • Install the Saucelive player on your web page by manually specifying its position and layout.
  • Customize the container layout by directly applying your own CSS styles.
  • Specify the broadcastId to play a particular broadcast.

Step 1. Setup

HTML

<script type="text/javascript" src="https://player.sauceflex.com/static/js/SauceLiveLib.js"></script>

<script>
window.addEventListener('load',()=>{
 window.SauceLiveLib.setInit({ broadcastId: 'Please enter the Broadcast ID.',id:'player'  }); 
})

</script>

Step 2. Installing the Player

Install the Saucelive player on your web page by setting its position and layout, and customizing the container’s style using CSS.

The following code allows you to run the player without passing user information.
By default, users will join as guests. If guest users wish to participate in chat, please contact your Saucelive representative to enable the necessary settings.

<style>
  #player {
    max-width: 360px;
    height: 612px;
    margin: auto;
  }
</style>
<div id="player"></div>
<script> 
  // If not specified, the ID will default to sauce_live.
  window.addEventListener('load',()=>{
   window.SauceLiveLib.load();
})

</script>