diff --git a/frontend/ang_dvrip/src/app/components/stream/stream.component.ts b/frontend/ang_dvrip/src/app/components/stream/stream.component.ts index 3ecb49d..9593a68 100644 --- a/frontend/ang_dvrip/src/app/components/stream/stream.component.ts +++ b/frontend/ang_dvrip/src/app/components/stream/stream.component.ts @@ -34,7 +34,14 @@ export class StreamComponent implements OnInit { getStreamUrl() { this.http.get(`api/dvrip/stream/${this.recorder_index}/${this.channel_index}/${this.selected_stream}`).subscribe( (r:StreamUrlResponse|any) => { - const url = `${location.protocol}//${location.hostname}:${r.port == 0?+location.port:r.port}/${r.route}`; + var port; + if (location.port.length == 0) { + port = ""; + } else { + port = `:${r.port == 0?+location.port:r.port}` + } + + const url = `${location.protocol}//${location.hostname}${port}/${r.route}`; this.url = this.sanitazer.bypassSecurityTrustResourceUrl(url); this.unsafe_url = url; }