Creating a YouTube Search Component

From KickApps Documentation

Jump to: navigation, search

Use the text input component, a video playlist, and some widget-fu to search and play videos from YouTube, all from within your widget!

  1. Drag an advanced video player, a text input component, a button, and a list component to the stage.
  2. Select the button and add a new action to it:
    search_component_button_action.png
  3. Use this string for the value of the new media URL (replace "Text input" with the name of your text input component):
    http://gdata.youtube.com/feeds/api/videos?orderby=updated&vq=#{Text input.text}
  4. That takes care of updating the list with the search results from YouTube when users click our button. But many users are accustomed to pressing the enter or return keys on their keyboards. To do that, add a new action to the text input component. The event will be "Keyboard Enter"; use the media URL from the previous step.
    keyboard_enter.png
  5. Done. Switch to Preview mode to try it out!

youtube_search.png

You can use the same technique to pull in videos or other media from any other site that has an open RSS search API. Just replace

http://gdata.youtube.com/feeds/api/videos?orderby=updated&vq=
with their RSS search URI.