File tree Expand file tree Collapse file tree 3 files changed +52
-1
lines changed Expand file tree Collapse file tree 3 files changed +52
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Embed \Providers \OEmbed ;
4+
5+ use Embed \Url ;
6+
7+ class Facebook extends OEmbedImplementation
8+ {
9+ /**
10+ * {@inheritdoc}
11+ */
12+ public static function getEndPoint (Url $ url )
13+ {
14+ if ($ url ->match (['*/videos/* ' , '/video.php ' ])) {
15+ return 'https://www.facebook.com/plugins/video/oembed.json ' ;
16+ }
17+
18+ return 'https://www.facebook.com/plugins/post/oembed.json ' ;
19+ }
20+
21+ /**
22+ * {@inheritdoc}
23+ */
24+ public static function getPatterns ()
25+ {
26+ return [
27+ 'https://www.facebook.com/* ' ,
28+ ];
29+ }
30+
31+ /**
32+ * {@inheritdoc}
33+ */
34+ public static function embedInDomIsBroken ()
35+ {
36+ return true ;
37+ }
38+ }
Original file line number Diff line number Diff line change @@ -27,4 +27,17 @@ public function testCompanyPage()
2727 ]
2828 );
2929 }
30+
31+ public function testVideo ()
32+ {
33+ $ this ->assertEmbed (
34+ 'https://www.facebook.com/acolono/videos/10154107990797381/ ' ,
35+ [
36+ 'title ' => 'Acolono - Eindrücke vom gestrigen Drupal Austria Meetup... | Facebook ' ,
37+ 'width ' => 500 ,
38+ 'code ' => true ,
39+ 'type ' => 'video ' ,
40+ ]
41+ );
42+ }
3043}
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ private function assertOembedAutodiscover(Request $request)
9696
9797 $ class = 'Embed \\Providers \\OEmbed \\' .$ className ;
9898
99- if (class_exists ($ class )) {
99+ if (class_exists ($ class ) && ! $ class :: embedInDomIsBroken () ) {
100100 $ body = $ request ->getContent ();
101101
102102 $ this ->assertFalse (strpos ($ body , '/json+oembed ' ), 'Autodiscovered json OEmbed ' );
You can’t perform that action at this time.
0 commit comments