Is it possible to check if YouTube video exists before I send the link to Youtube player.
I found this:
publicfunction checkVideoExists(){
$headers = get_headers('http://gdata.youtube.com/feeds/api/videos/'. $videoId);
if(!strpos($headers[0],'200')){
echo "The YouTube video you entered does not exist";
returnfalse;
}
}
and this:
$videoID ="o8UCI7r1Aqw";
$header = get_headers("http://gdata.youtube.com/feeds/api/videos/". $videoID);
exit(var_dump($header));
switch($headers[0]){
case'200':
// video valid
break;
case'403':
// private video
break;
case'404':
// video not found
break;
default:
// nothing above
break;
but I'm beginner and I don't know how to do this in Basic4Android.
I found this:
publicfunction checkVideoExists(){
$headers = get_headers('http://gdata.youtube.com/feeds/api/videos/'. $videoId);
if(!strpos($headers[0],'200')){
echo "The YouTube video you entered does not exist";
returnfalse;
}
}
and this:
$videoID ="o8UCI7r1Aqw";
$header = get_headers("http://gdata.youtube.com/feeds/api/videos/". $videoID);
exit(var_dump($header));
switch($headers[0]){
case'200':
// video valid
break;
case'403':
// private video
break;
case'404':
// video not found
break;
default:
// nothing above
break;
but I'm beginner and I don't know how to do this in Basic4Android.