Planet Drupal

Media Code Sprint: Status Report One

As announced, we've begun the Media Code Sprint to put better media handling into Drupal core!

It's been a great time so far. In the morning, drewish compiled a file function guessing game (free beer!), and andreiashu took the bait and completed the first round with great feedback about how unusable the current state is.

Next, we've sat down and begun writing SimpleTests for the hook_file patch. This has been great fun for me personally; though drewish is an old hand at building tests, this is completely new for me. And to top it off, webchick, Queen of Drupal testing, dropped by our table and got involved!

Even the process of writing tests has been helpful; we found at least one case for validation that had been missed in the original patch, and drewish decided that file_scan_directory needed refactoring. (He's currently chasing other problems as well, and cursing about finding himself going down rabbit holes.)

There's more fun to be had for all! If you want a quick 15 minute task that everyone is qualified to do, go play the File API Function Guessing Game. If you want to do more, then ping me (aaronwinborn), drewish, or dopry at #drupal in IRC, or leave a comment here!

Media Code Sprint (Top 3 Goals)

Andrew Morton (drewish), Darrel O'Pry (dopry, remotely), and I are heading up a Media Code Sprint in Portland this week! Come help, in person or remotely, if you're interested in multimedia and Drupal! It has now officially started, and as I've volunteered to help keep folks updated, here goes...

First the reasons.

Number One: Better Media Handling in Core

Dries conducted a survey prior to his State of Drupal presentation at Boston Drupalcon 2008, and number one on the top ten (or 11) list of what would make THE KILLER DRUPAL 7 Release was "Better media handling".

Let me repeat that. Better media handling.

People have done really amazing stuff in contrib, but it is difficult (if not impossible in many cases) for developers to coordinate the use of files, as there is no good means for file handling in the core of Drupal. Thus, we have several dozen (or more) media modules doing some small part, or even duplicating functionality, sometimes out of necessity.

We need (better) media and file handling in Drupal core. In particular, there has been a patch for a hook_file in the queue for over a year, which has been in the Patch Spotlight (for the second time, no less) since May! (And has been RTBC several times during that process...) Come on folks.

One of the powers of Drupal is its system of hooks. We have hooks to modify nodes, to notify changes to user objects, to alter nearly any data (such as forms and menus). Noticeably absent is a consistent handling for files or any sort of notification. We need hook_file.

So goal Number One: get media handling in core. The means? Add hook_file and make files into a 1st class Drupal object. We'll be creating a test suite for functionality in the hook_file patch to validate it and "grease the wheels" to get it committed.

The other goals of this sprint pale in comparison to the first in utility, but are still highly desirable and worthwhile.

Number Two: Refactor File Functionality in Core

As an extension to the first goal, there is a lot of inconsistency with how Drupal currently handles files. For instance, in some areas a function may return an object, and in others a string. Additionally, some functions are misnamed, or try to do too much to be useful as a file API.

Some specific examples: for what it does, file_check_directory may be better suited as something like file_check_writable, or maybe even split into that and file_check_make_writable. Also, for instance, file_scan_directory needs to return file objects, rather than the current associative array (keyed on the provided key) of objects with "path", "basename", and "name" members corresponding to the matching files. (The function does what it needs to, but the returned objects have keys not corresponding to anything else used in core.)

So goal Number Two: refactor file functionality in core. The means? Go through and check for (and fix!) existing file functionality for documentation and consistency.

Number Three: Spruce up Existing Contributed Media Modules

There are several much needed multimedia modules that have not yet been upgraded to Drupal 6 (or which are still in heavy progress). This includes (but is not limited to) Image Field, Image API, and Embedded Media Field. Additionally, some major improvements can be made, both to these, and to other essentials, such as the Image module, such as creating a migration path from Image to Image Field (once that module is stable).

So goal Number Three: spruce up existing contributed media modules. The means? Get these modules upgraded!

I want to recognize the valiant and heroic efforts made by everyone to date, as fortunately, there has already been significant progress on all these fronts. That makes our job (relatively) easy. In some respects, we just need to finish up the jobs that have already been started.

Thus, drewish declared this week the Media Code Sprint!

We need your help. If you are a developer, or want to be a developer, jump on in! If you aren't ready to develop, or consider yourself too new for that, you can still help test patches and functionality. Jump on in! And please, even if you don't know how to apply a patch, you can still help with documentation and other small (but important) tasks. Jump on in!

If you're in Portland, You Have No Excuse®. If not, you can jump into #drupal in IRC any time you're available.

The official dates for the sprint are today (Wednesday July 23, 2008) through Saturday (the 26th). We'll be online and working most of that time. I'll make sure we continue to post progress as the week develops.

Of course, as is the wonderful nature of Drupal, this is an ongoing process. Even if we achieve our stated goals, there will always be more.

Thanks,
Aaron Winborn

JavaScript Theming, a Paradigm Shift

Oleg Terenchuk (litwol) is now developing the JavaScript Theming module. The five second elevator spiel: this will move theming from the server to the client.

The longer explanation is a bit more exciting. This module plans to abstract the core of Drupal theming into a javascript layer. This will allow a JSON feed to pass raw data to a browser to be formatted on the fly for display.

The implications are astounding, and I'm still wrapping my brain around the possibilities. For one, it could mean super fast in place load times, because Drupal doesn't have to mess around with passing everything around the theming system. An AJAX request could just ask for the data, Drupal sends it, and jQuery will format your list, table, teaser, or what have you. In its second day of life, it already works with messages (and item lists, I believe).

A potential problem I see might be that slower computers would see slower rendering times. But this is already happening with some jQuery-heavy sites anyway. The benefit would be most seen with faster hardware, but this is always true with cutting-edge technology. Everyone else will catch up soon enough.

In any case, I have a feeling that by this time next year, I'll be blogging about the killer combo that changed the world of Drupal and is sending ripples through the Internet: Embed Widgets + JavaScript Theming...

PS Come to DrupalCampNYC next month to find out more!

Built a New Widget!

Medicare Prescription Drug Price Negotiation Act of 2007 (at MAPLight.org)Center for Responsive PoliticsMedicare Prescription Drug Price Negotiation Act of 2007 (at MAPLight.org)

Neil Drumm and I just launched a new widget with Advomatic, over at MapLight.

This widget is fully customizable, and returns a dynamic image with data created on the fly. I did the image part of things.

I'll do a write up someday soon. I promise! Busy with book editing and work this week...

Edit: I forgot to link to the production version earlier. Sorry... Should be working now...

Magic Local Video Recipe!

If you haven't already, make sure to check out Sean Effel's latest Filefield + jQuery Media screencast! As was his earlier Feed API + Emfield video tutorial, this is a joy to watch: he does things in thirteen minutes that took developers hours or more to do even a few short months ago, and that's with a running commentary! By the end of the video, you will have learned a simple way to upload a video (using the light-weight File Field module) and have it properly displayed without any messy configurations or external libraries. Plus, as the recipe uses the jQuery Media plug-in wrapper module, the display will be cross-browser compliant and accessible.

Next on my plate for jQuery Media is to have it be easily added to nodes on an individual basis, so that a media clip could be linked inline and automatically turned into an embedded display. Additionally, I would like to make it an option for Views as well, perhaps as an additional setting. (Although even without that, my upcoming book Drupal Multimedia, to be published in September, goes into some detail about how this can already be done, to create powerful video and audio playlists.)

Drupal Multimedia Book Announcement at Drupal.org

So I just made a formal announcement of the pending publication of Drupal Multimedia to Drupal.org, which was promoted to the front page of d.o!

What a fun and nerve-wracking task that was. Trying to distill several months of work into a small list. Tweaking every word to make sure it's right. Then even in the end, realizing I'd made the post in third person, but left my signature in first.

But this is nothing compared to the book! We've just started the editing process, and it's really great, seeing the words from the first chapter I wrote months ago, and having to face the reality of their obsolescence. I knew taking on the project that I wanted to write the book for Drupal 6, which didn't even exist at the time. So the first half of the book was speculative in a very real sense; few of us knew in October what merlinofchaos had planned for Views 2!

That's what the editing process is for though. We're making sure the book is relevant for Drupal 6. (And I'm trying to keep in the necessary parts to ensure it's still useful for those still using Drupal 5, even if those are relegated to hint and tip boxes.)

It's amazing how far Drupal has come over the years. That we can devote an entire book to integrating multimedia into Drupal is a testament to that. When the book is finally in your hands, I hope reading it will be as helpful for your continued learning as writing it has been for mine.

Though my next book might simply be a blog...

Wii Couldn't Help it...

So Lullabot just bragged on Drupal, rightfully so. I was thinking, "Well of course, they can handle 20k comments in 24hrs... Drupal is scalable!" Still, it's nice to see that in action.

DrupalWii

Of course, as my family and I finally broke down and got a Wii this summer, the first video gaming experience my wife has finally admitted to liking, I had to go and enter the contest for a Wii Fit.

Of particular interest to me, although admittedly off on a tangent for this example, is that I've just finished writing the last chapter to Drupal Multimedia (available in September!), where I pontificate a bit about the future of multimedia handling in Drupal. And I just had to bring the Wii into the fray.

I believe that just around the corner, we'll see tactile media become of interest to the Web. And of course, once something's available for the Web, there will quickly be a dozen related modules making use of it for DrupalWii. Second Life is already showing the way to 3D navigation; once we have touch, for which the Wii is an early adopter with its control stick "rumbling", we'll be on the fast track to virtual reality on the web.

I already now have an excuse to do some occasional QA on the Wii, or Second Life for that matter, even without that, since they both use the Opera browser...

And sorry about the pun, wii couldn't help it... ;)

Embedded Media Field a Media Essential

Embedded Media Field has grown exponentially in the last year since I've begun developing it. From its humble beginnings as a brainstorming session at DrupalCampNYC last spring, it has grown from a quirky method of make embedding YouTube videos easier for editors to a full-featured suite of modules allowing for drag-and-drop placement of third party videos, images, and audio clips.

Used on a wide range of sites, such as Air America, NRDC, and Drupal Dojo, the module is a flexible and powerful solution for embedding multimedia.

Read on for its strengths and weaknesses...

Playlist Sorting at Air America Radio

Advomatic just launched a new feature for Air America's player. Users are able to create their own play lists of favorite audio and video clips, and sort them in their preferred order.

To see this functionality in action, you'll need to go to the Air America site, and create a user account. After doing so, launch their player, by pressing on the big Listen Live button on the top left of every page.

Add two or three audio clips by pressing the "+" next to a clip, then go to the video tab and do the same thing.

Finally, go to the Playlist tab. Here, you can click and drag clips to sort them as desired. Go ahead. It's all saved, which you can confirm by going to another tab, logging out, logging back in, etc.

Site recipe follows!

YouTube API Sneak Peek!

As referred to in YouTube API for Drupal on the Way, beeradb has now opened the YouTube API module for development. He and I have been working to polish it up and make it ready for release.

You can take a look at the YouTube search on this site if you want to try it out! You can currently search YouTube for tags or users from the form, and see the results right here.

Obviously, that's just the tip of the iceberg. There are some cool things planned for it in the near term, such as integration with Media Mover, Embedded Media Field, and yes, Rob, I haven't forgotten about Annotation Field...

And of course, the holy grail of single site integration of a YouTube video upload from your browser...

Syndicate content

The Society for Venturism has chosen me as the recipient of its charity for this year, to hopefully offer me cryonic preservation when the time comes. And this month, Longecity, an excellent forum for the discussion of issues related to extending the lifespan of humans, has offered up a matching grant of up to a thousand dollars to help out! So help out! Please.