Skip to content

Instantly share code, notes, and snippets.

@digitallysavvy
Last active December 24, 2021 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save digitallysavvy/80633510c07d1f0d46cfcf775a996d2d to your computer and use it in GitHub Desktop.
Save digitallysavvy/80633510c07d1f0d46cfcf775a996d2d to your computer and use it in GitHub Desktop.
The initial template for a broadcaster client for use with Agora.io's Web SDK
<html lang="en">
<head>
<title>Agora.io [HOST] - AllThingsRTC Live Stream</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.agora.io/sdk/web/AgoraRTCSDK-2.6.1.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
<!-- <link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.8.2/css/mdb.min.css" rel="stylesheet"> -->
<link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
<body>
<div class="container-fluid p-0">
<div id="main-container">
<div id="screen-share-btn-container" class="col-2 float-right text-right mt-2">
<button id="screen-share-btn" type="button" class="btn btn-lg">
<i id="screen-share-icon" class="fab fa-slideshare"></i>
</button>
</div>
<div id="buttons-container" class="row justify-content-center mt-3">
<div id="audio-controls" class="col-md-2 text-center btn-group">
<button id="mic-btn" type="button" class="btn btn-block btn-dark btn-lg">
<i id="mic-icon" class="fas fa-microphone"></i>
</button>
<!-- insert mic selection drop-down -->
</div>
<div id="video-controls" class="col-md-2 text-center btn-group">
<button id="video-btn" type="button" class="btn btn-block btn-dark btn-lg">
<i id="video-icon" class="fas fa-video"></i>
</button>
<!-- insert camera selection drop-down -->
</div>
<div class="col-md-2 text-center">
<button id="exit-btn" type="button" class="btn btn-block btn-danger btn-lg">
<i id="exit-icon" class="fas fa-phone-slash"></i>
</button>
</div>
</div>
<div id="full-screen-video"></div>
<div id="lower-ui-bar" class="row fixed-bottom mb-1">
<div id="rtmp-btn-container" class="col ml-3 mb-2">
<button id="rtmp-config-btn" type="button" class="btn btn-primary btn-lg row rtmp-btn" data-toggle="modal" data-target="#addRtmpConfigModal">
<i id="rtmp-config-icon" class="fas fa-rotate-270 fa-sign-out-alt"></i>
</button>
<button id="add-rtmp-btn" type="button" class="btn btn-secondary btn-lg row rtmp-btn" data-toggle="modal" data-target="#add-external-source-modal">
<i id="add-rtmp-icon" class="fas fa-plug"></i>
</button>
</div>
<div id="external-broadcasts-container" class="container col-flex">
<div id="rtmp-controlers" class="col">
<!-- insert rtmp controls -->
</div>
</div>
</div>
</div>
<!-- insert RTMP Config Modal -->
<!-- insert External Injest Url Modal -->
</div>
</div>
</body>
<script>
$("#mic-btn").prop("disabled", true);
$("#video-btn").prop("disabled", true);
$("#screen-share-btn").prop("disabled", true);
$("#exit-btn").prop("disabled", true);
</script>
<script src="js/agora-interface.js"></script>
<script src="js/agoraBroadcastClient.js"></script>
<script src="js/ui.js"></script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment