Video.js: Does videojs support play rtmp streaming by html5?

Created on 28 Jul 2017  路  5Comments  路  Source: videojs/video.js

Does videojs support play rtmp streaming by html5?

Code is below and i forbid all of flash feature in chrome browser.
why it's workable?

<html>
<head>

<link href="http://vjs.zencdn.net/5.4.6/video-js.min.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/5.4.6/video.min.js"></script>

<script>
  videojs.options.flash.swf = "VideoJS.swf";
</script>

</head>
<body>
  <!-- video.js -->
  <video id="myvideo" class="video-js vjs-default-skin vjs-16-9" controls
 preload="auto" width="640" height="264" poster="my_video_poster.png"
data-setup="{}">
    <source src="rtmp://...." type="rtmp/flv" />
  </video>
  <script>
    var player = videojs('myvideo');
    player.play();
  </script>

</body>
</html>

All 5 comments

RTMP can only be played with Flash

Hi! I have a problem when execute RTMP (type: video/x-flv) video.
The size of player is 300x300px but the video is only small square in top left side player.
Screen

<!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>

  <!-- Old version compatible with flash -->
  <!-- <link href="//vjs.zencdn.net/5.19/video-js.min.css" rel="stylesheet">
  <script src="//vjs.zencdn.net/5.19/video.min.js"></script>   -->

  <!-- New version uncompatible with flash -->
  <link href="http://vjs.zencdn.net/6.2.4/video-js.css" rel="stylesheet">
  <script src="http://vjs.zencdn.net/6.2.4/video.js"></script> 
  <script src="./videojs-flash.min.js"></script>
  <script> videojs.options.flash.swf = './video-js.swf'; </script>
</head>

<body>
  <video id="my-player" class="video-js">
    <source src="http://52.67.154.16:6604/rtmp/1501786585151/?M2MwOWNiMWQtZWQwNi00OTExLWI5ZDEtYjE1YzVjZmVkYmI3LDEsMTExMTExMSwwLDEsMCww" type="video/x-flv"></source>
  </video>
</body>

<script>
  videojs('my-player', {
    controls: true,
    autoplay: true,
    preload: 'metadata',
    flash: {
      swf: './video-js.swf'
    },
    height: 300,
    width: 300,
    poster: 'https://s3-sa-east-1.amazonaws.com/v2share-s3/logo-v2tech.jpg',
    language: 'pt'
  });
</script>

<script>
  videojs.addLanguage('pt', {
  'Play': 'Iniciar',
  'Pause': 'Pausa',
  'Current Time': 'Tempo de Reprodu莽茫o',
  'Duration Time': 'Dura莽茫o Total',
  'Remaining Time': 'Tempo Restante',
  'Mute': 'Mudo'
})
</script>

</html>

@mister-ben thanks your reply.

Hi
can i play rtmp file from amazone in videojs with out flash player....or any other player support rtmp file with out flash.
Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aagiulian picture aagiulian  路  3Comments

borm picture borm  路  3Comments

zhulduz picture zhulduz  路  3Comments

kitsunde picture kitsunde  路  4Comments

TheKassaK picture TheKassaK  路  3Comments