Skip to content

Commit

Permalink
do not force autoplay
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg committed May 24, 2018
1 parent 695387a commit cdb5705
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/Elements/Vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ protected function compile()
$objSplash = new \stdClass();
$this->addImageToTemplate($objSplash, $this->arrData, null, null, $objFile);
$this->Template->splashImage = $objSplash;
$this->autoplay = true;
}
else
{
Expand Down
1 change: 0 additions & 1 deletion src/Elements/YouTube.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ protected function compile()
$objSplash = new \stdClass();
$this->addImageToTemplate($objSplash, $this->arrData, null, null, $objFile);
$this->Template->splashImage = $objSplash;
$this->autoplay = true;
} else {
$this->videoSplash = false;
}
Expand Down
11 changes: 5 additions & 6 deletions src/Resources/contao/dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,21 @@
'label' => &$GLOBALS['TL_LANG']['tl_content']['youtubeNoCookie'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50', 'tl_style'=>'height:auto;'),
'eval' => array('tl_class'=>'clr', 'tl_style'=>'height:auto;'),
'sql' => "char(1) NOT NULL default ''"
);

/**
* Palettes
*/
PaletteManipulator::create()
->addField('videoSplash', 'player_legend', PaletteManipulator::POSITION_APPEND)
->applyToPalette('youtube', 'tl_content')
->applyToPalette('vimeo', 'tl_content');

PaletteManipulator::create()
->addField('youtubeNoCookie', 'player_legend', PaletteManipulator::POSITION_APPEND)
->applyToPalette('youtube', 'tl_content');

PaletteManipulator::create()
->addField('videoSplash', 'player_legend', PaletteManipulator::POSITION_APPEND)
->applyToPalette('youtube', 'tl_content')
->applyToPalette('vimeo', 'tl_content');

$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'videoSplash';
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['videoSplash'] = 'singleSRC,size';
4 changes: 2 additions & 2 deletions src/Resources/contao/templates/ce_vimeo.html5
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
document.getElementById('videoSplash<?= $this->id ?>').addEventListener('click', function(e) {
var iframe = document.createElement('iframe');
iframe.src = this.dataset['video'];
iframe.width = <?= $this->width; ?>;
iframe.height = <?= $this->height; ?>;
iframe.width = <?= $this->width ?>;
iframe.height = <?= $this->height ?>;
iframe.allowfullscreen = '';
this.parentNode.replaceChild(iframe, this);
});
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/contao/templates/ce_youtube.html5
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
document.getElementById('videoSplash<?= $this->id ?>').addEventListener('click', function(e) {
var iframe = document.createElement('iframe');
iframe.src = this.dataset['video'];
iframe.width = <?= $this->width; ?>;
iframe.height = <?= $this->height; ?>;
iframe.width = <?= $this->width ?>;
iframe.height = <?= $this->height ?>;
iframe.allowfullscreen = '';
this.parentNode.replaceChild(iframe, this);
});
Expand Down

0 comments on commit cdb5705

Please sign in to comment.