RSS News Feed
Movie Masher

open source online video editor and encoding api

 
 
 
 
 
 
Within the applet, media is usually presented to the end user inside the Browser control, which allows it to be dragged into the Timeline for inclusion in the mash. Each media item that appears in the browser's scrollable list corresponds to a media tag somewhere in the configuration.

There are several ways to populate the list of media items. The simplest is to specify 'media' for the source attribute of the Browser's control tag. This will include each and every media tag encountered in the initial configuration. While this behavior may be useful in some situations, it's usually more helpful to group the media in some way (typically by type), which requires a better understanding of what's going on under the hood...

As the applet loads the initial configuration, each media tag encountered is placed into a source tag having the special id of 'media'. If this tag isn't present in the configuration it will be created automatically. This source (or others you create) can be bound to controls, which can then set its properties to limit the list is some way (typically by type).

For example, this behavior can be used to create buttons that limit the media displayed in the browser when clicked. The following button limits the list to only include audio items:

<control 
  bind='media.type' 
  value='audio'
  ...
/>

It's also possible to use text entry fields instead of buttons, to allow for keyword searches of item labels. Any number of controls can be bound to a source and any number of properties can be used. Default property values can be set in the source tag itself.

Now, the source tag also supports a url attribute which, if defined, will produce different behavior. Instead of filtering the results by property, the property values are parsed into the URL which is then requested for the result set. For instance, if 'media/xml/{type}.xml' were specified and the button aboved were clicked, the URL would be parsed as 'media/xml/audio.xml' and any media tags found in that file would be displayed in the browser.

More complex searching can be accomplished by pointing the URL to a CGI script and specifying the properties as parameters. The architecture provides two special properties that allow for paging through result sets. Both index and count properties can be parsed into the URL to indicate which page of results are needed and how many results to return per page. The browser control will continue to request pages as the user scrolls down through the list as long as the CGI returns the correct number of results. Changes in other properties will cause index to be reset to zero.

 
© Movie Masher, Inc. 2006-2013