[webLive] Live broadcast with Flv.js+OBS

Environmental preparation

Start the LiveGo server

  • Double-click the unzipped livego.exe

Start OBS and set up

  • Open OBS


  • To add a media source, add a local flv file

  • start streaming

Write test HTML and start Nginx

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用flv.js来做直播</title>
</head>
<body>
    <script src="flv.min.js"></script>
    <video id="videoElement"></video>
    <script>
        if (flvjs.isSupported()) {
            var videoElement = document.getElementById('videoElement');
            var flvPlayer = flvjs.createPlayer({
                type: 'flv',
                isLive: true,
                url: 'http://127.0.0.1:7001/live/test.flv'
            });
            flvPlayer.attachMediaElement(videoElement);
            flvPlayer.load();
            flvPlayer.play();
        }
    </script>
</body>
</html>
  • Point this html with Nginx
  • Initiate browser access

renderings

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326075850&siteId=291194637