<?php
/*************************
Copyright (c) 2004-2021 TinyWebGallery
  written by Michael Dempfle
 
  This program is free software; you can redistribute it and/or modify 
  it under the terms of the TinyWebGallery license (based on 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. 
  See license.txt for details.
 
  TWG version: 2.5
 
$Date: 2009-06-17 22:57:10 +0200 (Mi, 17 Jun 2009) $
$Revision: 73 $
 **********************************************/

defined('_VALID_TWG') or die('Direct Access to this location is not allowed.');

$flashtext = '<div id="flashcontent"><div class="noflash">The flash could not be loaded. Install/activate/update the flash plugin to watch this video.<\/div><\/div>';

if ($responsive_detail_page && ($video_player == "HTML5" || $video_player=="IFRAME")) {
$res_style = ' style = "width:100%; max-width: ' . $video_size_x . 'px;"';
} else {
$res_style = '';
}

echo "<table " . $res_style . $jscenter . "  summary='' border='0' cellpadding='0' align='center'><tr><td>";
if ($show_videos) {
    if ($video_player == "IFRAME") {
       echo "<div id=videoIframe ";
       if ($responsive_detail_page) {
          echo 'class="videoIframe-res" ';
       }
       
       echo ">"; // vaFm47lsL2g
        $movie = $video_flash_site . twg_urlencode(removePrefix(removeExtension(urldecode($image), "")));
        if ($video_autostart) {
            $movie .= htmlentities($video_autostart_parameter, ENT_QUOTES, $charset);
        }
        echo '
            <iframe width="' . $video_size_x . '" height="' . $video_size_y . '" 
            src="' . $movie . '" style="border: none" allowfullscreen></iframe>
        ';
        //
        // Google
        //
    } else if ($video_player == "HTML5") {
        if ($video_autostart) {
            $auto_param = "&amp;autostart=true";
        } else {
            $auto_param = "";
        }
        $ratio = (floor ($video_size_y / $video_size_x * 10000)) / 100;
        if ($responsive_detail_page) {
          echo '<style>';
          echo '.video-container { position: relative; padding-bottom: '.$ratio.'%; padding-top: 0px; height: 0; overflow: hidden; } .video-container iframe, .video-container object, .video-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }'; 
          echo '</style>';
        }
        echo '<div id=videoHtml5 class="video-container">';
        if ($responsive_detail_page) {
          echo '<iframe src="'.$install_dir_view . 'i_frames/i_html5video.php?twg_album=' . $album_enc . $auto_param . "&amp;twg_show=" . $image_enc . '" frameborder=0 allowfullscreen transparency="true"></iframe>';
        } else {
          echo '<iframe width=' . $video_size_x . ' height=' . $video_size_y . ' src="'.$install_dir_view . 'i_frames/i_html5video.php?twg_album=' . $album_enc . $auto_param . "&amp;twg_show=" . $image_enc . '" frameborder=0 allowfullscreen transparency="true"></iframe>';
        } 
        echo '</div>';
  
    } else {
        echo "<span>";
        echo "Wrong entry '" . $video_player . "' in config - check \$video_player";
    }
    echo "</span>";
} else {
    echo $lang_video_disabled;
}
echo "</td></tr></table>";

if ($enable_download && $video_show_dl_link && ($video_player != "GOOGLE")) {
    echo "<center id='center-download-link'><div class='dllink'>" . $download1 . $lang_download . $download2 . "</div></center>";
}

?>