Tutorial

How To Stream Videos With Nginx and JWPlayer on CentOS 6

Published on May 31, 2013
Default avatar

By Bulat Khamitov

How To Stream Videos With Nginx and JWPlayer on CentOS 6

Status: Deprecated

This article covers a version of CentOS that is no longer supported. If you are currently operating a server running CentOS 6, we highly recommend upgrading or migrating to a supported version of CentOS.

Reason: CentOS 6 reached end of life (EOL) on November 30th, 2020 and no longer receives security patches or updates. For this reason, this guide is no longer maintained.

See Instead:
This guide might still be useful as a reference, but may not work on other CentOS releases. If available, we strongly recommend using a guide written for the version of CentOS you are using.

Step 1 - Install Nginx

rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
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
wget http://www.longtailvideo.com/download/jwplayer-3359.zip
unzip jwplayer-3359.zip

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.

<html>
<body>
<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 });
</script>

</body>
</html>

Navigate over to your cloud server's IP and playback filename (http://198.199.88.112/player.html in our example):

And you are all done!

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about us


About the authors
Default avatar
Bulat Khamitov

author

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
5 Comments


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sorry, but this is NOT streaming server. This is a simple media player. The streaming url starts with rtmp and the JW Player is not configured to play RTMP.

How to connect with my wedcam? or camera

What happen? Do you think it is a stream video?

Can you do an article on how to record streaming video?

Very cool!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel