@@ -2,7 +2,7 @@ import { Observable, Subject } from 'rxjs'
2
2
3
3
import { Channel , ChannelType } from '../../Channel'
4
4
import '../../misc/env'
5
- import { env } from '../../misc/env'
5
+ import { env , RTCDataChannelEvent } from '../../misc/env'
6
6
import { log } from '../../misc/util'
7
7
import { dataChannelBuilder as proto } from '../../proto'
8
8
import { WebChannel } from '../../WebChannel'
@@ -121,7 +121,7 @@ export class DataChannelBuilder extends Service<proto.IMessage, proto.Message> {
121
121
} else {
122
122
remote = this . createRemote ( streamId , id )
123
123
}
124
- const dc = remote . pc . createDataChannel ( this . wc . myId . toString ( ) )
124
+ const dc = ( remote . pc as any ) . createDataChannel ( this . wc . myId . toString ( ) )
125
125
const offerInit = await remote . pc . createOffer ( )
126
126
await remote . pc . setLocalDescription ( offerInit )
127
127
@@ -148,8 +148,8 @@ export class DataChannelBuilder extends Service<proto.IMessage, proto.Message> {
148
148
)
149
149
if ( passive ) {
150
150
log . webrtc ( `create a new remote object with ${ id } - PASSIVE` )
151
-
152
- remote . pc . ondatachannel = ( { channel : dc } : RTCDataChannelEvent ) => {
151
+ const pc = remote . pc as any
152
+ pc . ondatachannel = ( { channel : dc } : RTCDataChannelEvent ) => {
153
153
const peerId = Number . parseInt ( dc . label , 10 )
154
154
let type : ChannelType
155
155
if ( streamId === this . wc . STREAM_ID ) {
0 commit comments