1

I want to stream on a webpage a video live that I receive from a server (with ffserver). So far when I write a very simple code:

<head>
    <script src="http://www.andy-howard.com/js/libs/jquery-1.8.2.min.js"></script>
    <link href="http://vjs.zencdn.net/4.12.6/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/4.12.6/video.js"></script>
    </style>
</head>
<body>
   <video id="video1" class="video-js vjs-default-skin" width="640" height="480" controls="controls"
        preload="auto" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/NYC_Times_Square_wide_angle.jpg/640px-NYC_Times_Square_wide_angle.jpg" >
        <source src="http://10.172.180.235:8090/live.flv" type="video/x-flv">
    </video>
</body>

then it doesn't work. But when I replace the line:

<source src="http://10.172.180.235:8090/live.flv" type="video/x-flv">

with this one:

<source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4">

then I can see the stream, but it comes from a file... Is there a way to display on my webpage live stream coming from ffserver? Thanks.

randomuser1
  • 2,733
  • 6
  • 32
  • 68

1 Answers1

0

Web video is complicated, most browsers support different video formats (codecs), mostly a selection of MP4, OGG or WEBM.

I am not sure any browser will play flv files directly. I think flv is normally used with Flash, so you would need a Flash app on the website to show it.

If you want to play the live video with the browser's internal video player you should configure your server to deliver in the format MP4, OGG and WEBM.

More info on web video: http://diveintohtml5.info/video.html

Mike
  • 164
  • 3
  • 11