Umožňuje pomocí jednoduché PHP syntaxe nebo filtru vložit Flash animace (video, audio, obrázky) do libovolného typu obsahu a převést seznam souborů na playlist. Modul podporuje i CCK FileField.
)<?php
$files = array('images/01.jpg', 'images/02.jpg');
print swf($files);
?><?php
$sql = "SELECT files.filepath AS filepath
FROM node
LEFT JOIN image ON node.nid = image.nid
LEFT JOIN files ON image.fid = files.fid
WHERE ((node.status <> 0)) AND (image.image_size = 'thumbnail')
ORDER BY node.created DESC
LIMIT 10";
$result = db_query($sql);
while ($node = db_fetch_object($result)) {
$output[] = $node->filepath;
}
print swf($output);
?>[swf file="media/test.flv" image="images/media/test.jpg"]
<?php
print swf('media/video.flv',
array(
'params' => array('width' => '320', 'height' => '204'),
'othervars' => array('image' => 'images/media/preview.jpg', 'autoPlay' => 'true'),
)
);
?>$conf = array( // No trailing slashes! 'swftools_media_url' => 'http://example.com/media', );
<?php
$files = array('media/video1.flv', 'media/video2.flv', 'images/fotka.jpg');
print swf($files);
?><?php
print swf("playlist.xml");
?><rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>Example media RSS playlist for the JW Player</title>
<link>http://www.longtailvideo.com</link>
<item>
<title>Big Buck Bunny - FLV Video</title>
<link>http://www.bigbuckbunny.org/</link>
<description>Big Buck Bunny is a short animated film by...</description>
<media:credit role="author">the Peach Open Movie Project</media:credit>
<media:content url="http://www.longtailvideo.com/jw/upload/bunny.flv" type="video/x-flv" duration="33" />
</item>
<item>
<title>Big Buck Bunny - MP3 Audio with thumb</title>
<link>http://www.bigbuckbunny.org/</link>
<description>Big Buck Bunny is a short animated film by...</description>
<media:credit role="author">the Peach Open Movie Project</media:credit>
<media:content url="http://www.longtailvideo.com/jw/upload/bunny.mp3" type="audio/mpeg" duration="33" />
<media:thumbnail url="http://www.longtailvideo.com/jw/upload/bunny.jpg" />
</item>
<item>
<title>Big Buck Bunny - PNG Image with start</title>
<link>http://www.bigbuckbunny.org/</link>
<description>Big Buck Bunny is a short animated film by...</description>
<media:group>
<media:credit role="author">the Peach Open Movie Project</media:credit>
<media:content url="http://www.longtailvideo.com/jw/upload/bunny.png" type="image/png" duration="20" start="10" />
</media:group>
</item>
</channel>
</rss>Příklad minimálního html dokumentu s Flash verzí Flowplayeru (HTML5 verze nefunguje ve Firefoxu a IE) – další možnosti konfigurace:
<html>
<head>
<title>Wow! This is video</title>
<script src="path/to/flowplayer-3.2.12.min.js"></script>
</head>
<body>
<!-- this A tag is where your Flowplayer will be placed. it can be anywhere -->
<a href="path/to/video.flv" style="display: block; width: 917px; height: 524px" id="player"></a>
<script>
flowplayer("player", "path/to/flowplayer-3.2.16.swf", {
clip: {
autoPlay: true,
autoBuffering: true,
bufferLength: 15,
}
});
</script>
</body>
</html>Další moduly:
<object width="320" height="204"> <param name="movie" value="http://mediamover.24b6.net/sites/default/modules/flvmediaplayer/mediaplayer.swf"> </param> <embed src="http://mediamover.24b6.net/sites/default/modules/flvmediaplayer/mediaplayer.swf" type="application/x-shockwave-flash" flashvars="shuffle=false&enablejs=true&allowscriptaccess=always&logo=http://mediamover.24b6.net/drupal.png&overstretch=fit&repeat=list&file=http://mediamover.24b6.net/xspf/terms/flv/.xspf&recommendations=http://mediamover.24b6.net/recommended.xml"> </embed> </object>
Doplnit:
<embed src="mediaplayer.swf" width="320" height="204" allowfullscreen="true" flashvars="&displayheight=240&file=rtmp://my_flashhost/my_app/&height=204&width=320&id=my_flvfilename&type=rtmp" />
Při problémech s fullscreen zobrazením (verze 5.x-1.1) je možné do souboru swftools/swftools.module např. mezi parametry src a wmode doplnit parametr allowfullscreen:
.' src="'. $P['src'] .'"' .' allowfullscreen="true"' .' wmode="'. $P['wmode'] .'"'
streaming: