Refactor signaling for video and audio (#39)

* refactor webrtc video and audio.

* do not reconnect if video is disabled.

* export webrtc types.
This commit is contained in:
Miroslav Šedivý
2023-06-26 21:27:26 +02:00
committed by GitHub
parent 52107f5934
commit e58aecc49c
9 changed files with 159 additions and 62 deletions

View File

@ -137,6 +137,13 @@
>
webrtc is paused
</td>
<td
colspan="2"
style="background: darkviolet; text-align: center"
v-else-if="neko.state.connection.webrtc.video.disabled"
>
video is disabled
</td>
<td
colspan="2"
style="background: red; text-align: center"
@ -158,15 +165,37 @@
</td>
</tr>
<tr>
<th>connection.webrtc.video</th>
<td>{{ neko.state.connection.webrtc.video }}</td>
</tr>
<tr>
<th>connection.webrtc.auto</th>
<th title="connection.webrtc.video.disabled">connection.webrtc.video.disab..</th>
<td>
<div class="space-between">
<span>{{ neko.state.connection.webrtc.auto }}</span>
<button @click="neko.setWebRTCVideo(undefined, !neko.state.connection.webrtc.auto)">
<span>{{ neko.state.connection.webrtc.video.disabled }}</span>
<button @click="neko.setWebRTCVideo({ disabled: !neko.state.connection.webrtc.video.disabled })">
<i class="fas fa-toggle-on"></i>
</button>
</div>
</td>
</tr>
<tr>
<th>connection.webrtc.video.id</th>
<td>{{ neko.state.connection.webrtc.video.id }}</td>
</tr>
<tr>
<th>connection.webrtc.video.auto</th>
<td>
<div class="space-between">
<span>{{ neko.state.connection.webrtc.video.auto }}</span>
<button @click="neko.setWebRTCVideo({ auto: !neko.state.connection.webrtc.video.auto })">
<i class="fas fa-toggle-on"></i>
</button>
</div>
</td>
</tr>
<tr>
<th title="connection.webrtc.audio.disabled">connection.webrtc.audio.disab..</th>
<td>
<div class="space-between">
<span>{{ neko.state.connection.webrtc.audio.disabled }}</span>
<button @click="neko.setWebRTCAudio({ disabled: !neko.state.connection.webrtc.audio.disabled })">
<i class="fas fa-toggle-on"></i>
</button>
</div>
@ -178,7 +207,10 @@
</tr>
<tr>
<td>
<select :value="neko.state.connection.webrtc.video" @input="neko.setWebRTCVideo($event.target.value, false)">
<select
:value="neko.state.connection.webrtc.video.id"
@input="neko.setWebRTCVideo({ selector: { id: $event.target.value } })"
>
<option v-for="video in neko.state.connection.webrtc.videos" :key="video" :value="video">
{{ video }}
</option>