Bulat Khamitov
We hope you find this tutorial helpful. In addition to guides like this one, we provide simple cloud infrastructure for developers. Learn more →

How To Stream Videos With Nginx and JWPlayer on CentOS 6

Posted May 31, 2013 26.9k views Nginx CentOS

Step 1 - Install Nginx

rpm -ivh
yum -y install nginx
chkconfig nginx on && service nginx restart

Step 2 - Download JWPlayer

You can get the latest version from their website

cd /usr/share/nginx/html

Now that you have your JWPlayer installed in /usr/share/nginx/html/jwplayer you would need to add an HTML file that calls it.

Step 3 - Create an HTML file for playback

You can either embed this code into your existing webpages, or create a new file player.html and save it to /usr/share/nginx/html/player.html

From our previous article we have "big_buck_bunny_720p_surround.flv" flash file available for playback.

<script type="text/javascript" src="/jwplayer/jwplayer.js"></script>
<div id="myElement">Loading the player...</div>

<script type="text/javascript">
jwplayer("myElement").setup({ file: "big_buck_bunny_720p_surround.flv",
"autoStart": true });


Navigate over to your cloud server's IP and playback filename ( in our example):

And you are all done!


Creative Commons License