Adding our custom media player to Drupal

The first step we will need to take is to change our nodeid variable back to the FlashVars format so that we can compile our new media player for Drupal.

// Declare our variables var baseURL:String = "http://localhost/drupal6"; var gateway:String = baseURL + "/services/amfphp" var sessionId:String = "";

var nodeId:Number = root.loaderInfo.parameters.node;

After we run our media player with these changes (which compiles the SWF file), we can follow the steps from Chapter 4 and upload our new media player by navigating to Create Content | Flash. Once we have our Flash application submitted to Drupal, we can create a template for both the audio and video nodes using the Content Templates within the Drupal Administrator. Assuming that the node ID for our flash node application is 11, our body templates should look like the following for both the video and audio nodes:

// Get the Flash application.

$sql = "SELECT * FROM {node} WHERE nid=%d";

// Set the flashvars to the right node Id. $flash->flashnode["flashvars"] = 'node=' . $node->nid;

// Show the Flash application.

print theme('flashnode', $flash->flashnode, FALSE); ?>

Once we have our templates in place, we can navigate to any audio and video node within our Drupal website and see our new media player in action!

Home

Crazy at the wheel Edit

Article Marketing Gold

Article Marketing Gold

Discover How You Can Use The Huge Power of Article Marketing To Drive Highly Targeted Traffic To Your Website and Instantly Become THE Person Your Prospects Want To Buy From.

Get My Free Ebook


Post a comment