Modul: Quicktime Player

Gesperrt
Nebel
Beiträge: 117
Registriert: Do 14. Jun 2007, 10:08
Kontaktdaten:

Modul: Quicktime Player

Beitrag von Nebel » Mo 4. Mai 2009, 18:06

Hallo!

der Vollständigkeit halber hier ein einfaches Modul für alle die Videos in Ihre Webseite einbauen wollen die im Quicktime Format vorliegen.

Quicktime Player für Contenido 4.8.x und 4.6.24

Die Ausgabe erfolgt XHTML 1.0 Stict Valide :)

Demo und Modul gibts mit XML und Readme hier zum Download.
http://www.nebelweb.de/de/contenido-module/



Modulbeschreibung:

Code: Alles auswählen

Modul zum Abspielen von Quicktime Videos mit Dateiendung *.mov oder *.hdmov. Ausgabe XHTML 1.0 Strict valid.

Autor: Sebastian Nebel (www.nebelweb.de)
Version: 1.0
Erstellt:  04.05.2009
Letzte Änderung: 04.05.2009
Modul Input:

Code: Alles auswählen

?><?php
$cms_dirname = "CMS_VALUE[1]";
$cms_filename = "CMS_VALUE[2]";
$cms_mov_width = "CMS_VALUE[3]";
$cms_mov_height = "CMS_VALUE[4]";

if ($cms_dirname == '' || $cms_dirname == '0') {
    $cms_dirname = 'videos/';
}

#Get paths
$sql = "SELECT
    htmlpath, frontendpath
    FROM
    ".$cfg["tab"]["clients"]." 
    WHERE
    idclient = ".$client." ";

$db->query($sql);

if ($db->next_record()) {
    $htmlpath = $db->f('htmlpath');
    $frontendpath = $db->f('frontendpath');
}

#Choose Video folder
echo '<table cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td class="text_medium" style="padding:5px">'.mi18n("Videoverzeichnis w&auml;hlen").': </td>
        <td class="text_medium" style="padding:5px">';
echo '<select name="CMS_VAR[1]" style="width:200px">';

#Get upload directories
$sql = "SELECT DISTINCT
    dirname
    FROM
    ".$cfg["tab"]["upl"]."
    WHERE
    idclient='$client' AND
    filetype IN ('mov','hdmov')
    ORDER BY
    dirname";

$db->query($sql);

$selected = false;
while ($db->next_record()) {
    $dirname = $db->f('dirname');
    if ($cms_dirname != $dirname) {
        echo '<option value="'.$dirname.'">&nbsp;'.$dirname.'</option>';
    } else {
        $selected = true;
        echo '<option value="'.$dirname.'" selected="selected">&nbsp;'.$dirname.'</option>';
    }
}

if (!$selected) {
    echo '<option value="0" selected="selected">'.i18n("Bitte w&auml;hlen").'</option>';
} else {
    echo '<option value="0">'.i18n("Bitte w&auml;hlen").'</option>';
}


echo '</select>&nbsp;<input type="image" src="images/submit.gif"></td></tr>';

#Choose Video file
echo '<tr><td class="text_medium" style="padding:5px">'.mi18n("Video w&auml;hlen").': </td>
    <td class="text_medium" style="padding:5px">';
echo '<select name="CMS_VAR[2]" style="width:200px">';
echo '<option value="0" selected="selected">'.i18n("Bitte w&auml;hlen").'</option>';

if ($cms_dirname != '0') {
    #Get uploaded files
    $sql = "SELECT 
            filename
            FROM
            ".$cfg["tab"]["upl"]."
            WHERE
            idclient = '$client' AND
            filetype IN ('mov','hdmov') AND
            dirname = '$cms_dirname' 
            ORDER BY
            filename";

    $db->query($sql);

    while ($db->next_record()) {
        $img_name = $db->f('filename');
        if ($cms_filename != $img_name) {
            echo '<option value="'.$img_name.'">&nbsp;'.$img_name.'</option>';
        } else {
            echo '<option selected="selected" value="'.$img_name.'">&nbsp;'.$img_name.'</option>';
        }
    }
}

echo '</select>&nbsp;<input type="image" src="images/submit.gif"></td></tr>';

if ($cms_dirname != '0') {
    echo '<tr>
            <td class="text_medium" style="padding:5px">'.mi18n("Breite").'</td>
            <td class="text_medium" style="padding:5px"><input type="text" name="CMS_VAR[3]" value="'.$cms_mov_width.'"></td>
        </tr><tr>
            <td class="text_medium" style="padding:5px">'.mi18n("H&ouml;he").'</td>
            <td class="text_medium" style="padding:5px"><input type="text" name="CMS_VAR[4]" value="'.$cms_mov_height.'"></td>
        </tr>';
}


?>

<!-- Autostart -->
     <tr>
     <td style="padding:5px">
        <acronym title="<?php echo "Video startet sofort nach dem Laden der Seite";?>"><?php echo "Autostart";?></acronym>
     </td>
     <td>
        <?php
        $c1 = '';
        $c2 = '';
        switch (strtolower("CMS_VALUE[13]")) {
             case "true" :
            $c1 = ' checked';
            break;
             case "false" :
            $c2 = ' checked';
            break;
             default :
            $c2 = ' checked';
        }
        ?>
    <input type="radio" name="CMS_VAR[13]" value="false"<?php echo $c2;?>>&nbsp;<?php echo mi18n("nein");?>
            <input type="radio" name="CMS_VAR[13]" value="true"<?php echo $c1;?>>&nbsp;<?php echo mi18n("ja");?>
     </td>
     </tr>
     
<!-- Kontrollleiste -->
     <tr>
     <td style="padding:5px">
        <acronym title="<?php echo "Soll die Leiste mit den Abspieltasten platziert werden?";?>"><?php echo "Kontrollleiste";?></acronym>
     </td>
     <td>
        <?php
        $c1 = '';
        $c2 = '';
        switch (strtolower("CMS_VALUE[14]")) {
             case "true" :
            $c1 = ' checked';
            break;
             case "false" :
            $c2 = ' checked';
            break;
             default :
            $c2 = ' checked';
        }
        ?>
    <input type="radio" name="CMS_VAR[14]" value="false"<?php echo $c2;?>>&nbsp;<?php echo mi18n("nein");?>
            <input type="radio" name="CMS_VAR[14]" value="true"<?php echo $c1;?>>&nbsp;<?php echo mi18n("ja");?>
     </td>
     </tr>
     </table>
<br>
<?php
Modul Output:

Code: Alles auswählen

<?php
$cms_dirname = "CMS_VALUE[1]";
$cms_filename = "CMS_VALUE[2]";
$weight = "CMS_VALUE[3]";
$height = "CMS_VALUE[4]";

if ($cms_filename != '0') {
    $video = "upload/".$cms_dirname.$cms_filename;
    $output = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'.$weight.'" height="'.$height.'">
    <param name="src" value="'.$video.'" />
    <param name="autoplay" value="CMS_VALUE[13]" />
    <param name="controller" value="CMS_VALUE[14]" />
    <!--[if !IE]>-->
     <object type="video/quicktime" data="'.$video.'" width="'.$weight.'" height="'.$height.'">
           <param name="autoplay" value="CMS_VALUE[13]" />
           <param name="controller" value="CMS_VALUE[14]" />
          </object>
    <!--<![endif]-->
    </object>';

#Output Video tag
    echo '<div class="movVideo">'.$output.'</div>';
}
?> 

Einfach das Modul importieren, in der Konfiguration das Video auswählen und die Videogröße eintragen - fertig. Wenn gewünscht noch die Variablen ändern.


Troubleshooting
Es wird kein Video abgespielt
Es kann vorkommen, dass trotz aller Einstellungen kein Video abgespielt wird. Evtl. liegt es an Mod_Rewrite, am Provider oder an der player.swf. Mit folgenden Änderungen sollte es funktionieren:

Das hier im Moduloutput suchen:

Code: Alles auswählen

if ($cms_filename != '0') {
      $video = "upload/".$cms_dirname.$cms_filename;
und durch das hier ersetzten, wobei domain.tld durch die eingene Homepageadresse ersetzt werden muss (und der Pfad zum Uploadordner, wenn dieser nicht standadmäßig unter cms liegt):

Code: Alles auswählen

if ($cms_filename != '0') {
      $video = "http://www.domain.tld/cms/upload/".$cms_dirname.$cms_filename;

Viel Spass. Positive und negative Kritik (am liebsten konstruktiv) sind gerne gesehen.

Weitere Variablen folgen bei Bedarf oder Nachfrage.

Schöne Grüße
Schöne Grüße
Nebel

Module: FLV Media Player | DivX Webplayer | Quicktime Player

Gesperrt