The javascript example for \"search by keyword\" that is given at the google developers page isn\'t working for me. https://developers.google.com/youtube/v3/code_samples/ja
Thank you for your coding. Let me share my code:
function makeRequest(){
var q = $('#query').val();
var request = gapi.client.youtube.search.list({
q: q,
part: 'snippet'
});
request.execute(function(response){
var str = JSON.stringify(response.result,'',4);
$('#search-container').val( str);
makeControl(response);
});
}
function makeControl(resp){
var stList = '';
for (var i=0; i'+
''+
' '+
''+i+'-'+ tit +' ';
}
}
document.getElementById('list1').innerHTML = stList + '
';
//HTML:
//
}
function playVid(thi){
var st = 'https://www.youtube.com/embed/'+thi.title+'?autoplay=1';
document.getElementById('player').src = st;
//HTML:
}