File tree Expand file tree Collapse file tree 1 file changed +29
-22
lines changed Expand file tree Collapse file tree 1 file changed +29
-22
lines changed Original file line number Diff line number Diff line change @@ -20,33 +20,32 @@ Usage:
20
20
include('Embed/autoloader.php');
21
21
22
22
//Load any url:
23
- $Url = new Embed\Url('https://www.youtube.com/watch?v=PP1xn5wHtxE');
24
- $Info = Embed\Embed::create($Url);
23
+ $info = Embed\Embed::create('https://www.youtube.com/watch?v=PP1xn5wHtxE');
25
24
26
25
//Get content info
27
26
28
- $Info ->title;
29
- $Info ->description;
30
- $Info ->url;
31
- $Info ->type;
27
+ $info ->title;
28
+ $info ->description;
29
+ $info ->url;
30
+ $info ->type;
32
31
33
- $Info ->images;
34
- $Info ->image;
35
- $Info ->imageWidth;
36
- $Info ->imageHeight;
32
+ $info ->images;
33
+ $info ->image;
34
+ $info ->imageWidth;
35
+ $info ->imageHeight;
37
36
38
- $Info ->code;
39
- $Info ->width;
40
- $Info ->height;
41
- $Info ->aspectRatio;
37
+ $info ->code;
38
+ $info ->width;
39
+ $info ->height;
40
+ $info ->aspectRatio;
42
41
43
- $Info ->authorName;
44
- $Info ->authorUrl;
42
+ $info ->authorName;
43
+ $info ->authorUrl;
45
44
46
- $Info ->providerIcons;
47
- $Info ->providerIcon;
48
- $Info ->providerName;
49
- $Info ->providerUrl;
45
+ $info ->providerIcons;
46
+ $info ->providerIcon;
47
+ $info ->providerName;
48
+ $info ->providerUrl;
50
49
```
51
50
52
51
Available options
@@ -65,9 +64,17 @@ $options = array(
65
64
'getBiggerImage' => true
66
65
);
67
66
68
- $Url = new Embed\Url('https://www.youtube.com/watch?v=PP1xn5wHtxE');
67
+ $info = Embed\Embed::create('https://www.youtube.com/watch?v=PP1xn5wHtxE', $options);
68
+ ```
69
+
70
+ Customize the request
71
+ ---------------------
69
72
70
- $Info = Embed\Embed::create($Url, $options);
73
+ Embed provides a RequestResolvers\Curl class to resolve all requests using the curl library. You can create your own request resolver class creating a class implementing the RequestResolverInterface.
74
+
75
+ ``` php
76
+ //Configure the request resolver class:
77
+ Embed\Request::setDefaultResolver('MyCustomResolverClass');
71
78
```
72
79
73
80
You can’t perform that action at this time.
0 commit comments