Skip to content

Commit

Permalink
[TASK] Add wmode param to YoutubeViewHelper
Browse files Browse the repository at this point in the history
In IE10, IE11 the youtube player ignores its z-index.
You need to set this parameter to make the player behave like it’s
expected.

See
http://stackoverflow.com/questions/4050999/youtube-iframe-wmode-issue
for further details.
  • Loading branch information
htuscher committed Feb 25, 2015
1 parent a00467e commit 49aa3f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Classes/ViewHelpers/Media/YoutubeViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function initializeArguments() {
$this->registerArgument('end', 'integer', 'Stop playing after seconds.', FALSE);
$this->registerArgument('lightTheme', 'boolean', 'Use the YouTube player\'s light theme.', FALSE, FALSE);
$this->registerArgument('videoQuality', 'string', 'Set the YouTube player\'s video quality (hd1080,hd720,highres,large,medium,small).', FALSE);
$this->registerArgument('wmode', 'string', 'Set the Window-Mode of the YouTube player (transparent,opaque). This is necessary for z-index handling in IE10/11.', FALSE);
}

/**
Expand Down Expand Up @@ -153,6 +154,9 @@ private function getSourceUrl($videoId) {
if (FALSE === empty($this->arguments['videoQuality'])) {
$params[] = 'vq=' . $this->arguments['videoQuality'];
}
if (FALSE === empty($this->arguments['wmode'])) {
$params[] = 'wmode=' . $this->arguments['wmode'];
}

if (FALSE === $this->arguments['legacyCode']) {
$src .= '/embed/'. $videoId;
Expand Down

0 comments on commit 49aa3f0

Please sign in to comment.