rtsp-relay icon indicating copy to clipboard operation
rtsp-relay copied to clipboard

Always got disconnect

Open Nafidinara opened this issue 2 years ago • 3 comments

Hello, I always get disconnect when try to play rtsp video. this is my code: server.js

app.ws('/api/stream/', (ws, req) =>
    proxy({
        url: 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4',
        transport: 'tcp'
    })(ws),
);

rtsp.js

loadPlayer({
        url: 'ws://' + document.location.host + '/api/stream/',
        canvas: document.getElementById('canvas-video-full-6225d0f79e86472160ef180e'),
        // optional
        onPlay: (data) => {
            console.log('onPlay', Date.now());
        },
        onPause: function() {
            console.log('onPause', Date.now());
        },
        onEnded: function() {
            console.log('onEnded', Date.now());
        },
        onStalled: function() {
            console.log('onStalled', new Date.now());
        },
        onSourceCompleted: function() {
            console.log('onSourceCompleted', Date.now());
        },
        onDisconnect: function (){
            console.log('connection lost!');
        }
    });
    ```
    and I Always get return "connection lost!"
    
![image](https://user-images.githubusercontent.com/44227618/199042011-012712a4-4370-4813-abe6-6b54c121065f.png)

Nafidinara avatar Oct 31 '22 15:10 Nafidinara

Same problem. It seems that the publisher is ignoring us

keanallen avatar Dec 15 '22 06:12 keanallen

give it some time, increase the disconnectThreshold. worked for me

paliuca avatar Mar 03 '23 12:03 paliuca

While playing an RTSP video, 'onDisconnect' is always called

airwalk741 avatar Sep 14 '23 10:09 airwalk741