Ceci est la documentation de la classe PHP Videopian, qui permet de récupérer les informations d'une vidéo hébergée sur un service de partage de vidéos à partir de son URL. Démo / Téléchargement
~ version mise à jour le 17.07.2009
| Blip | Dailymotion | Flickr | Google Video | Metacafe | MySpace | Veoh | Vimeo | YouTube | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Identifiant site | string | blip | dailymotion | flickr | googlevideo | metacafe | myspace | veoh | vimeo | youtube | |||
| URL | string | • | • | • | • | • | • | • | • | • | |||
| Titre | string | • | • | • | • | • | • | • | • | • | |||
| Description | string | • | • | • | × | • | × | • | • | • | |||
| Tags | array | • | • | • | × | • | × | • | • | • | |||
| Durée | int | • | • | ? | • | × | × | • | • | • | |||
| Pseudo auteur | string | • | • | • | × | • | – | • | • | • | |||
| URL profil auteur | string | • | • | • | × | • | – | • | • | • | |||
| Date publication | DateTime | • | • | • | • | • | • | • | • | • | |||
| Date mise à jour | DateTime | × | × | • | × | × | × | × | × | • | |||
| Vignettes | array | • | • | • | • | • | • | • | • | • | |||
| URL player flash | string | • | • | • | • | • | • | • | • | • | |||
| URL fichiers | array | flv, mov | flv | mp4 | avi, flv, mp4 | × | flv | flv | – | – | |||
| URL données XML | string | • | • | • | • | • | • | • | • | • | |||
| Légende • Disponible × Indisponible ? Indéterminé – Pas encore implémenté | |||||||||||||
Lorsqu'une donnée est indisponible, la propriété est NULL ou un tableau vide.
url, width et height, ordonnés par ordre croissant de taillemime-type => urlvideo/x-msvideovideo/x-flvvideo/quicktimevideo/mp4Pour
$Videopian = new Videopian();
$video = $Videopian->get('http://www.dailymotion.com/video/x2bein_vwater_ads');
ou
$video = Videopian::get('http://www.dailymotion.com/video/x2bein_vwater_ads');
$video contient :
object(stdClass)#1 (14) {
["url"]=>
string(50) "http://www.dailymotion.com/video/x2bein_vwater_ads"
["site"]=>
string(11) "dailymotion"
["xml_url"]=>
string(43) "http://www.dailymotion.com/rss/video/x2bein"
["title"]=>
string(7) "V_WATER"
["description"]=>
string(0) ""
["tags"]=>
array(10) {
[0]=>
string(6) "london"
[1]=>
string(9) "animation"
[2]=>
string(6) "vwater"
[3]=>
string(5) "water"
[4]=>
string(4) "kick"
[5]=>
string(4) "glow"
[6]=>
string(6) "shield"
[7]=>
string(9) "de-stress"
[8]=>
string(6) "stress"
[9]=>
string(7) "vitamin"
}
["duration"]=>
int(79)
["author"]=>
string(9) "tudoempaz"
["author_url"]=>
string(36) "http://www.dailymotion.com/tudoempaz"
["date_published"]=>
object(DateTime)#11 (0) {
}
["date_updated"]=>
NULL
["thumbnails"]=>
array(1) {
[0]=>
object(stdClass)#12 (3) {
["url"]=>
string(57) "http://www.dailymotion.com/thumbnail/320x240/video/x2bein"
["width"]=>
int(320)
["height"]=>
int(240)
}
}
["player_url"]=>
string(37) "http://www.dailymotion.com/swf/x2bein"
["files"]=>
array(1) {
["video/x-flv"]=>
string(101) "http://www.dailymotion.com/cdn/FLV-80x60/video/x2bein?key=d4dddf3023e601f760a90fe253ad761213d7df6.flv"
}
}
Pour tester Videopian, entrez l'URL d'une vidéo ci-dessous :
Source v0.1.1 – 29Ko
Version zip v0.1.1 – 5Ko
v0.1.1 (17.07.2009) : correction d'un bug pour les vidéos Dailymotion lors de l'utilisation de la méthode statique get
v0.1 (16.07.2009) : première version stable
Outil réalisé par Denis Hovart <denis@upian> et Hans Lemuet <hans@upian>
Depuis 1998, Upian accompagne les agences interactives. Depuis 1998, Upian produit aussi des contenus indépendants et culturels.
Ce script est référencé sur freshmeat et Hot Scripts.