Last updated November 29, 2009. Created by fabricadeportales on June 17, 2009.
Edited by LeeHunter, add1sun. Log in to edit this page.
You can easily integrate Flash content on the pages. You can enable support for various media players.
Needed by: FlowPlayer, jquery.flash.js 1 Pixel Out, SimpleViewer, SWFObject, SWFObject2, UFO, Flash Wijering, JW Media Player 4.
Configuration to use the module swftools.
Steps to follow:
1 - Create the folder files inside the site and inside this folder
a folder named playlist.
2 – Place the module swftools (modified) inside the folder
modules of the site.
3 - Activated all the modules that have dependency on swftools.
4 - Then on Administer/SWF Tools/Embedding Settings and on "Files location", on the field "Directory in files where playlist " you put “files”, this is the folder where all the contents to be displayed by the module, either images,
videos and sounds are placed.
We need to create a folder for each content type, mp3 for audio, img for images and flv for videos. Image 1
5- On Administer/SWF Tools/File handling, we should mark plugins we want to work with, in this case we mark: All JW Media Player 4 - Jeroen Wijering, in the Default player for a list of images: You can also mark the Flash Image Rotator - Jeroen Wijering, as auxiliary option (recommended). Image 2 Image 3
6- After, on Generic players we selected the option we want. Autostart MP3 or Autostart FLV. Image 4
7- Administer/Site Configuration/ Entry Form we add the input format with the new filter option "SWF Tools Filter." Image 5
Tests:
To place a single mp3 file.
1 - Create a page.
2 - Assuming that there are mp3 files on files/mp3, we write on the page created
<swf file="mp3/nombre.mp3">and we mark the input format that was created earlier.
To place several queued mp3 files.
1 - Create a page.
2 – Assuming you have several mp3 files inside files/mp3, place the following code on the page created:
<swflist files="mp3/nombre1.mp3&&mp3/nombre2.mp3&&mp3/nombre3.mp3"> and mark the input format that was created earlier.
Image 6
Input format: Ver Image 7
3- When we test, we will see a logo of Drupal, to change it we go to site\modules\swftools\shared and copy the favorite photo with the name
swftools-default.jpg. Image 8
To place a flv video file.
1 - Create a page.
2 - Assuming you have a flv file in files/flv, we write on the page you created:
<swf file="flv/nombre.flv"> and mark the input format that was created earlier.
3- As with mp3 files you can place several videos as follows:
<swflist files="flv/nombre1. flv && flv /nombre2. flv && flv /nombre3. flv "> Sample video: Image 10
To place one or more images in the queue:
1. You create a page.
2. Assuming you have several .jpg files in files/img, place on the page created:
<swflist player="wijering_imagerotator" files="img/nombre1.jpg&&img/nombre2.jpg &&img/nombre3.jpg" width="400" height="300" transition="random">These values can be changed depending on what you want, and mark the input format that was created earlier.Image 11
Sample Image: Image 12
Comments
You actually do have to do a
You actually do have to do a bit more work to support multiple players and various resolutions (working within template.php and preprocess functions [drupal 6 only] or the phptemplate variables [drupal 5]. It's not baked into jQuery Media now, but it seems that Aaron will be putting support in for this.
SWF is great but there's one consideration to make when dealing with all this rich media stuff. It happens to be Apple's fault but if you wrap embed or object tags within your html then devices like the iPhone won't be able to play media like mp3 (podcast specific - flash doesn't work anyway).
But, for files like mp3, which can be played on the iPhone. When provided as a raw anchor tag, the iPhone can play the mp3 natively. Using jQuery Media, you can make this decision and not hard code the embed/object tags into your html.
Here's what I'm talking about.
swf game console or mp3 files
Swf Subject
Forum Comment
// Don't add the javascript player stuff for certain devices/browser (e.g iPhone)
if (!useragent_noplayer()) {
// Create the javascript - there's some overkill in here and it's not been optimized - should move to using the Metadata Plugin
$media_js = "if (Drupal.jsEnabled) {\n$(document).ready(function() {\n";
$media_js .= "$('#$media_class').media( { width: 290, height: 24, flashvars: {soundFile:'". $media['path_raw'] ."', bg:'0xA4B940', leftbg:'0x183C45', lefticon:'0xFFFFFF', righticon:'0xFFFFFF', rightbg:'0x86982F', text:'0xFFFFFF', slider:'0x183C45'} } );";
$media_js .= "\n});\n}";
drupal_add_js($media_js, 'inline', 'header');
}
The above snippet references this function in template.php
/**
* Helper function for not adding the player for certain browsers/devices.
*/
function useragent_noplayer() {
$agent = $_SERVER['HTTP_USER_AGENT'];
$browsers = array('iPhone');
foreach ($browsers as $browser) {
if (preg_match("/$browser/", $agent)) {
return TRUE;
}
}
return FALSE;
}
Just something to think about when you consider how many iPhones there are out there.