mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
here goes nothin
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* global Buffer */
|
||||
import { buildAuthHeader } from './whepAuth.js';
|
||||
|
||||
const RTC_CONFIG = {
|
||||
iceServers: [
|
||||
@@ -9,24 +9,6 @@ const RTC_CONFIG = {
|
||||
rtcpMuxPolicy: 'require',
|
||||
};
|
||||
|
||||
|
||||
function encodeBase64(value) {
|
||||
if (typeof btoa === 'function') {
|
||||
return btoa(value);
|
||||
}
|
||||
if (typeof Buffer !== 'undefined') {
|
||||
return Buffer.from(value).toString('base64');
|
||||
}
|
||||
throw new Error('No base64 encoder available');
|
||||
}
|
||||
|
||||
function buildAuthHeader(token) {
|
||||
if (!token) return {};
|
||||
const credential = `${token}:${token}`;
|
||||
const encoded = encodeBase64(credential);
|
||||
return { Authorization: `Basic ${encoded}` };
|
||||
}
|
||||
|
||||
export class WhepPlayer {
|
||||
constructor({ url, token, video, onStatus }) {
|
||||
this.url = url;
|
||||
|
||||
Reference in New Issue
Block a user