WebRTC Player library is a wrapper over Media Server independent WebRTC player that allows for direct usage within a web browser.
<script defer="defer" src="webrtc-player-lib-0.12.0.min.js"></script>
const video = document.querySelector('video');
const player = new WebRTCPlayer({
video: video,
type: 'whep',
statsTypeFilter: '^candidate-*|^inbound-rtp'
});
player.load(new URL('https://127.0.0.1:8443/live/whep'));
<!DOCTYPE html>
<html>
<head>
<script defer="defer" src="webrtc-player-lib-0.12.0.min.js"></script>
</head>
<body>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded",
const video = document.querySelector('video');
const player = new WebRTCPlayer({
video: video,
type: 'whep',
statsTypeFilter: '^candidate-*|^inbound-rtp'
});
player.load(new URL('https://127.0.0.1:8443/live/whep'));
});
</script>
</body>
</html>