Submitted by CrashTest_ on Thu, 01/29/2009 - 22:56
In case anyone wants to know how to create a pre-roll video that plays before ALL local video content, here is how you might go about it. First, you will want to have the following modules:
- http://drupal.org/project/media_mover
- http://drupal.org/project/xspf_playlist
- http://drupal.org/project/flvmediaplayer
- http://drupal.org/project/trackit - Optional if you want to track your impressions
After you have that setup, and have gotten your video content type all straightened out, and you have the settings for all of these items correct, then you need to add a little something to your very own custom module to enable the pre-roll video to load before all of the videos. In it you might add the following code:
<?php
/**
* implements the hook_xspf_playlist_add to modify
* the output of xspf files. This is helpful for building
* playlists for flashplayers
*/
function custom_modulename_xspf_playlist_add($action, $node){
switch ($action){
case 'pre':
foreach ($node->media_mover as $file) {
$items[] = xspf_playlist_build_file_item($node, $base_url . '/files/pre-roll-video-filename.flv');
return $items;
}
break;
case 'post':
break;
}
}
?>I found this handy bit of code, and modified it slightly, in the README.txt for the XSPF Playlist module. Thanks for making it possible guys!

