enable testing from frontend

This commit is contained in:
Spencer Pogorzelski 2023-08-11 16:57:32 -07:00
parent 5132ad5eda
commit 4e739d6396

View file

@ -1,4 +1,5 @@
import { import {
BareClient,
registerRemoteListener, registerRemoteListener,
setBareClientImplementation, setBareClientImplementation,
} from "bare-client-custom"; } from "bare-client-custom";
@ -46,6 +47,8 @@ let bare = new AdriftBareClient(connection);
setBareClientImplementation(bare); setBareClientImplementation(bare);
registerRemoteListener(); registerRemoteListener();
window["bare"] = new BareClient();
export default class App extends Component { export default class App extends Component {
rtc = rtc; rtc = rtc;
@ -79,6 +82,8 @@ export default class App extends Component {
const { answer, candidates } = await r.json(); const { answer, candidates } = await r.json();
await this.rtc.answer(answer, candidates); await this.rtc.answer(answer, candidates);
alert("connected"); alert("connected");
} else {
window["bare"].fetch("https://httpbin.org/get");
} }
// setOffer(JSON.stringify(offer)); // setOffer(JSON.stringify(offer));