Skip to main content

Blog Post

Integrating Video Into Drupal

Web video is here to stay. If your Drupal site's not using video now, you'll probably be implementing it very soon just to keep up with the Jones's. Navigating the vast landscape of web video terminology, best practices and hosting providers is its own project in and of itself. A Drupal site administrator that's taking on the task of implementing a suitable web video solution can quickly become overwhelmed. We've had the opportunity to work on several Drupal projects involving web video implementation. Here are several pieces of the video puzzle that should be considered before settling on a video solution. Determine Your Bandwidth Needs Bandwidth is the amount of data that will be transmitted to users' browsers. If your desire is for video media to appear as crisp and clean as possible, you'll need a higher bandwidth for delivering the video file. That's because it takes a lot of bandwidth to deliver video that is close to its original file size. However, bandwidth can be compromised by compressing your video. While your video may appear fuzzy at times, it shouldn't be so much that it completely degrades the quality of the video to obscure faces and objects. Another bandwidth consideration is the number of expected site visitors that will view video. The higher the number of expected visitors, the more bandwidth will be needed. Using this Video Bandwidth Estimator can help you determine how much bandwidth you may need. Video Delivery: Streaming or Progressive Download? Two options exist for delivering video data to the end user. Streaming or Progressive Download. Both options have their pros and cons. Streaming media uses the rmtp protocol for transmitting video data. Additionally, the server that's transmitting the data needs to have special software installed that streams data. The benefit of streaming video is the video can be played at the same time the video file is being downloaded to a viewer's browser with no delays in video playback. Conversely, progressive download uses standard http protocol and does not require special server software. The benefit of progressive download is it's often less costly because no special server software is needed. The drawback of progressive download is the web browser often has to buffer the video download, creating a delay in video playback at different points in time. Boiling it down to cost, streaming video hosting costs more than progressive download. Determine the Amount of Video Storage Needed Another consideration in determining a video hosting solution is storage. How often do you expect users to upload video? Will your site just be tailored to showing videos the site owner has uploaded? If the former, you'll need to plan your hosting budget accordingly, taking into account how much video could potentially be posted to your site. Plan with growth in mind. Select a Hosting Platform After determining bandwidth, type of download and storage, you'll be armed with enough information to decide the type of video hosting platform to use. A few options exist for delivering or hosting your video files - CDN (content delivery network), cloud storage or hosted video platform. A CDN (content delivery network) is simply a network optimized for delivering content over the Internet - video files being one of the types of content. CDN's are often used in conjunction with a video transcoding server for delivering video. It's important to specify what a "true" or traditional CDN is: a network that's designed to deliver large amounts of rich media quickly over the Internet. Some well-known "true" CDN's are Edgecast, Akamai, Internap, Level 3 and Limelight. These premium CDN's specialize in delivering streaming media on high-traffic websites and are generally the most expensive. On the flipside, Cachefly is a lesser-known, less expensive CDN option. A CDN is a good choice for storing and delivering your video files if you have transcoding software to convert the files to Flash Video format (.flv). An alternative to the previously mentioned premium CDN's are cloud storage services. Example cloud storage services are Amazon S3, Rackspace Cloud and Nirvanix. These services offer storage space in a cloud environment and are not optimized for delivering rich media on high-traffice sites. Still, if you're not managing a lot of videos (numbering in the hundreds) and your site traffic isn't huge, cloud storage is an alternatively good, cheap solution for delivering video files. Popular cloud storage services offer an API that allow developers to program Drupal to "talk" to the cloud storage service when user's upload videos through a Drupal website. The CDN Integration module helps connect Drupal to a CDN (not to confuse matters more, but from what I gather, it's aimed to work with both cloud storage services and "true" CDN's). A hosted video platform is a little different than a CDN. Consider it a step up from a CDN. But with that step up, you'll be paying more than CDN hosting fees. A hosted platform has what a CDN doesn't: transcoding software (your videos will be automatically be converted to .flv format after you upload them), a robust video file management dashboard, ad network / server integration and ability to create video players and playlists. Often, hosted video platforms will utilize a third-party CDN for hosting the video files that are managed on the video platform. One thing to watch out for with hosted video platforms is making sure they support the video file types your users will be uploading. Most providers support .mov, .wav, .wmv, .avi, .mp4. If you're managing a lot of video, you'll want to familiarize yourself with the file management dashboard to make sure you're comfortable with its user interface and tools before jumping into a contract. Some well-known hosted video platforms include The Platform, BlipTV and Brightcove. A new player to the online video industry is Kaltura, an open-source video hosting platform. It's already on the Drupal radar with the release of the Kaltura module earlier this year. Also noteworthy is the line between hosted video platforms and CDN's becoming blurry. Some of the aforementioned CDN's such as Internap and Edgecast offer transcoding services similar to hosted video platforms. Embedded Video Versus Inline Video Outside of hosting, another topic to think about is how video will be displayed in Drupal. The video player that the user will view the video with can either be embedded in a Drupal content type's text field via the Embedded Media Field module or programmed into the page's .tpl file. An embedded player example would be YouTube's popular video player. YouTube allows users to copy embed code from a YouTube video's page, then paste it into your site. The other video display option is inline video. Inline video consists of placing the code for a video player in your .tpl file and programming it to read in a dynamic URL that points to a video file hosted outside the Drupal hosting server. When using inline video, it's possible to use a video player provided by a hosted video platform or an open-source player like the JW Player. For websites that aren't displaying and managing a lot of video, using the embedded video technique is the most economical. Uploading Video on a Drupal Site After determining how to store and serve videos for your site, you'll need to determine how videos will be uploaded to your site. Video hosting providers such as YouTube and Vimeo offer users the ability to upload their videos on their respective websites. However, Drupal can be configured to allow video upload. Videos uploaded to a Drupal site can either be stored on the Drupal hosting server or on a video hosting platform such as Brightcove. Most often it will be best to host videos through a hosted video platform or CDN, especially if users have the ability to upload video content. Uploading user generated videos to an external platform will keep your Drupal server admin from having to constantly check for remaining server space on the Drupal hosting server. Drupal's Video Upload contrib module allows users to post video to YouTube via a Drupal website. If you want users to post video to your website, but don't need the features of a video hosting platform, the CDN2 Video and Media Mover modules transcode and store uploaded video files to a CDN. Custom Drupal modules will most likely need to be developed to work with other well-known video platforms - the requirement being those modules need the ability to work with a video platform's API. For Drupal module developers that are reading this, the idea is to get the video that a user uploads to Drupal's hosting server moved over to the video hosting platform by way of a RESTful request. CURL or drupal_http_request() are a couple of methods for doing this in a module. To summarize, when integrating video into Drupal, there are many components that have to be considered. Storage, delivery method, type of hosting, player integration and upload method. It's easy to get lost in the big world of on-line video. Taking notes during the scoping and selection process of your site's video solution will keep you from becoming overwhelmed and help make Drupal video integration as smooth as possible.

Paul Chason

Meet team member, Paul Chason

Paul Chason is the Managing Partner at Mediacurrent, managing the company’s operations and playing roles in sales, infrastructure, technology and marketing. Paul is a rarity in the web industry. With...

Learn more about Paul >
Access icon Up arrow icon Drupal 8 icon Facebook icon - white Facebook icon - blue outline Facebook icon - yellow Hollow right arrow icon Hollow right arrow icon - white LinkedIn icon - white LinkedIn icon - hollow LinkedIn icon - blue outline LinkedIn icon - yellow Mediacurrent wordmark Quote icon Twitter icon - white Twitter icon - hollow Twitter icon - blue outline Twitter icon - yellow Youtube icon - white Youtube icon - yellow