Skip to content

Commit dc44f69

Browse files
committed
fixed google drive embed
1 parent ef90753 commit dc44f69

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

src/Adapters/Google.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getCode()
3030
$url = $this->request->createUrl();
3131

3232
if ($this->request->getHost() === 'drive.google.com') {
33-
return Utils::iframe($url->withDirectoryPosition(3, 'preview'));
33+
return Utils::iframe($url->withDirectoryPosition(3, 'preview')->withQueryParameters([]));
3434
}
3535

3636
return Utils::iframe($url->withQueryParameter('output', 'embed')->withQueryParameter('s', ''));

src/Url.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ protected function buildUrl()
403403

404404
$url .= $this->getPath();
405405

406-
if (isset($this->info['query'])) {
406+
if (!empty($this->info['query'])) {
407407
$url .= '?'.http_build_query($this->info['query']);
408408
}
409409
if (isset($this->info['fragment'])) {

tests/GoogleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function testDrive()
1717

1818
$this->assertEquals($info->title, 'Entrevista_Rianxo_RadioFusion_150724.mp3');
1919
$this->assertEquals($info->type, 'rich');
20-
$this->assertEquals($info->code, '<iframe src="https://drive.google.com/file/d/0B2rwN8wAbVSWbmFJdUdnV2VSTTg/preview?pli=1&amp;usp=embed_facebook" frameborder="0" allowTransparency="true" style="border:none;overflow:hidden;width:600px;height:400px;"></iframe>');
20+
$this->assertEquals($info->code, '<iframe src="https://drive.google.com/file/d/0B2rwN8wAbVSWbmFJdUdnV2VSTTg/preview" frameborder="0" allowTransparency="true" style="border:none;overflow:hidden;width:600px;height:400px;"></iframe>');
2121
$this->assertEquals($info->providerName, 'Google Docs');
2222
}
2323
}

tests/YoutubeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ public function testOne()
66
$info = Embed\Embed::create('http://www.youtube.com/watch?v=eiHXASgRTcA');
77

88
$this->assertEquals($info->title, 'Noisy kittens waiting for dinner!');
9-
$this->assertEquals($info->description, '7 week old fostered kittens waiting on their dinner being prepared. They had been ill with cat flu and were just starting to get their appetite back. Because...');
109
$this->assertEquals($info->imageWidth, 480);
1110
$this->assertEquals($info->imageHeight, 360);
1211
$this->assertEquals($info->type, 'video');

0 commit comments

Comments
 (0)