Last active
August 29, 2015 14:00
-
-
Save Mikescops/11395503 to your computer and use it in GitHub Desktop.
Check if live stream of any video on Dailymotion is ON in PHP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url_video = file_get_contents('https://api.dailymotion.com/video/<id_video>?fields=onair'); // change <id_video> by the id of your video. | |
$json = json_decode($url_video); | |
if ( $json->onair == 'true') | |
{ | |
echo "Live en cours"; | |
} | |
else | |
{ | |
echo "Pas de live"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment