Available Plugins
Searchbar plugin
This plugin displays a small searchbar in the player. When pressing the submit button, the plugin sends the search query to a serverside script. The script should return the search results as a feed format the player can read. These results are loaded into the player.
This plugin is compatible with version 4.1 of the player. Positioning the plugin to top or bottom only works from version 4.4.
Examples
Here is an example of the searchbar plugin in action. The flashvars are shown below the example. By default, the plugin searches at youtube.
playlist=right&playlistsize=360&plugins=searchbar
Here's a second example, with the searchbar below the player and a custom search script. The player also has a custom lightcolor assigned.
plugins=searchbar&lightcolor=0xFFCC00&searchbar.position=bottom&searchbar.script=http://demo.bitsontherun.com/searchbar/search.php%3Fq%3DQUERY
Configuration
The plugin is loaded with the flashvar plugins=searchbar. This will automatically load the latest version of the plugin straight off our servers. The plugin offers four additional flashvars:
- searchbar.color: Color of the submit button. Is CC0000 (red) by default. The button will automatically be set to the lightcolor flashvar of the overall player if it is specified instead.
- searchbar.label: Label of the submit button. Is Search by default.
- searchbar.position: set this to either top or bottom if you want to display the searchbar outside of the display space. The searchbar is 40px high and will stretch itself over the full width of the player.
- searchbar.script: location of the serverside search script. By default, this is a script from Youtube: http://gdata.youtube.com/feeds/api/videos?vq=QUERY&format=5. The plugin automatically replaces the QUERY string with the actual search query from the input box. The script should return the search results in the form of one of the XML formats the player reads.
Since this plugin uses the official Youtube API and chromeless player for the default esearches, there's no workaround for either hiding the Youtube logo or displaying higher quality videos.
Note that the loading of a custom script is subject to the Crossdomain security restrictions of Flash. This means that a player on one domain cannot call a search script from another domain. This issue can be circumvented by placing a crossdomain.xml file at the server the script is loaded from.
Source code
The source code of this plugin can be obtained in a zip (click the zip links at the bottom) or through Subversion:
svn co http://developer.longtailvideo.com/svn/plugins/searchbar
If you don't have a Subversion client, check out Tortoise (Windows) or SC Plugin (MAC).
You don't need Adobe Flash to modify this plugin. Instead, you can edit the plugin with any text editor you like. The plugin can be compiled with the free, cross-platform MXMLC compiler. See our plugin compiling overview for more info.
