As part of the sequencer I have been working on an add media wizard to enable the searching and inserting of media to a given sequence. This add media wizard could also serve as an entry point to adding media to pages.
== demo ==
First disclaimer: this is still pretty early on in development more of an early semi-working prototype than a beta or anything usable. (For example have not done much cross browser testing yet (use firefox)) But if you want to check it out go ahead and add: importScriptURI('http://mvbox2.cse.ucsc.edu/w/extensions/MetavidWiki/skins/external_media_wiz...'); to your User:{username}/monobook.js page
or you can load a slightly older version at: http://en.wikipedia.org/w/extensions/MetavidWiki/skins/external_media_wizard...
Once installed to your user page go to edit some page like "sandbox" highlight a word or place the cursor where you want to insert media. Click the add media wizard at the top right of the edit box. You should get a few images from commons can click on an image to insert, add in-line description, crop if you like and then preview the insert into the page. Once happy "do the insert" it will paste in the wiki code to insert that image into the page you can modify and then re-preview the page if you like.
You can also do a political search like "Iraq" or "Obama" and pull up metavid clips to see how the setting in-and-out points of video has been prototyped so far.
(note: metavid fallback to flash video while the html5 video tag for firefox is still maturing... if you are using a firerfox nightly http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/ you may have to click the options button in the lower right to select ogg video stream)
Once done playing with the prototype, I recommend removing the script from your user page. I will update the list once its more _ready_ for wider usage.
It should work on remote wikis with the commons import system. Ie you can try including this script on your local mediaWiki installation .. if you have $wgAllowCopyUploads enabled your wiki should be able to download and import commons images directly into the wiki.
== Issues == So this brings up a whole host of issues.. here are some that I thought of... I thought I would ping this to get some more ;)
=== security ===
* Right now the wizard pulls directly from remote repositories, (ie commons and metavid.org serves up the search results in json with a callback).. This means the compromise of any server that we support as a remote repository will result in xss issue. This is true for any remote script that users include but would be a bigger problem if the add media wizard moves into more common usage.
** We should probably proxy the results so we can just process them as RSS and run normal script filters on the data. -- this is slower and adds more strain to our servers but provides more security.
** or we limit the "included by default" repositories and put in a kill switch of sorts that we can run to stop injecting from any compromised remote repository? making it difficult to cause big xss issues "by default". We have users jump though some hoops to enable less common remote repositories similar to how the user scripts work?
=== performance / maintainable/modular code / internationalization ===
* JS Library loading... we want to start moving towards more modular scripts ie we don't need to include all the remote repository objects on first load (ie we have a search object for flicker we want to dynamically add in that remote repository search object as necessary when the user click on the flicker repository tab. )
For portability outside of mediaWiki we have to have each js object/file should define any user language messages that it includes, that way our script server system can send out the right language messages with the JS library that uses them.
Some discussion about a javascript loading system took place on this list not long ago.. I said I would revisit the issue so I will try and do that soon :) http://lists.wikimedia.org/pipermail/wikitech-l/2008-December/040625.html
=== Licenses / archive restrictions ==
So far I have just included the metavid "remote" repository (importing is not working yet until we enable Uploading by URL and do some fixes for cross site issues (ie your inserting content on the wikipedia domain but want the resource to be uploaded to commons).
In terms of external archive license issues I am thinking we essentially require that the external archive provide license info and we represent that with a little icon below each image and then pull the appropriate template into the import resource description. The other obvious external archives restriction is for video that they provide the video in ogg theora format. Preferably they run oggz_chop so that a segment of the video can be dynamically selected. We have already been working with archive.org on this front see: http://metavid.org/blog/2008/12/08/archiveorg-ogg-support/
== road map / up-and-coming efforts ==
* get scaling working ... (right now just defaults to thumb or cropped size).
* license support (add in license thumbnails and wikimedia commons template mappings for import descriptions)
* layout control (real time layout control will let you adjust size and float layout properties... maybe even let you move the image around in the page.
* "add by URL" option for parsing resource pages of common repositories. ie maybe you find a picture using flickr's search engine you want to copy and paste that url not search for it again.
* uploading .. integrate http://firefogg.org/ for uploading video from arbitrary source content to ogg theora with server side provided encoding settings.
* fix importing of videos (from metavid initially, but done in a general way to support archive.org video inserts)
* javascript loader (integrate a solution to the large set of many javascript files / localization problem)
* add annodex oggz_chop to wikipedia server side architecture so that we can support setting in-and-out points for ogg video (like we can do on metavid and archive.org video)
* improve generalization of search classes and add support more remote repositories. (archive.org, fliker etc)
* improve mediaWiki api so we can query for "only videos" or only svg and or both the Title and Description text at the same time.
* make a more general protocol for establishing queriable properties. This will let us do discovery of "advanced search" parameters in a general way. More complicated use case is for full semantic wiki. For some examples of finding video clips with semantic searches see: http://metavid.org/wiki/Sample_Semantic_Queries_page
* improve the image "editor" integrate and or improve around multi-user collaboration some library for simple canvas/image manipulations ie: http://editor.pixastic.com/ (with server side support for rendering out these transformations for performance and older and or otherwise crippled web browsers (ie IE)
** along those lines add in server side support for cropping with the larger transformation framework in mind.
peace, michael
wikitech-l@lists.wikimedia.org