File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Embed \Adapters ;
4
+
5
+ use Embed \Http \Response ;
6
+
7
+ /**
8
+ * Adapter to provide information from Vimeo.
9
+ * Required when Vimeo returns a 403 status code.
10
+ */
11
+ class Vimeo extends Webpage
12
+ {
13
+ /**
14
+ * {@inheritdoc}
15
+ */
16
+ public static function check (Response $ response )
17
+ {
18
+ return $ response ->isValid ([200 , 403 ]) && $ response ->getUrl ()->match ([
19
+ 'vimeo.com/* ' ,
20
+ ]);
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Embed \Providers \OEmbed ;
4
+
5
+ class Vimeo extends EndPoint implements EndPointInterface
6
+ {
7
+ protected static $ pattern = ['vimeo.com/* ' ];
8
+ protected static $ endPoint = 'https://vimeo.com/api/oembed.json ' ;
9
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Embed \Tests ;
4
+
5
+ class VimeoTest extends AbstractTestCase
6
+ {
7
+ public function testOne ()
8
+ {
9
+ $ this ->assertEmbed (
10
+ 'https://vimeo.com/235352744 ' ,
11
+ [
12
+ 'title ' => 'Vimeo Live is here ' ,
13
+ 'providerName ' => 'Vimeo ' ,
14
+ 'width ' => 640 ,
15
+ 'height ' => 360 ,
16
+ 'code ' => '<iframe src="https://player.vimeo.com/video/235352744?app_id=122963" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen title="Vimeo Live is here"></iframe> ' ,
17
+ ]
18
+ );
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments