You have chosen wisely, my friend... Using Drupal CMS with the Dash Player is by far the most flexible and powerful combination that you will not find elsewhere. The only drawback to this approach is that the setup is a little bit more tedious than using the other approach, but trust me, the payoff is much worth it. Also keep in mind that TMT Digital offers an integration service. If you would like to use Drupal CMS for your Dash Player, and don't feel like reading all these tutorials, then by all means contact us at http://www.tmtdigital.com/contact and we will be more than happy to assist you.
If you are more than willing to learn first hand, then by all means... lets get started.
To begin this tutorial, it is assumed that you already have the Drupal CMS installed on your web server. If you need help with this crucial step, then I suggest reading the following tutorial. So, lets begin with the installation of the necessary modules needed for the Dash Player.
Also keep in mind that TMT Digital provides a Complete Integration Service. We would love to take care of whatever needs you have to get your project off the ground.
Please click on the topics below...
To use the Dash Player in the Drupal System, it is required that you install 3 different modules, the Services Module, AMFPHP, and the Dash Player Module. The Services module is a fantastic module that interfaces a remoting gateway for your Drupal CMS. Basically what this means is that it allows outside components to remotely call functions in your Drupal system to retrieve information. This is how the Dash Player communicates to your Drupal CMS. Using this method provides a number of benefits not available in other commercial players, which makes this player very unique. So, lets begin by following the following steps...
Old Services for Drupal 6: http://ftp.drupal.org/files/projects/services-6.x-0.11.tar.gz
Old Services for Drupal 5: http://ftp.drupal.org/files/projects/services-5.x-0.91.tar.gz
After you do this, you will then need to provide the api key with the parameters that you pass to the DMP like the following... Keep in mind that the following code is only used if you are using the older version of Services.
<?php
$params['width'] = 652;
$params['height'] = 432;
$params['playlist'] = 'videos';
$params['api'] = 1;
print dashplayer_get_player($params);
?>This next step is really depending on what your requirements are... For our example, I wish to show videos in my player, have voting capabilities within the player, as well as keep track of the view counter. For this example, we will use the following Drupal Modules to achieve this. Download and install the following modules...
Once you have these installed, you are ready to move onto the next steps...
To install the Dash Player for use in the Drupal System, you must first download the latest version at http://www.tmtdigital.com/project/dash_player. You can click on the download link at the bottom of the page.
Once you have the package downloaded, you should extract the file on your local hard drive. In this file you will see the following...
Basically the next step after you download and extract the file is to place the contents on your server within the root of your Drupal install (the root of the Drupal files is where the index.php file is...). To keep everything as simple as possible and for clarity sake, I will go ahead and say to create a "player" folder in your root directory of your Drupal install and place the contents of this package in there... So basically, your directory structure should look like the following.
Now that you have the files in the right place, the next step is to go into your Drupal Administrator under "Dash Player" and set the correct path for the Dash Player SWF file. For our example, we would provide http://{yoursite}/player/dashPlayer.swf, and of course, replace {yoursite} with the URL of your domain. This will then set up the Dash Player API to point correctly to your player.
Now that you have completed these steps, it is time to move onto the next part... Configuring the Services Module and Dash Player to show your content!
This next step is VERY important... In order to get the Dash Player to work with the Services Module, you must first configure the Services for an outside component to communicate... Please follow these steps to configure your services module correctly.
| Drupal root | Allowed Domain |
|---|---|
| http://www.mysite.com | www.mysite.com |
| http://mysite.com | mysite.com |
| http://www.mysite.com/subdir | www.mysite.com/subdir |
| http://mysite.com/subdir | mysite.com/subdir |
| http://localhost | localhost |
| http://localhost/subdir | localhost/subdir |
<flashvars>
<drupalversion>6</drupalversion>
</flashvars><params>
<license><!-- Enter your License here --></license>
<gateway>http://www.mysite.com/services/amfphp</gateway>
<apiKey>123456789012345678901234567890</apiKey>
<baseURL>http://www.mysite.com</baseURL>
<flashvars>
<drupalversion>6</drupalversion>
</flashvars>
</params>
After you have done this, your player is now configured for your site. This next step is only if you wish to have the view counter work on your site... You can skip it if you like...
Ok, you are ready to move onto the next step...
Our next step is to create a new node type that you would like to use to show in the Dash Player. Depending on what media module you are using to create your media nodes, you might not have to do this step, but it is here if you need it. For our example, we are going to create a "video" node type which will let us upload videos and show them in the player.
The first step is to go to Administer >> Content Types
After you are there, we will want to create a new content type, so click on the link that says Add content type.
This will take you to a new page where you can then tell Drupal about the new content type that you would like to create. Since we are wanting videos, you will simply type "Video" for the name and "video" for the Type. You can leave the Description blank if you really want to.
Also, make sure that you have the Attachments checkbox checked to allow attachements to the node type.
From there, just go down to the bottom and press Save Content Type.
Now that you have set up the node type that you would like to use, the next step is to associate the FlashVideo module with this node type. You do this by following these steps...
So you are now set up to upload videos. You can test this out by going to Create Content >> Video. You should see it ask for a "Video Upload". Go ahead and test it out by creating several different video nodes. After you have done this, you will then need to Run cron manually by going to the Administer >> Status Report and then clickin on Run cron manually.
After you are done with this, you are now ready to move onto the next step which is to set up the Views module.
Now that you have a new "video" content type and have uploaded your videos, the next step is to set up a View of your video content to act as the playlist. Lets begin by going to Administer >> Views.
This next step differs whether you are using Views 2 (for Drupal 6) or Views version 1 (for Drupal 5). I will separate how to do both of these in the sections below... please pick the implementation that fits your version.
Once you are in the Views administrator section, you will then want to create a new view by clicking on the link that says Add. After the new view page comes up, please follow the following links to add a new view for your videos...
Once you are in the Views administrator section, you will then want to create a new view by clicking on the link that says Add. After the new view page comes up, please follow the following links to add a new view for your videos...
You can now use the parameter "playlist=videos" whenever you are embedding the video in your page... For example, this should now work...
<?php
$params['width'] = 652;
$params['height'] = 432;
$params['playlist'] = 'videos';
print dashplayer_get_player($params);
?>Ok, now this is the fun part... seeing the result.
Click on Create Content >> Page.
Down in the body, you will then place the following code to show the Dash Player...
<?php
$params['width'] = 652;
$params['height'] = 432;
$params['playlist'] = 'videos';
print dashplayer_get_player($params);
?>This section is dedicated to all the advanced functionality of the Dash Player.
The Dash Player was written to be completely customized. One great feature that I added to this player is the ability to add your very own custom fields to the player using CCK. This allows you to add your own data to the player and show that information anytime that someone clicks on a teaser in the playlist. Below you will find the steps you need to add your very own fields to the Dash Media Player.
This step is fairly trivial. Let us suppose that we wish to not only show the title in the Dash Player, but would also like to have a description as well. To do this, let us first create a description field using CCK. Follow these steps to do this...
Our next task is to let the player load this data... we do this by simply creating a new text field in our skin file. To do this we will need to have Flash CS3 Professional
so that we can edit the skin provided in the download. Once you have Flash CS3, you are ready to start editing the Dash Media Player skin...
The first thing that you will need to do here is follow the tutorial at http://www.tmtdigital.com/node/140. Here it describes the steps to create your own skin. Once you have done that, you can do the following to add your custom CCK field to the player...
Because the Dash Player uses the Views Module to construct its playlist, so many options can be made to control how your playlist is views and filtered to your viewers. Lets suppose that you wish to have a sorting mechanism for your playlist by specifying a weight for each one of your nodes and wish the playlist to show them in that order... Fortunate for you, the Dash Player in conjunction with the Views and CCK modules, this can be done rather easily. So, below are the steps that you need to follow to allow your playlist to be sorted by your command.
This tutorial assumes that you already have a view set up to show your nodes... If you have not done this already then I highly suggest going to Setting up a playlist using the Views Module tutorial first. It is also assumed that you already have the Views Module, but there is one more module that you will need for this tutorial, and that is the amazing CCK (Content Construction Kit) Module. This module will allow us to create a special field in your media node type that we will use to sort your content. Once you have this module downloaded and installed, you are ready to move onto the next step.
The first step that we will want to do is create a weight field for your node type. You do this by going to Administer >> Content Types and then clicking on your media type that you would like to add the weight too. Once you are there, you will then follow the following steps.
$values = array();
for($i=-10; $i<11; $i++) {
$values[$i] = $i;
}
return $values;The next and final step is to add this weight field in the Sort Criteria for your view. You do this by going to the view that you set up as your playlist and clicking on the Edit tab. Once you are ar in the edit section of your view, you will want to go down to the bottom where it says Sort Criteria. In the drop-down box, you will then want to select Integer: Weight (field_weight) and then press Add Criteria. And now you are done! You can then go and test this out by editing some of your media nodes and setting the weight value. You should then see them sort in your playlist based on the weight you provided!
This tutorial will go over the steps to reproduce what I did in my Audio Showcase. Please note that this only applies for Drupal uses with the Dash Media Player.
The next step is to install all the modules used in this tutorial. Make sure you install the following...
Now that you have the content type set up, the next important step is to create a view that the player will use to show all the audio nodes. You do this by first going to Administer >> Views
The next step is to download the Audio Pro skin by going to http://www.tmtdigital.com/node/694. The skin is free to download and use. Once you have the skin downloaded, you will then need to extract the contents within the skins folder in your Dash Player folder. When you are done, you should then have the skin.swf file located at skins/audiopro/skin.swf
Now that you have your site configured to add audio nodes to your Drupal system, the next step is to install the player to show the audio playlist. You will do this by first going to Create Content >> Page and then in the body, you will paste the following PHP code....
<?php
$params['width'] = 520;
$params['height'] = 111;
$params['skin'] = 'audiopro';
$params['playlist'] = 'audio';
$params['autostart'] = 'true';
print dashplayer_get_player($params);
?>Now it is time for the fun part... to start adding the music!
This tutorial will walk you through how to set up the Remote Playlist Feature. The remote playlist feature uses JavaScript to serve as a communication gateway between two different SWF objects on the page at any given time. If you are using Drupal, you will need to upgrade to the latest version of the Dash Player module by going to http://www.drupal.org/project/dashplayer. Once you have upgraded, you will then notice that there is a new JavaScript file that is included with this module called dashPlayer.js. This is the file that is used as the communication gateway between any two SWF objects on the page. The good news is that is ALL you need to know. The second you use the Dash Player API to insert an object onto the page, the dashplayer module will add the dashPlayer.js file for you. All you have to do now is understand HOW to make the connections.
Surprisingly, implementing this remote playlist feature is very simple. You basically just need to give your Playlist an id, your Player an id, and then use the connect parameter to connect both of them together. This is done with two new parameters called id and connect. You also need to indicate to the Dash Media Player that you are using a Playlist or a Player. This is done with two more parameters, playlistonly if you just want it to show the playlist, and disableplaylist on the player to say you do not want to show the playlist (since the playlist is actally somewhere else on the page. Let me give an example to illustrate...
Let us suppose that you wish to have your player in the main section of the page, and then have your playlist in a Block to the side of this main player (exactly like how I did in my showcase at http://www.tmtdigital.com/remoteplaylist). So, let me walk you though step by step how to achieve this setup. Before I begin, though, I am assuming that you have an understanding on how to set up a view and link the Dash Media Player to that view in Drupal using the playlist argument. Let's get started.
<div style="text-align:center">
<?php
$params['id'] = 'dashvideo';
$params['connect'] = 'dashplaylist';
$params['width'] = 550;
$params['height'] = 420;
$params['disableplaylist'] = 'true';
print dashplayer_get_player($params);
?>
</div><div style="text-align:center;">
<?php
$params['id'] = 'dashplaylist';
$params['connect'] = 'dashvideo';
$params['width'] = 200;
$params['height'] = 520;
$params['playlist'] = 'videos';
$params['playlistonly'] = 'true';
print dashplayer_get_player($params);
?>
</div>Another great feature of the Dash Player is that it was built to read some specific CCK fields that basically act as a replacement for an actual media file being attached to that node. You can use this if you have the paths to your files, but don't necessarily want to attach that media to your node. You can do this by using the CCK (Content Construction Kit). There are two special fields that you need to create that will represent both a playable media and image... These fields are as follows...
| CCK Field ID | Type | Description |
|---|---|---|
| dashplayer_media | Text | Use this to pass a playable media file path to the Dash Player |
| dashplayer_image | Text | Use this to pass a preview image file path to the Dash Player. |
One HUGE benefit in using the Drupal CMS with the Dash Player is that you can completely control the playlist using the Views module. Basically the Views module allows you to filter your content. One way that the views module filters content is through the powerful use of Views Arguments. Basically what this means is that it allows you to pass in certain arguments to the views which it in turns uses as a filtering mechanism for your content.
Let me give you an example... Suppose you wish to have 1000 different videos on your site that can fall into several categories (comedy, action, thriller, etc). Using any other Media Player available, you would need to literally code your own personal filtering mechanism if you wished to show a playlist for only the comedy videos. Not to mention, you would need to show them ALL!! What if there are 1000 different comedy videos alone?! Any other media player would require you to then filter it some more, unless of course, you want to show 1000 different videos in your playlist possibly bringing your users computer to its knees.
Well, good thing you have the Dash Player... Not only can you provide this filtering mechanism using the Views module, but also the Dash Player uses a playlist paging mechanism that will only query for a pages worth of content at a time! Pretty slick, huh? So, lets get started setting up that view. I am assuming that you have already been through the process of Setting up a View for your player. We will also, for the sake of this example, assume you wish to categorize your videos as "Comedy", "Thriller", and "Action". This will at least give you the idea how to do this...
Ok, now that our view is set up, the last and final step is to provide the argument in your player to show the right playlist depending on the argument. You do this by using the arg flashvar followed by the argument number (1,2,3,etc). So, for example, if we wish to show a playlist that only shows the Comedy videos, since this is the first argument, we would just use the following PHP in our Page (make sure you change the Input Format to accept PHP)...
<?php
$params['width'] = 652;
$params['height'] = 432;
$params['playlist'] = 'videos';
$params['arg1'] = 'comedy';
print dashplayer_get_player($params);
?>When you press submit on the page, you will get a wonderful surprise!!! It is only showing the comedy vidoes!! Now if you want to really take it to the next level, I highly suggest checking out the tutorial on Creating Dynamic Playlists.
This is probably the most powerful feature of the Dash Player (besides the Remote Playlist Support, of course...). Having Dynamic Playlists basically means that your users can select how they wish to filter the playlist content by simply clicking on links in your player. And guess what... all this is built into the player! Before beginning this tutorial, it is imperative that you follow the steps on Using Views Arguments for your Playlists. This tutorial will pick up where that one left off... So lets begin.
Allowing for dynamic playlists is completely a player feature using the use of three different flashvars, linkarg, linktext, and linkindex. For an exact description of what these flashvars do, I highly recommend that you visiting the FlashVars Table. So, lets go ahead and add all of our Views arguments so that the user can dynamically select them... Using the example from Views Arguments tutorial, lets suppose that you wish to have three links on the playlist that allows the USER to select which videos they would like to see... you would use the following code.
<?php
$params['width'] = 652;
$params['height'] = 432;
$params['playlist'] = 'videos';
$params['linkarg1'] = 'comedy';
$params['linktext1'] = 'comedy';
$params['linkindex1'] = '0';
$params['linkarg2'] = 'action';
$params['linktext2'] = 'action';
$params['linkindex2'] = '0';
$params['linkarg3'] = 'thriller';
$params['linktext3'] = 'thriller';
$params['linkindex3'] = '0';
dashplayer_get_player($params);
?>Now that's cool!!!
This page will go through the complete checklist that you need to get the Dash Player to work. Of course, I will not go into detail what each of these topics means, but you can get that information by walking through the step-by-step tutorial on how to install this player in your system.
$params['api'] = 1;<!-- and --> from the opening and closing tags before putting the parameter in. If you put the parameter inside these special tags, it will not work.$params['playlist'] = {yourview}; where you would replace the {yourview} with the view that you set up to show your media.<?php
$params['width'] = 652;
$params['height'] = 432;
$params['playlist'] = 'videos';
print dashplayer_get_player($params);
?>