diff --git a/.m1k1o/chromium/Dockerfile b/.m1k1o/chromium/Dockerfile index b43b1d9..f207cf6 100644 --- a/.m1k1o/chromium/Dockerfile +++ b/.m1k1o/chromium/Dockerfile @@ -1,6 +1,6 @@ FROM m1k1o/neko:base -ARG SRC_URL="https://github.com/macchrome/linchrome/releases/download/v88.0.4324.96-r827102-portable-ungoogled-Lin64/ungoogled-chromium_88.0.4324.96_1.vaapi_linux.tar.xz" +ARG SRC_URL="https://github.com/macchrome/linchrome/releases/download/v89.0.4389.90-r843830-portable-ungoogled-Lin64/ungoogled-chromium_89.0.4389.90_1.vaapi_linux.tar.xz" # # install custom chromium build from woolyss with support for hevc/x265 diff --git a/client/src/components/connect.vue b/client/src/components/connect.vue index 26b4511..ab52357 100644 --- a/client/src/components/connect.vue +++ b/client/src/components/connect.vue @@ -151,14 +151,21 @@ @Component({ name: 'neko-connect' }) export default class extends Vue { - private autoPassword = new URL(location.href).searchParams.get('pwd') + private autoPassword: string | null = new URL(location.href).searchParams.get('pwd') private displayname: string = '' - private password: string = this.autoPassword || '' + private password: string = '' mounted() { - if (this.$accessor.displayname !== '' && this.$accessor.password !== '') { - this.$accessor.login({ displayname: this.$accessor.displayname, password: this.$accessor.password }) + let password = this.$accessor.password + if (this.autoPassword !== null) { + this.removeUrlParam('pwd') + password = this.autoPassword + } + + if (this.$accessor.displayname !== '' && password !== '') { + this.$accessor.login({ displayname: this.$accessor.displayname, password }) + this.autoPassword = null } } @@ -188,16 +195,15 @@ } async login() { - try { - await this.$accessor.login({ - displayname: this.displayname, - password: this.password, - }) + let password = this.password + if (this.autoPassword !== null) { + password = this.autoPassword + } - if (this.autoPassword) { - this.removeUrlParam('pwd') - this.autoPassword = '' - } + try { + await this.$accessor.login({ displayname: this.displayname, password }) + + this.autoPassword = null } catch (err) { this.$swal({ title: this.$t('connect.error') as string, diff --git a/client/src/neko/base.ts b/client/src/neko/base.ts index 9cad66f..de2532b 100644 --- a/client/src/neko/base.ts +++ b/client/src/neko/base.ts @@ -19,6 +19,7 @@ export abstract class BaseClient extends EventEmitter { protected _displayname?: string protected _state: RTCIceConnectionState = 'disconnected' protected _id = '' + protected _candidates: RTCIceCandidate[] = [] get id() { return this._id @@ -220,6 +221,12 @@ export abstract class BaseClient extends EventEmitter { this._channel.onclose = this.onDisconnected.bind(this, new Error('peer data channel closed')) this._peer.setRemoteDescription({ type: 'offer', sdp }) + + for (let candidate of this._candidates) { + this._peer.addIceCandidate(candidate) + } + this._candidates = [] + this._peer .createAnswer() .then((d) => { @@ -250,7 +257,11 @@ export abstract class BaseClient extends EventEmitter { if (event === EVENT.SIGNAL.CANDIDATE) { const { data } = payload as SignalCandidatePayload let candidate: RTCIceCandidate = JSON.parse(data) - this._peer!.addIceCandidate(candidate) + if (this._peer) { + this._peer.addIceCandidate(candidate) + } else { + this._candidates.push(candidate) + } return } diff --git a/server/internal/gst/gst.go b/server/internal/gst/gst.go index d6588da..df052fa 100644 --- a/server/internal/gst/gst.go +++ b/server/internal/gst/gst.go @@ -90,7 +90,7 @@ func CreateAppPipeline(codecName string, pipelineDevice string, pipelineSrc stri if pipelineSrc != "" { pipelineStr = fmt.Sprintf(pipelineSrc+pipelineStr, pipelineDevice) } else { - pipelineStr = fmt.Sprintf(videoSrc+"vp8enc target-bitrate=%d cpu-used=4 end-usage=cbr threads=4 deadline=1 undershoot=95 buffer-size=%d buffer-initial-size=%d buffer-optimal-size=%d keyframe-max-dist=30 min-quantizer=3 max-quantizer=40"+pipelineStr, pipelineDevice, fps, bitrate*1000, bitrate*6, bitrate*4, bitrate*5) + pipelineStr = fmt.Sprintf(videoSrc+"vp8enc target-bitrate=%d cpu-used=4 end-usage=cbr threads=4 deadline=1 undershoot=95 buffer-size=%d buffer-initial-size=%d buffer-optimal-size=%d keyframe-max-dist=180 min-quantizer=3 max-quantizer=40"+pipelineStr, pipelineDevice, fps, bitrate*1000, bitrate*6, bitrate*4, bitrate*5) } case "VP9": // https://gstreamer.freedesktop.org/documentation/vpx/vp9enc.html?gi-language=c