Modify HTML5 video block
Permalink
Hi,
I'm new in concrete5 and I really appreciate this CMS and all the community behind it.
I'm trying to personalize the HTML5 Video block in order to better fit on my needs.
What I'm trying to do is to show in the block an image that will pop up a video in html5 when clicked.
The problem is that on the view.php file it seems not to create the right path for the image...
here's how I modified the HTML5 video block files:
I hope you could help me, attached you can find the whole block coding.
view.php
controller.php
add.php
I'm new in concrete5 and I really appreciate this CMS and all the community behind it.
I'm trying to personalize the HTML5 Video block in order to better fit on my needs.
What I'm trying to do is to show in the block an image that will pop up a video in html5 when clicked.
The problem is that on the view.php file it seems not to create the right path for the image...
here's how I modified the HTML5 video block files:
I hope you could help me, attached you can find the whole block coding.
view.php
<?php defined('C5_EXECUTE') or die("Access Denied."); $p = Page::getCurrentPage(); if ($p->isEditMode()) { ?> <div class="ccm-edit-mode-disabled-item" style="<?php if ($width>1){?>width: <?php echo $width;?>px;<?php } if($height>1){?> height:<?php echo $height;?>px;<?php }?>"> <div style="padding:8px 0px; padding-top: <?php echo round($height/2)-10; ?>px;"><?php echo t('Video disabled in edit mode.')?></div> </div> <?php }else{ $f = $controller->getFileObject(); $relPath = $f->getRelativePath(); $fOgv = $controller->getFileOgvObject(); $relPathOgv = $fOgv->getRelativePath(); $fImg = $controller->getFileImgObject(); $relPathImg = $fImg->getRelativePath(); ?>
Viewing 15 lines of 27 lines. View entire code block.
controller.php
<?php defined('C5_EXECUTE') or die("Access Denied."); $p = Page::getCurrentPage(); if ($p->isEditMode()) { ?> <div class="ccm-edit-mode-disabled-item" style="<?php if ($width>1){?>width: <?php echo $width;?>px;<?php } if($height>1){?> height:<?php echo $height;?>px;<?php }?>"> <div style="padding:8px 0px; padding-top: <?php echo round($height/2)-10; ?>px;"><?php echo t('Video disabled in edit mode.')?></div> </div> <?php }else{ $f = $controller->getFileObject(); $relPath = $f->getRelativePath(); $fOgv = $controller->getFileOgvObject(); $relPathOgv = $fOgv->getRelativePath(); $fImg = $controller->getFileImgObject(); $relPathImg = $fImg->getRelativePath(); ?>
Viewing 15 lines of 27 lines. View entire code block.
add.php
<?php defined('C5_EXECUTE') or die("Access Denied."); $al = Loader::helper('concrete/asset_library'); ?> <div class="ccm-block-field-group"> <h2><?php echo t('Video H.264 ')?></h2> <?php echo $al->file('cm-b-mp4', 'fID', t('Scegli video mp4'), $bf);?> <p><?php echo t('Scegliere un file con estensione .mp4');?></p> </div> <div class="ccm-block-field-group"> <h2><?php echo t('Video Ogg/Theora ')?></h2> <?php echo $al->file('ccm-b-ogv', 'fOgvID', t('Scegli video Ogv'), $bf1);?> <p><?php echo t('Scegliere un file con estensione .ogv');?></p> </div> <div class="ccm-block-field-group">
Viewing 15 lines of 31 lines. View entire code block.