Skip to content

Simple-player stops after about 10 seconds of play #1103

Open
@AlessandroMartinelli

Description

@AlessandroMartinelli

Hi, I'm trying to play an RTSP stream using the simple-player example.

When I press the "start" button the stream starts just fine, with very small delay etc. However, after about 10 seconds the video player stops and shows a loading spinner for 5-10 seconds, after which it starts again but sometimes the video is actually playing, sometimes it is stuck (from what I've tested so far).

When the first type of stop occurs (the "recoverable" one) I have the following error

simple-player.js:64  Play failed TypeError: Failed to execute 'enqueue' on 'ReadableStreamDefaultController': Cannot enqueue a chunk into a closed readable stream
    at P.sendRequest (msl-streams.min.js:15:1181)
    at t (msl-streams.min.js:15:4218)
    at new Promise (<anonymous>)
    at P.do (msl-streams.min.js:15:4158)
    at P.fetch (msl-streams.min.js:15:3838)
    at P.play (msl-streams.min.js:15:2670)
    at simple-player.js:63:19

while when the second type of stop occurs (the "non recoverable" one) I have the following error:

failed to keep alive RTSP session: TypeError: Failed to execute 'enqueue' on 'ReadableStreamDefaultController': Cannot enqueue a chunk into a closed readable stream at log.ts:34
Video.mp4

Not sure if this has anything to do about it, but in an older release of Media Stream Library I used to use the following code chunk, copied from an example of yours:

    // Restart stream on RTCP BYE (stream ended)
    pipeline.rtsp.onRtcp = (rtcp) => {
        if (isRtcpBye(rtcp)) {
            setTimeout(() => play(host, 'h264'), 0);
        }
    };

However the above code chunk doesn't work with the current release of Media Stream Library.

In a production environment where the user has the possibility to navigate between the pages of the web app and consequently start/stop video streams as much as he/she wants, this behavior is not acceptable.

Can you please help me out?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionDiscussion about functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions