mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
remove connecting event.
This commit is contained in:
parent
97a213c9b3
commit
b9b311c6de
@ -33,11 +33,6 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
|
||||
Vue.set(this._state, 'type', 'webrtc')
|
||||
|
||||
// websocket
|
||||
this.websocket.on('connecting', () => {
|
||||
if (this._state.status !== 'connecting') {
|
||||
Vue.set(this._state, 'status', 'connecting')
|
||||
}
|
||||
})
|
||||
this.websocket.on('connected', () => {
|
||||
if (this.websocket.connected && this.webrtc.connected) {
|
||||
Vue.set(this._state, 'status', 'connected')
|
||||
@ -52,11 +47,6 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
|
||||
})
|
||||
|
||||
// webrtc
|
||||
this.webrtc.on('connecting', () => {
|
||||
if (this._state.status !== 'connecting') {
|
||||
Vue.set(this._state, 'status', 'connecting')
|
||||
}
|
||||
})
|
||||
this.webrtc.on('connected', () => {
|
||||
if (this.websocket.connected && this.webrtc.connected) {
|
||||
Vue.set(this._state, 'status', 'connected')
|
||||
|
@ -25,7 +25,6 @@ export interface ICEServer {
|
||||
}
|
||||
|
||||
export interface NekoWebRTCEvents {
|
||||
connecting: () => void
|
||||
connected: () => void
|
||||
disconnected: (error?: Error) => void
|
||||
track: (event: RTCTrackEvent) => void
|
||||
@ -73,8 +72,6 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
|
||||
}
|
||||
|
||||
public async connect(sdp: string, iceServers: ICEServer[]): Promise<string> {
|
||||
this._log.info(`connecting`)
|
||||
|
||||
if (!this.supported) {
|
||||
throw new Error('browser does not support webrtc')
|
||||
}
|
||||
@ -83,7 +80,7 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
|
||||
throw new Error('attempting to create peer while connected')
|
||||
}
|
||||
|
||||
this.emit('connecting')
|
||||
this._log.info(`connecting`)
|
||||
|
||||
this._peer = new RTCPeerConnection({ iceServers })
|
||||
|
||||
|
@ -2,7 +2,6 @@ import EventEmitter from 'eventemitter3'
|
||||
import { Logger } from '../utils/logger'
|
||||
|
||||
export interface NekoWebSocketEvents {
|
||||
connecting: () => void
|
||||
connected: () => void
|
||||
disconnected: (error?: Error) => void
|
||||
message: (event: string, payload: any) => void
|
||||
@ -43,7 +42,6 @@ export class NekoWebSocket extends EventEmitter<NekoWebSocketEvents> {
|
||||
this._ws = new WebSocket(url)
|
||||
|
||||
this._log.info(`connecting`)
|
||||
this.emit('connecting')
|
||||
|
||||
this._ws.onopen = this.onConnected.bind(this)
|
||||
this._ws.onclose = this.onDisconnected.bind(this, 'close')
|
||||
|
Loading…
Reference in New Issue
Block a user