ez-pro/s1/include/blocks/video/_detail_video_block.php.back1.1.15
2025-11-13 19:04:05 +03:00

56 lines
2.7 KiB
Plaintext

<?if(!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true ) die();?>
<?//options from \Aspro\Functions\CAsproAllcorp3::showBlockHtml?>
<?
$arOptions = (array)$arConfig['PARAMS'];
if (!isset($arOptions['VIDEO']) || !$arOptions['VIDEO']) return;
$bOneVideo = count((array)$arOptions['VIDEO']) == 1;
?>
<div class="hidden_print">
<div class="video_block">
<div class="grid-list grid-list--gap-20 grid-list--items-<?=$bOneVideo ? '1' : '2';?>">
<?foreach ($arOptions['VIDEO'] as $v => $value):?>
<div class="grid-list__item item rounded-4">
<?if (is_array($value)):?>
<?$videoMimeType = mime_content_type($_SERVER['DOCUMENT_ROOT'].$value['path']);?>
<div class="video_body video_from_file">
<video id="js-video_<?=$v;?>"
width="<?=$bOneVideo ? $value['width'] : '540';?>"
height="<?=$bOneVideo ? $value['height'] : '357';?>"
class="video-js"
controls="controls"
preload="metadata"
data-setup="{}"
>
<source src="<?=$value['path'];?>" type="<?=$videoMimeType;?>" />
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
</p>
</video>
</div>
<div class="title"><?=strlen($value["title"]) ? $value["title"] : '';?></div>
<?elseif (strpos($value, 'iframe')):?>
<?if ($bOneVideo):?>
<?=$value?>
<?else:?>
<div class="video_body">
<?=str_replace(
'src=',
'width="660" height="457" src=',
str_replace(
['width', 'height'],
['data-width', 'data-height'],
$value
)
);?>
</div>
<?endif;?>
<?else:?>
<?=$value;?>
<?endif;?>
</div>
<?endforeach;?>
</div>
</div>
</div>