Add the modestbranding parameter to the YoutubeRender.
Resolves: #85114
Releases: master, 8.7
Change-Id: Id76c0dd9ec764c820c2319c5dd57069e18c2cc71
Reviewed-on: https://review.typo3.org/57273
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
if (!empty($options['autoplay'])) {
$urlParams[] = 'autoplay=1';
}
+ if (!empty($options['modestbranding'])) {
+ $urlParams[] = 'modestbranding=1';
+ }
if (!empty($options['loop'])) {
$urlParams[] = 'loop=1&playlist=' . $videoId;
}
$this->subject->render($fileResourceMock, '300m', '200', ['controls' => 0, 'no-cookie' => 0])
);
}
+
+ /**
+ * @test
+ */
+ public function renderOutputWithModestbrandingIsCorrect()
+ {
+ /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock */
+ $fileResourceMock = $this->createMock(File::class);
+
+ $this->assertSame(
+ '<iframe src="https://www.youtube-nocookie.com/embed/7331?autohide=1&controls=2&modestbranding=1&enablejsapi=1&origin=http%3A%2F%2Ftest.server.org&showinfo=0" allowfullscreen width="300" height="200"></iframe>',
+ $this->subject->render($fileResourceMock, '300m', '200', ['controls' => 2, 'modestbranding' => 1])
+ );
+ }
}