Community Documentation

Adding YouTube content via SWF Tools

Last updated July 9, 2010. Created by Stuart Greenfield on September 2, 2008.
Edited by ñull, bekasu. Log in to edit this page.

You can use the SWF Tools filter to add YouTube content to a page, but it isn't quite as straightforward as simply referencing the external file.

SWF Tools cannot determine the appropriate action to use for a file that is referenced from YouTube since the url has no extension. The action is instead explicitly set in the filter by passing the parameter action="swftools_swf_display_direct". Secondly, the height and width must be provided in order for the content to display properly.

So, to link to a YouTube file you need the url of the file (as shown in the embedding code for the YouTube page in question), and you need the height (generally 344) and width (generally 425) . You can then write a line like this:

[swf file="http://www.youtube.com/v/uikgwR8YwfQ&hl=en&fs=1" height="344" width="425" action="swftools_swf_display_direct"]

That will reference the appropriate file, give the height and width, and tell SWF Tools it should just render this as a regular swf file.

Creating a YouTube playlist

#585500: using swf() with multiple youtube urls

Comments

If not working...

with
[swf file="http://www.youtube.com/v/uikgwR8YwfQ&hl=en&fs=1" height="344" width="425" action="swftools_swf_display_direct"]

Test
[swf file="http://www.youtube.com/v/uikgwR8YwfQ?hl=en&fs=1" height="344" width="425" action="swftools_swf_display_direct"]

change & by ?

Page status

No known problems

Log in to edit this page

Site Building Guide

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.