Skip to content

第一帧和第二帧间隔太长无法正常播放 #812

@songbiaoself

Description

@songbiaoself

在对接海康威视RTSP流媒体的时候,出现后端数据拥塞的情况,导致第一帧和第二帧会间隔10多秒后返回给前端(后续帧时间正常),这时,前端会一直卡在这个页面转圈,还请给一个解决方案。
5C341529-BF21-4f83-B02A-AF655FB1021C

前端代码:

function toPlay() {
        if (!mpegts.isSupported()) {
            alert("不支持flvjs");
            return;
        }
        let path = document.getElementById("rtspPath").value;
        this.player = mpegts.createPlayer({
            type: "flv",
            isLive: true,
            url: "ws://127.0.0.1:8080/rtsp/1"
        });
        this.player.attachMediaElement(videDoc);
        try {
            this.player.load();
            this.player.play();
        } catch (error) {
            console.log(error);
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions