mirror of
https://github.com/a2nt/silverstripe-elemental-basics.git
synced 2024-10-22 17:05:54 +02:00
IMPR: Add video files
This commit is contained in:
parent
2f7d358dbe
commit
c3c268488e
@ -9,15 +9,12 @@
|
||||
namespace A2nt\ElementalBasics\Extensions;
|
||||
|
||||
use A2nt\ElementalBasics\Elements\SliderElement;
|
||||
use DNADesign\Elemental\Models\BaseElement;
|
||||
use SilverStripe\CMS\Model\SiteTree;
|
||||
use SilverStripe\Assets\File;
|
||||
use SilverStripe\Forms\CheckboxField;
|
||||
use SilverStripe\Forms\DatetimeField;
|
||||
use SilverStripe\Forms\ToggleCompositeField;
|
||||
use SilverStripe\Forms\TreeDropdownField;
|
||||
use SilverStripe\ORM\DataExtension;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\LiteralField;
|
||||
use SilverStripe\ORM\ValidationResult;
|
||||
|
||||
/**
|
||||
@ -36,6 +33,10 @@ class SlideImageEx extends DataExtension
|
||||
'DateOff' => 'Datetime',
|
||||
];
|
||||
|
||||
private static $has_one = [
|
||||
'VideoFile' => File::class,
|
||||
];
|
||||
|
||||
private $_cache = [
|
||||
'element' => [],
|
||||
];
|
||||
|
@ -1,5 +1,10 @@
|
||||
<% if $Video || $Image %>
|
||||
<% if $Video %>
|
||||
<% if $VideoFile %>
|
||||
<video controls="controls">
|
||||
<source src="{$VideoFile.Link}" type="video/mp4" />
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
<% else_if $Video %>
|
||||
<div class="video">
|
||||
$Video.EmbedHTML.RAW
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user