W
W
Wasya UK2019-03-01 13:26:42
HTML
Wasya UK, 2019-03-01 13:26:42

How to run flv video in html?

I stream video in flv format using flv.js, but it works for me only in chrome, even in Yandex it does not display video. There is no alert, but the video does not play either (only in chrome). Are there any paid alternatives to offer.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script>
</head>
<body>
  <object type="application/x-shockwave-flash" data="http://localhost:8000/live/STREAM_NAME.flv" width="400" height="300">
     <param name="movie" value="player_flv_maxi.swf" />
     <param name="FlashVars" value="flv=http://localhost:8000/live/STREAM_NAME.flv" />
</object>
  <video id="videoElement" width="600"></video>
  <script>
      if (flvjs.isSupported()) {
          var videoElement = document.getElementById('videoElement');
          var flvPlayer = flvjs.createPlayer({
              type: 'flv',
              url: 'ws://localhost:8000/live/STREAM_NAME.flv'
          });
          flvPlayer.attachMediaElement(videoElement);
          flvPlayer.load();
          flvPlayer.play();
      }
  </script>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question