Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

gapi.client.youtube is undefined?

$
0
0

I am trying to use youtube api for javascript and am getting 'gapi.client.youtube is undefined'.

I have gone through the link: Why is 'gapi.client.youtube' from Youtube Data Api V3 undefined? , but couldn't get much help.

My code is placed below:

<script>         function load(){          gapi.client.setApiKey('API_KEY');          gapi.client.load('youtube', 'v3');          searchA();        //alert(gapi.client.youtube.channels);    }        function searchA() {         var q = 'pink floyd';         var request = gapi.client.youtube.channels.list({             part: 'statistics',             forUsername : 'GameSprout'         });         request.execute(function(response) {         var str = JSON.stringify(response.result);         alert(str);     });

}

<script src="https://apis.google.com/js/client.js?onload=load">    

But its not getting gapi.client.youtube.

Can anyone please help me in his issue?


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>