I use the Video.js player to broadcast live content from my local webcam (but, I think, it does not matter in this case, it can be any live stream from the Internet). I wrote a very simple code:
<head> <link href="video-js.css" rel="stylesheet"> <script src="http://www.andy-howard.com/js/libs/jquery-1.8.2.min.js"></script> <script src="http://vjs.zencdn.net/c/video.js"></script> <link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet"> </style> </head> <body> <video id="video1" class="video-js vjs-default-skin" width="640" height="480" controls="controls" preload="auto" data-setup='{}' autoplay="true" > <source src="http://10.172.180.31:8090/live.flv" type="video/x-flv"> </video> </body>
And now in this configuration I see the contents of the stream, but there are a couple of errors:
1) I do not see the controls (to pause the stream)
2) The stream looks like this , so the video does not change to the full size of the component. BUT (and this is really interesting), when I resize elements on a web page (for example, in Chrome, holding control and scrolling the mouse wheel) to 110%, then the video fills the entire component. It seems that the error in video.js or maybe my implementation is wrong?
3) when I remove the autoplay="true" parameter - nothing is displayed, the controls and video disappeared, and it is impossible to play it.
4) I wanted to remove autoplay="true" , but adding information about the poster, turning on poster="http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/NYC_Times_Square_wide_angle.jpg/640px-NYC_Times_Square_wide_angle.jpg" - nothing has changed, the stream is not displayed, the controls are missing there.
5) when I remove the data-setup parameter and leave it like this: <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" > then the controls and poster are visible (this is great! ), but the play button is grayed out and it is not possible to play my stream.
I want to achieve the effect that after loading the web page I can see the image of the poster with the play button, and when I click on it - I will see a properly adjusted stream. What am I missing? Thanks!