Did you get my note on the blog you originally posted this question on?
When your keep handler is called, you are passed a result object. Your
current code, which is cloning the node and attaching it is using only
the .html property.
If you want to access the other properties (like duration, url, title,
thumbnail, etc.) you can easily do that. result.url is probably what
you are after.
Note, that if you only want to do this special processing for video
search results, make sure you test the result type:
if ( result.GsearchResultClass == GvideoSearch.RESULT_CLASS ) {
// its a video search result...
}
Now, the thing I don't understand about your question is what exactly
are you trying to do? Why do you want to put the URL only into a text
input form field? Typically these elements are used if you intend to
edit the content. Video URLs are very nasty looking URLs. They are very
large and should definitely not be visible to end users.
One other thing that you might want to explore is how you can use CSS
to control whats visible in a given search result. I apologize that all
of the styles are not in the written documentation, but the gsearch.css
is pretty well documented and between that and the My Favorite Places
V2 sample code you should be able to get a feel for how you can use CSS
for this. Look specifically at what we did to twiddle the web search
result details between a view that shows just the hyper-linked title,
vs. the title, snippet, visible url, attribution watermark, etc.
If all you are trying to do is clip a video search result, transmit it
to your server to save it, and then refresh your page, you can clip the
entire result into a hidden form field, round trip the page, and then
use CSS styling to show only the hyper-linked title.
Let me know more about what you are really after. The HTML that is
generated for a search result is heavily marked up with classes and is
designed to let you apply extensive styling without having to write a
lot of code.
I