Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix relative webcam urls on multi instances #1162

Merged
merged 2 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/components/webcams/Mjpegstreamer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ export default class Mjpegstreamer extends Mixins(BaseMixin) {
get url() {
const baseUrl = this.camSettings.urlStream
let url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
url.port = this.hostPort.toString()

if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)

return decodeURIComponent(url.toString())
Expand Down
2 changes: 0 additions & 2 deletions src/components/webcams/MjpegstreamerAdaptive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
const baseUrl = this.camSettings.urlSnapshot

let url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
url.port = this.hostPort.toString()

if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)

url.searchParams.append('bypassCache', this.refresh.toString())
Expand Down
2 changes: 0 additions & 2 deletions src/components/webcams/Uv4lMjpeg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export default class Uv4lMjpeg extends Mixins(BaseMixin) {
get url() {
const baseUrl = this.camSettings.urlStream
let url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
url.port = this.hostPort.toString()

if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)

return decodeURIComponent(url.toString())
Expand Down