File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
55The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ ) and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
66
7+ ## 1.1.10 - 2021-06-03
8+
9+ ### Fixed
10+
11+ - Fix vimeo thumbnails
12+
713## 1.1.9 - 2021-04-17
814
915### Fixed
Original file line number Diff line number Diff line change 22 "name" : " mikestecker/craft-videoembedder" ,
33 "description" : " Craft plugin to generate an embed URL from a YouTube or Vimeo URL." ,
44 "type" : " craft-plugin" ,
5- "version" : " 1.1.9 " ,
5+ "version" : " 1.1.10 " ,
66 "keywords" : [
77 " craft" ,
88 " cms" ,
Original file line number Diff line number Diff line change @@ -43,7 +43,12 @@ public function getInfo($url)
4343 try {
4444 $ embed = new Embed ();
4545 $ info = $ embed ->get ($ url );
46- $ response = $ info ->getOEmbed ();
46+
47+ if ($ this ->isVimeo ($ url )) {
48+ $ response = $ info ;
49+ } else {
50+ $ response = $ info ->getOEmbed ();
51+ }
4752 }
4853 catch (Exception $ e )
4954 {
@@ -325,12 +330,18 @@ public function getVideoId($url)
325330 *
326331 **/
327332 public function getVideoThumbnail ($ url ) {
333+ //return $this->getInfo($url)->getOEmbed()->all();
328334 // check for vimeo, I don't like the way Embed returns the Vimeo thumbnail
329- if ($ this ->getInfo ( $ url )-> get ( ' type ' ) && $ this -> isVimeo ($ url ))
335+ if ($ this ->isVimeo ($ url ))
330336 {
331337 $ id = $ this ->getVimeoId ($ url );
332338
333- $ data = file_get_contents ("http://vimeo.com/api/v2/video/ $ id.json " );
339+ $ data = @file_get_contents ("https://vimeo.com/api/v2/video/ $ id.json " );
340+
341+ if ($ data === FALSE ) {
342+ return '' ;
343+ }
344+
334345 $ data = json_decode ($ data );
335346
336347 $ image = $ this ->cleanUrl ($ data [0 ]->thumbnail_large );
You can’t perform that action at this time.
0 commit comments