Home arrow PHP arrow Video Streaming PHP Script Tutorial

Video Streaming PHP Script Tutorial

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.

TABLE OF CONTENTS:
  1. Video Streaming PHP Script Tutorial
  2. Design of the Application
  3. Upload video files and create a MySQL table
  4. The PHP script: Streamvideo.php
By: Codex-M
Rating: starstarstarstarstar / 34
January 27, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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.



 
 
>>> More PHP Articles          >>> More By Codex-M
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap

Dev Shed Tutorial Topics: