One of the most important features in a website is the ability to show videos to your visitors. There are a lot of video hosting solutions nowadays, with YouTube as the most popular. However, due to its popularity, there are lots of services -- even free services -- that let viewers download your video files after you've uploaded them to YouTube. If you need to restrict downloading of your files, keep reading.
If your videos are for viewing purposes only and you need to strictly restrict downloading, then this tutorial can help you. Unlike YouTube, where all your uploaded videos are viewable in a single channel (thus any infringer can easily locate and download all of them), if you use the technique discussed in this tutorial then viewers cannot locate where you have saved all of your videos.
The benefits of using this application include:
Obfuscation of the real URL path to your video file.
Saving the bandwidth that would otherwise be expended from massive amounts of downloading due to an exposed directory.
Increased protection of your copyrighted video content online.
This is not a perfect solution, but it will add an extra layer of security which makes it very hard for ordinary surfers to download your protected video content. If you are interested, then keep reading.
Important Requirements
This PHP script application will NOT work in all hosting scenarios. Before you will implement this in your web server, consider the following requirements carefully to make sure your hosting features supports it.
Enable readfile/fopen PHP functions. You can use your phpinfo or ask your web hosting support about this. In my experience, these are only disabled in free web hosting accounts for security reasons.
You must be able to use FTP and MySQL databases. Some web hosting companies, particularly the free ones, will not support FTP or even MySQL databases, so you cannot implement this script.
Your hosting account must allow you to upload video files such as MPG, WMV or MOV, etc.
You must have a LAMPP hosting configuration. This means your server will be using the Linux operating system in Apache and a MySQL environment, using the PHP server side scripting language.