H
H
hackyoupeople2019-02-19 04:21:46
YouTube
hackyoupeople, 2019-02-19 04:21:46

What am I doing wrong with YouTub API?

What am I doing wrong? Why doesn't the method work?
It doesn't work like this!!!

$('.add').on('click', function () { 
var url = $(this).attr('data-id'); 
player.cueVideoById(url); 
});

But for such everything is OK !!!
$('.add').on('click', function () {
var url = $(this).attr('data-id'); 
var u ="http://www.youtube.com/v/"+url+"?version=3"; 
player.loadVideoByUrl(u);
});

the following is written in the url: RVTvrzjQAGY
By ID does not want to run by URL, I want to do it according to the proposed scheme, but it does not go out by ID to add a video !!! What is wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2019-02-19
@hackyoupeople

Both work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question