New WebRTC and Video Player

This commit is contained in:
2025-10-02 19:10:49 +05:30
parent c452853160
commit c4e868490e
2 changed files with 5 additions and 3 deletions
+1 -3
View File
@@ -125,8 +125,6 @@ const {
</div> </div>
<script> <script>
import { WebRTCPlayer } from "@eyevinn/webrtc-player";
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
const videoCardEl = document.getElementById("video-card"); const videoCardEl = document.getElementById("video-card");
const videoEl = document.getElementById("live-video"); const videoEl = document.getElementById("live-video");
@@ -149,7 +147,7 @@ const {
async function startPlayer() { async function startPlayer() {
try { try {
if (videoEl) if (videoEl)
player = new WebRTCPlayer({ player = new window.WebRTCPlayer({
video: videoEl as HTMLVideoElement, video: videoEl as HTMLVideoElement,
type: "whep", type: "whep",
statsTypeFilter: "^candidate-*|^inbound-rtp", statsTypeFilter: "^candidate-*|^inbound-rtp",
+4
View File
@@ -1,3 +1,6 @@
import { WebRTCPlayer } from "@eyevinn/webrtc-player";
declare global { declare global {
interface Window { interface Window {
schema: any; schema: any;
@@ -5,6 +8,7 @@ declare global {
upload: any; upload: any;
myModal_open: any; myModal_open: any;
myModal_close: any; myModal_close: any;
WebRTCPlayer: typeof WebRTCPlayer
} }
} }