Skip to content

Commit dfb9264

Browse files
author
Josh Angell
committed
Merge branch 'release/1.3.2'
* release/1.3.2: 1.3.2 For youtube, modify the url in the iframe to add &wmode=transparent
2 parents 2db611e + 38a67a6 commit dfb9264

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

fetch/FetchPlugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function getName()
2020

2121
public function getVersion()
2222
{
23-
return '1.3.1';
23+
return '1.3.2';
2424
}
2525

2626
public function getSchemaVersion()

fetch/services/FetchService.php

+7
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,19 @@ public function get($url, $scripts = true)
230230
// Youtube mods
231231
if ( $provider === 'youtube' )
232232
{
233+
// Add youtube ID
233234
preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?#&\"'>]+)/", $url, $matches);
234235

235236
if (isset($matches[1])) {
236237
$decodedJSON['youtube_id'] = $matches[1];
237238
}
238239

240+
// Modify the url in the iframe to add &wmode=transparent
241+
if (isset($html))
242+
{
243+
$html = preg_replace('/src\=\\"(.*?)\\"(.*?)/i', 'src="$1$2&wmode=transparent"$3', $html);
244+
$decodedJSON['html'] = $html;
245+
}
239246
}
240247

241248
// check we haven't any errors or 404 etc

0 commit comments

Comments
 (0)