mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Fix TURN credentials for interactive video + other Gemini Audio Video demo tweaks (#297)
* Gemini * Add code * demo tweaks
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
export let stream_every = 1;
|
||||
export let server: {
|
||||
offer: (body: any) => Promise<any>;
|
||||
turn: () => Promise<any>;
|
||||
};
|
||||
|
||||
export let include_audio: boolean;
|
||||
@@ -145,6 +146,14 @@
|
||||
|
||||
async function start_webrtc(): Promise<void> {
|
||||
if (stream_state === "closed") {
|
||||
await server.turn().then((rtc_configuration_) => {
|
||||
if (rtc_configuration_.error) {
|
||||
dispatch("error", rtc_configuration_.error);
|
||||
return;
|
||||
}
|
||||
rtc_configuration = rtc_configuration_;
|
||||
console.info("rtc_configuration", rtc_configuration_);
|
||||
});
|
||||
pc = new RTCPeerConnection(rtc_configuration);
|
||||
pc.addEventListener("connectionstatechange", async (event) => {
|
||||
switch (pc.connectionState) {
|
||||
|
||||
Reference in New Issue
Block a user