connection manager: add getters.

This commit is contained in:
Miroslav Šedivý 2021-07-11 22:41:10 +02:00
parent 471b26ace5
commit bbb80730fb

View File

@ -111,10 +111,18 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
this._url = url.replace(/^http/, 'ws').replace(/\/+$/, '') + '/api/ws' this._url = url.replace(/^http/, 'ws').replace(/\/+$/, '') + '/api/ws'
} }
public getUrl(): string {
return this._url
}
public setToken(token: string) { public setToken(token: string) {
this._token = token this._token = token
} }
public getToken(): string {
return this._token
}
public setVideo(video: string) { public setVideo(video: string) {
if (!this._state.webrtc.videos.includes(video)) { if (!this._state.webrtc.videos.includes(video)) {
throw new Error('video id not found') throw new Error('video id not found')