@@ -33,27 +33,12 @@ private static function video_get_youtube($url, $width = 640, $height = 360)
33
33
preg_match ('/[ \\? \\&]v=([^ \\? \\&]+)/ ' , $ url , $ matches );
34
34
$ video_id = $ matches [1 ];
35
35
36
- // Check if a valid url
37
- if (!Net::check_http_code ('http://gdata.youtube.com/feeds/api/videos/ ' .$ video_id ,200 ))
38
- {
39
- return (false );
40
- }
41
-
42
- // GET INFO
43
- $ xml = simplexml_load_file ('http://gdata.youtube.com/feeds/api/videos/ ' .$ video_id );
44
- $ media = $ xml ->children ('http://search.yahoo.com/mrss/ ' );
45
-
46
36
$ info = array ();
47
37
$ info ['id ' ] = $ video_id ;
48
- $ info ['title ' ] = ( string ) $ media -> group -> title ;
49
- $ info ['description ' ] = ( string ) $ media -> group -> description ;
38
+ $ info ['title ' ] = '' ;
39
+ $ info ['description ' ] = '' ;
50
40
51
- $ info ['thumb ' ][0 ] = (string )$ media ->group ->thumbnail [0 ]->attributes ()->url ;
52
- $ info ['thumb ' ][1 ] = (string )$ media ->group ->thumbnail [1 ]->attributes ()->url ;
53
- $ info ['thumb ' ][2 ] = (string )$ media ->group ->thumbnail [2 ]->attributes ()->url ;
54
- $ info ['thumb ' ][3 ] = (string )$ media ->group ->thumbnail [3 ]->attributes ()->url ;
55
-
56
- $ info ['embed ' ] = '<iframe class="youtube_embed" width=" ' .$ width .'" height=" ' .$ height .'" src="http://www.youtube.com/embed/ ' .$ video_id .'?rel=0" frameborder="0" allowfullscreen></iframe> ' ;
41
+ $ info ['embed ' ] = '<iframe class="youtube_embed" width=" ' .$ width .'" height=" ' .$ height .'" src="https://www.youtube.com/embed/ ' .$ video_id .'?rel=0" frameborder="0" allowfullscreen></iframe> ' ;
57
42
58
43
return ($ info );
59
44
}
@@ -63,13 +48,7 @@ private static function video_get_vimeo($url, $width = 640, $height = 360)
63
48
preg_match ('/vimeo\.com\/([0-9]{1,10})/ ' , $ url , $ matches );
64
49
$ video_id = $ matches [1 ];
65
50
66
- // Check if a valid url
67
- if (!Net::check_http_code ('http://vimeo.com/api/v2/video/ ' .$ video_id .'.php ' ,200 ))
68
- {
69
- return (false );
70
- }
71
-
72
- $ hash = unserialize (file_get_contents ('http://vimeo.com/api/v2/video/ ' .$ video_id .'.php ' ));
51
+ $ hash = unserialize (file_get_contents ('https://vimeo.com/api/v2/video/ ' .$ video_id .'.php ' ));
73
52
74
53
$ info = array ();
75
54
$ info ['id ' ] = $ video_id ;
@@ -79,7 +58,7 @@ private static function video_get_vimeo($url, $width = 640, $height = 360)
79
58
$ info ['thumb ' ][0 ] = $ hash [0 ]['thumbnail_medium ' ];
80
59
$ info ['thumb ' ][1 ] = $ hash [0 ]['thumbnail_small ' ];
81
60
82
- $ info ['embed ' ] = '<iframe class="vimeo_embed" width=" ' .$ width .'" height=" ' .$ height .'" src="http ://player.vimeo.com/video/ ' .$ video_id .'" frameborder="0" allowFullScreen></iframe> ' ;
61
+ $ info ['embed ' ] = '<iframe class="vimeo_embed" width=" ' .$ width .'" height=" ' .$ height .'" src="https ://player.vimeo.com/video/ ' .$ video_id .'" frameborder="0" allowFullScreen></iframe> ' ;
83
62
84
63
return ($ info );
85
64
}
0 commit comments