Skip to content

Commit

Permalink
fix(MediaMTX): fix connection issue
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Aug 23, 2024
1 parent adf67d5 commit f379710
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/webcams/streamers/WebrtcMediaMTX.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export default class WebrtcMediaMTX extends Mixins(BaseMixin, WebcamMixin) {
try {
const res = await fetch(this.url, { method: 'OPTIONS' })
if (res.status !== 200) new Error('bad status code')
await this.onIceServers(res)
} catch (err) {
this.log('error: Cannot connect to backend')
Expand All @@ -211,6 +212,8 @@ export default class WebrtcMediaMTX extends Mixins(BaseMixin, WebcamMixin) {
}
async onIceServers(res: Response) {
this.log('start onIceServers')
const iceServers = this.linkToIceServers(res.headers.get('Link'))
this.log('ice servers:', iceServers)
Expand Down

0 comments on commit f379710

Please sign in to comment.