Note: Not a live demo, server configuration is just for example. For live working example try the Millicast Publisher and Subscriber example. Or AWS Kinesis Publisher and Subscriber example.
<div class="flex w-full h-auto my-auto">
<video class="video-js vjs-default-skin vjs-fluid " crossorigin="anonymous" controls="" id="wowza-conference-1"></video>
</div>
<script type="text/javascript">
var player = videojs("wowza-conference-1", {
"plugins": {
"peakmeter": {
"verticalMeter": false
},
"rtcconference": {
"container": "#conference-container",
"master": true
},
"rtcpublisher": {
"applicationName": "webrtc/room1",
"autoStartDevice": true,
"buttons": false,
"conferenceSubscribeHls": false,
"hlsTemplate": "https://{serverURL}/{appName}/{streamName}/playlist.m3u8",
"publishToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3ZWJydGMiLCJpYXQiOjE2MzczMzAyNTksImV4cCI6MTY2ODg2NjI1OSwiYXVkIjoid3d3LmV4YW1wbGUuY29tIiwic3ViIjoianJvY2tldEBleGFtcGxlLmNvbSIsInN0cmVhbU5hbWUiOiJDNkx4Nmt1NkZFWGdLdHQifQ.4_38rdgyqWabGvoV6WZREjrqevVeGIgCKK7xOknwGx4",
"publisher": true,
"seperateScreen": true,
"server": "wowza-conference",
"serverURL": "rtc.electroteque.org"
}
},
"sources": [
{
"appName": "webrtc",
"src": "C6Lx6ku6FEXgKtt",
"type": "application/webrtc"
}
],
"title": "Participant 1"
});
player.on("selectedParticipant", (e, participant) => {
console.log("selected participant", participant);
});
player.on("unselectedParticipant", (e, participant) => {
console.log("unselected participant", participant);
});
player.on("participantleft", (e, sender) => {
});
player.on("participantfeatured", (e, sender) => {
});
player.on("participantunfeatured", (e, sender) => {
});
player.on("leaveroom", e => {
});
player.on("roomjoinfailed", e => {
});
player.on("existingparticipants", (e, sender) => {
});
</script>