deepch / vdk

A set of libraries for building streaming services. RTSP RTMP MP4 WS TS DASH WEBRTC MP4f
MIT License
395 stars 164 forks source link

Future: remove data channel keep-alive #19

Open travishaagen opened 3 years ago

travishaagen commented 3 years ago

In format/webrtcv3/adapter.go a data-channel is required to keep the WebRTC connection open.

    peerConnection.OnDataChannel(func(d *webrtc.DataChannel) {
        d.OnMessage(func(msg webrtc.DataChannelMessage) {
            element.ClientACK.Reset(5 * time.Second)
        })
    })

I see RTSPtoWebRTC/web/static/js/app.js this note:

      //send ping becouse PION not handle RTCSessionDescription.close()
      sendChannel = pc.createDataChannel('foo');
      sendChannel.onclose = () => console.log('sendChannel has closed');
      sendChannel.onopen = () => {
        console.log('sendChannel has opened');
        sendChannel.send('ping');
        setInterval(() => {
          sendChannel.send('ping');
        }, 1000)
      }
      sendChannel.onmessage = e => log(`Message from DataChannel '${sendChannel.label}' payload '${e.data}'`);

If this is a bug/limitation in pion/webrtc, it would need to be fixed there first. Is there an issue filed with that project? I could not find one.

deepch commented 3 years ago

pion has already fixed this problem, we have removed this block.