1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Youtube Video Title JS - how to do it?

Discussion in 'HTML & JavaScript' started by neu009, Feb 28, 2014.

  1. neu009

    neu009 Jr. VIP Jr. VIP Premium Member

    Joined:
    Jul 29, 2009
    Messages:
    1,021
    Likes Received:
    272
    Hi Guys,

    I have extracted the ID from the video embed already but now I am wondering how to query for the video title using the ID in JS.
    Just getting started with all this so any pointers how to query YT for this info would be great.

    Played around a bit with some stuff but can't get the variable to populate so the request must be wrong.

    Thanks!
     
  2. neu009

    neu009 Jr. VIP Jr. VIP Premium Member

    Joined:
    Jul 29, 2009
    Messages:
    1,021
    Likes Received:
    272
    Guess I found my main problem it was right there all this time :
    No 'Access-Control-Allow-Origin' header is present on the requested resource
    Now I just have to find a solution how this can be done.
     
  3. x00bin

    x00bin Newbie

    Joined:
    Mar 20, 2014
    Messages:
    19
    Likes Received:
    1
    Occupation:
    Independent Contractor
    Location:
    World Wide Web
    Home Page:
    Hello "neu009",

    its easy. Just do an ajax request on
    ****://gdata.youtube.***/feeds/api/videos/%videoId%?v=2&alt=jsonc

    You'll get a json response and there you'll find any informations about your video (id).

    Greetings,
    me