mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-13 14:20:01 -04:00
enable testing from frontend
This commit is contained in:
parent
5132ad5eda
commit
4e739d6396
1 changed files with 5 additions and 0 deletions
|
@ -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));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue