0

my CCTV software sucks, so i'm just trying to find the data stream/url so I can just put it into my own webpage or just view it without using the DVR's server.

I think I have found the link, however i'm getting the following error:

Access to XMLHttpRequest at 'rtsp://192.168.0.7:8240/PSIA/streaming/channels/101' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.

Any ideas? I have got AlienDVR, below is the code:

<!DOCTYPE html>
<html>
<head>
    <title>Live Cam</title>
</head>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<body>
<video id="video" autoplay="true" controls="controls" type='application/x-mpegURL'></video>
<script>
    if (Hls.isSupported()) {
        var video = document.getElementById('video');
        var hls = new Hls();
        // bind them together
        hls.attachMedia(video);
        hls.on(Hls.Events.MEDIA_ATTACHED, function () {
            console.log("video and hls.js are now bound together !");
            hls.loadSource("rtsp://192.168.0.7:8240/PSIA/streaming/channels/101");
            hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
            });
        });
    }
</script>
</body>
</html>
Martyn Ball
  • 4,679
  • 8
  • 56
  • 126

1 Answers1

0

Hey,

You are trying to read an RTSP stream as a HLS stream. I see that hls.js support MPEG so you have to find a MPEG url of your DVR, or an HLS url, but that is normally not a feature was a DVR have, most DVR's have MJPEG or RTSP.

If you want to go with RTSP you can try to use VLC Web Plugin

hope that helps u a little bit.

Christoph
  • 647
  • 5
  • 18