Mit dem bekannten FLV-Player-Modul gab es unerwartete Probleme unter 0.1.3.
Also habe ich kurzerhand einen eigenen, alternativen Workaround entwickelt.
Was man braucht?
1. Die SWFObject-Library
-> Download: http://blog.deconcept.com/swfobject/
2. Einen sog. FLV-Wrapper, in diesem Fall: JW FLV PLAYER
-> Download: http://www.jeroenwijering.com/?item=Flash_video_Player
3. eine CMSMS-function / Tag
dazu später mehr ...
Wie machen?
1. Das SWF-Objects-Script in die Seite einbinden: am besten im template
Code: Select all
<__script__ src="pfad_zu/swfobject.js" type="text/javascript"></__script>
3. die CMSMS-function 'flv_player' (Details gleich) ins Verzeichnis "pfad_zum_cms/plugin" kopieren
4. im Content folgenden Tag einfügen:
Code: Select all
{flv_player file='name_der_datei.flv' titel='Titel des Filmes'}
Im Texteditor deiner Wahl folgendes einfügen:
Code: Select all
<?php
#CMS - CMS Made Simple
#(c)2004 by Ted Kulp (wishy@users.sf.net)
#This project's homepage is: http://cmsmadesimple.sf.net
#
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
function smarty_cms_function_flv_player($params, &$smarty)
{
global $gCms;
$text = '';
$source_start = '<p style="text-align: center;" id="flvplayer">Sie brauchen den <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a>, um diesen Film zu sehen.</p>
<__script__ type="text/javascript">
var so = new SWFObject(\'uploads/Flash/flvplayer.swf\',\'player\',\'400\',\'400\',\'7\');
so.addParam("allowfullscreen","true");
so.addVariable("displayheight","300");';
$source_end = 'so.write(\'flvplayer\');
</__script>';
if( !empty($params['file'] ) )
{
$text = $source_start .= 'so.addVariable("file","'.$params['file'].'");';
if( !empty($params['titel'] ) )
{
$text .= 'so.addVariable("title","'.$params['titel'].'");';
} else {
$text .= 'so.addVariable("title","FLV-Player");';
}
$text .= $source_end;
} else {
$text = '<!-- kein flv-video zum anzeigen! -->';
}
return $text;
}
function smarty_cms_help_function_flv_player()
{
?>
<h3>Was macht dieses plugin?</h3>
<p>Es ruft den FLV-Videoplayer auf und bindet die gewünschte FLV-Datei ein</p>
<h3>Wie setzt man es ein</h3>
<p>Einfach dieses plugin ins template/in die Seite einsetzen: <code>{flv_player file='video.flv'}</code></p>
<h3>Welche Parameter gibt es?</h3>
<ul>
<li><em>(verpflichtend)</em> <tt>file</tt> - Dateiname des Filmes; muss im gleichen Verzeichnis liegen wie der FLV-Player -> z.B. uploads/Flash.</li>
<li><em>(optional)</em> <tt>titel</tt> - Titel des Filmes. Standard ist 'FLV-Player'</li>
</ul>
<?php
}
function smarty_cms_about_function_flv_player()
{
?>
<p>Author: hoppengarten•com</p>
<p>Version 1.0</p>
<?php
}
?>
Die Funktionalität dieses Tags reicht meinem Kunden vollendst aus.
Bei Bedarf kann man die Funktionen leicht erweitern:
die Variable $text speichert den Sourcecode, der an den Player übergeben wird. Es ist leicht, zusätzlich benötigte Variablen per
Code: Select all
$text .= 'so.addVariable("variablen_name","'.$params['parameter'].'");';
Details zu den so.variablen gibt es übrigens hier -> http://www.jeroenwijering.com/extras/readme.html
Hinweise:
Der Abschnitt
Code: Select all
<__script__ type="text/javascript">
var so = new SWFObject(\'uploads/Flash/flvplayer.swf\',\'player\',\'400\',\'400\',\'7\');
so.addParam("allowfullscreen","true");
so.addVariable("displayheight","300");';
$source_end = ' so.write(\'flvplayer\');
</__script>';
a) der FLV-Player liegt im Verzeichnis 'uploads/Flash'
b) die Standardgröße des Films beträgt 400x300 px.
Ich hoffe, ich konnte hiermit irgendwem helfen ...