javascript - Getting Youtube Title given an id -


I got a very good reference to give a YouTube video ID to the YouTube video title but I'm sure how to get back to the title he works. That message is returning to me in the Video Info Callback function, but I'm not sure what a suggestion is going on in the information parameter. Here's the resource I am using:

Here's the code that I'm playing like this:

  function registerScript (url) {var s = document .createElement ('script'); S.type = 'text / javascript'; S.src = url; Document.getElementsByTagName ('head') [0] .appendChild (s); } Function videoInfoCallback (info) {if (info.error) {warning ('error \ n \ n' + info.error.message); } Else {var message = info.data.title; Return message; } Return "Hello"; } Function getVideoInformation (id) {if (id) {return registerScript ('https://gdata.youtube.com/feeds/api/videos/' + id + 'v = 2 & alt = jsonc & callback = videoInfoCallback '); } And {warnings ('Please enter an id'.); }}  

Actually, I want to have a function that takes the UFoutube video ID like this CFF0mV24WCY and returns it to the title.

This is not really answering your above question but it can help you in ur search

It's just a simple YouTube search that brings in the title video and view count

html

  & lt; Input type = "text" id = "search" /> & Lt; Br / & gt; & Lt; Input id = "show" type = "button" value = "submit" onclick = "show ();" /> & Lt; Div id = "result" & gt; & Lt; / Div & gt;  

JavaScript

  $ (document) .ready (function () {$ ("# show") click (function () {getYoutube ($ ("#Search") .Vel () + "Offensive Film Trailer");});}); Get the function of YouTube (title) {$. Ajax ({type: "gET", url: yt_url = 'http://gdata.youtube.com/feeds/api/videos?q=' + title + 'and format = 5 & max-results = 1 & amp; v = 2 & amp; alt = jsonc ', datatype: "jsonp", success: function (feedback) {if (response.data.items) {$ .each (response.data.items, function I , Data) {var video_id = data.id; var video_title = data.title; var video_viewcount = data.viewCount; var video_frame = "& lt; iframe width = '600' height = '385' src = 'http: // Www.youtube.com/embed/ "+ video_id +" 'frameborder =' 0 'type =' text / html '& gt; & lt; / iframe & gt; "var =" & lt; div id =' Title '& gt; "+ Video_title +"  
"+ video_frame +" gt; & lt; div id =' count '& gt; & lt; div & gt; ; "+ Video_viewcount +" ("# Result") .html (last_rease);});} other {$ ("# result"). Html ("& lt; div id = 'no' & Gt; no video & lt; / div & gt; ");}}})}}

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -