set URL from query.

This commit is contained in:
Miroslav Šedivý 2022-09-14 22:16:44 +02:00
parent a1860d5f56
commit 80e5277fb6
2 changed files with 15 additions and 2 deletions

View File

@ -94,7 +94,12 @@
export default class extends Vue { export default class extends Vue {
@Prop() readonly neko!: Neko @Prop() readonly neko!: Neko
url: string = location.href @Watch('neko.state.connection.url')
updateUrl(url: string) {
this.url = url
}
url: string = ''
async setUrl() { async setUrl() {
if (this.url == '') { if (this.url == '') {

View File

@ -5,7 +5,7 @@
<neko-header :neko="neko" @toggle="expanded = !expanded" /> <neko-header :neko="neko" @toggle="expanded = !expanded" />
</div> </div>
<div class="video-container"> <div class="video-container">
<neko-canvas ref="neko" autologin autoconnect autoplay /> <neko-canvas ref="neko" :server="server" autologin autoconnect autoplay />
<div v-if="loaded && neko.private_mode_enabled" class="player-notif">Private mode is currently enabled.</div> <div v-if="loaded && neko.private_mode_enabled" class="player-notif">Private mode is currently enabled.</div>
<div <div
v-if="loaded && neko.state.connection.type === 'webrtc' && !neko.state.video.playing" v-if="loaded && neko.state.connection.type === 'webrtc' && !neko.state.video.playing"
@ -366,6 +366,8 @@
loaded: boolean = false loaded: boolean = false
tab: string = '' tab: string = ''
server: string = location.href
uploadActive = false uploadActive = false
uploadProgress = 0 uploadProgress = 0
@ -399,6 +401,12 @@
//@ts-ignore //@ts-ignore
window.neko = this.neko window.neko = this.neko
// initial URL
const url = new URL(location.href).searchParams.get('url')
if (url) {
this.server = url
}
// //
// connection events // connection events
// //