Planet Drupal

Map a Video Feed!

Sean Effel from drupaltherapy.com recently created an excellent Feed API + Emfield Recipe video tutorial.

He shows you step-by-step how to take a video feed from Blip.TV (or any other provider supported by Embedded Media Field) and aggregate it on your own site, videos, thumbnails, and all, automatically turning the remote videos into nodes on your site, ready for theming, comments, and anything else you want.


See the Video!

RPG Achievements

So I have recently implemented and committed RPG Achieve in the RPG module series for Drupal. This allows games to record achievements of players, such as "You have slain 14 dragons", or "You were the first to summit Ploggers Peak". Next in that progression will be RPG Quest, which will allow achievements to be grouped together.

I've begun implementing achievements in Spindowners, an upcoming sci-fi RPG being built with the RPG module. The game's shaping up nicely, and is currently in a closed Alpha. It's nearly ready for an open Alpha, with one character class at least.

Achievements may be defined in the administration pages, or through rulesets. Once defined, you only need to call rpg_achieve_set("achievement_1", $pc) to set the achievement. Each achievement has fine-tuned permissions, so that they may be visible to the player or not, and whether or not a message of achievement is sent, for instance. Obviously, each player character has their own achievements. Once Views 2 is out and RPG is ported to d6, I'll also hook it into the upcoming RPG Views.

Other new changes: I've ripped out the definitions from Rulesets into their own .inc files, for automatic inclusion on import, since those will only be called once. It's easy to limit character classes for user roles, etc., now, with hook_rpg_pc_types. I'm also in the middle of defining a few more useful core objects in Drudge, such as "Shuffled Event Lists" (which spout out occasional messages when appropriate, such as "A hawk cries in the distance," or "A meteor shoots across the night sky"). Along these lines, I've introduced rpg_trigger_all('event_name'), which will call rpg_trigger for all objects in scope.

Scope is another new thing, necessary for events to work properly. Now, when each event is called, the $rpg['scope'] array will hold all objects in scope for that event. By default, that will be the pc, the pc's containing room, and any objects invoked during an action. Other objects may be added or removed manually, but that should be sufficient in most cases.

Next on my plate: the holy grail: a single game page that never reloads, instead reloading just the blocks as needed. This allows for the creation of neato game UI's, battle music, and the ever-popular ad block from hell...

IF YOU HAVEN'T ALREADY, make a character at Drupal RPG. It's fun! Pointless right now, but you can see what all the fuss is about. Make sure to check out the snowbank for fun things to do...

Aaron Winborn
AaronWinborn.com (my blog)
Drupal RPG (home for the RPG module)
Spindowners (an upcoming sci-fi game built with the RPG module, currently in closed alpha)
Advomatic (my day job, a really cool place to work)

Embedded Media Field gets Thickbox Support!

The good folks at Zivtech (Alex Urevick-Ackelsberg and Jody Hamilton) have been plugging away at Embedded Media Field while I was away. It has bling now!

Check out their Drupal Video page. Click on a thumbnail, go ahead.

Thickbox!

Here's a screenshot, just in case you didn't do that yet:

It's in the latest dev version, so you should go grab that right now and spice up your site! (You'll need to have the Thickbox module installed as well.

Alex is promising a write-up tutorial soon, so watch out for it!

jQuery Media Release

I made an official release for the jQuery Media module. This is a wrapper for the jQuery Media plugin. I have made this a full featured module, an aid for developers and themers. We are using it for the audio clips of Air America Radio.

From its help page:

The jQuery Media plugin will turn links to media into their embedded media equivalents, or into a modal overlay embedding the media when the link is clicked. Installing and configuring the module is only the first step: you must also manually theme the output of links in order to enjoy the benefits of this plugin.

Theming is outside of the scope of this help page. You might look at Drupal's Theme Developer's Guide for more information. However, once you are ready to theme your elements, you only need to add a class and invoke this plugin. For instance, if you have a File Field with a video, simply use something like the following:

<?php
jq_add
('jquery_media');
print
l($node->title, $node->field_file_field[0]['filepath'], array('class' => 'media'));
?>

You may override the global defaults of this plugin when configuring. Additionally, you may override a global default on a case-by-case basis by including the override in an options array when invoking the plugin. For instance, you might override the background color of players on a specific page with

<?php
jq_add
('jquery_media', array('bgcolor' => '#33FF00'));
?>

This will override the defaults of the plugin for every media link on that page, which may in turn override those individually (more on that later).

The full array of global overrides are as follows:

  • 'flvplayer' => The path to the Flash Video Player to be used, such as the JW FLV Player or Wimpy Rave.
  • 'mp3player' => The path to the MP3 Audio Player to be used, such as the JW FLV Player or Wimpy MP3 Player.
  • 'boxtitle' => When using the MediaBox option (the modal overlay), this will be the title displayed on that box after clicking the link.
  • 'loadingimage' => When using the MediaBox option, the path to this image will be displayed while loading the media after clicking the link.
  • 'media width' => The width the media will be displayed as.
  • 'media height' => The height the media will be displayed as.
  • 'mediabox width' => The width the MediaBox will be displayed as.
  • 'mediabox height' => The height the MediaBox will be displayed as.
  • 'autoplay' => If TRUE, then play the media as soon as loading it.
  • 'bgcolor' => This will be the background color for the media player, in hexidecimal code (#RRGGBB).
  • 'invoke media' => If TRUE, then cause all links with the 'media class' to automatically be turned into embedded media when invoking the plugin.
  • 'invoke mediabox' => If TRUE, then cause all links with the 'mediabox class' to automatically display a modal overlay box when clicked.
  • 'media class' => The class that will be turned into embedded media on invocation. It uses jQuery CSS notation, so should be something like 'a.media' for links.
  • 'mediabox class' => The class that will display a modal overlay box when clicked on invocation. It uses jQuery CSS notation, so should be something like 'a.mediabox' for links.

Finally, you may override a global setting on an individual basis. The customizations here are extensive, and rather than repeating that here, you are directed to the jQuery Media homepage for more information. As an example, you might set the size of a specific file with the following, while leaving any other jquery media links on the page at their default. (Note that we change the class away from the default 'media' in this example. It also assumes we've already invoked it as above.):

<?php
print l($node->title, $node->field_audio_file, array('class' => 'media-audio')); drupal_add_js("$('a.media-audio').media( { width: 200, height: 15, autoplay: true } )", 'inline');
?>

Note that by default, the module will add its default overrides inline. However, you may set it to output them to a dynamic javascript file, and may additionally wish to set the defaults to a static js file, once development is complete. You can alter those settings when configuring the module.

Plans for jQuery Media and jMedia Support

I've just created the jQuery Media and jMedia wrapper modules for those two jQuery plugins. I am excited about both of them, which are similar. I'm already using jQuery Media for the audio player for Air America Radio (to be launched next week), and found out about jMedia today while researching other uses for the plugin.

Basically, these plugins will replace links or other text with Multimedia, automatically compatible with the browser. They both support audio and video, and come packed with cool features that I haven't even finished exploring yet.

I'll show you how it works next week after Air America's launch. But I'll let you know, it's really, really cool. Makes developing multimedia intensive sites super easy. And I'll definitely have to put it in Drupal Multimedia, my book that should be published this summer.

I plan to support one or both of them in Embedded Media Field as well, as it should make theming that easier than it currently is. They both already support jQ out of the box, for easier administration.

And that's just the beginning...

Drupal will Explode your Site into a Million Pieces, and Why You Want That.

Views as a Web Widget has the potential to revolutionize the Internet, now that I think about it. Taking a hint from Steve Rubel of Micro Persuasion in The Future is Web Services, Not Web Sites, we are entering a time where creating an API for embedding content within another site is becoming a standard way of sharing information.

The leading players on the web all see the train coming. They are wisely creating APIs and turning themselves into plug-and-play services, not just big destinations. YouTube is just the latest to do so today. Amazon has S3. Google has OpenSocial and an extensive library of APIs. As does Microsoft. Facebook is allowing its applications to live outside the site. Twitter is an API first and (eventually) a business model second. Finally, the booming widget economy shows the promise of small content that can go anywhere.

The Views as a Web Widget project is being proposed for Google's 2008 Summer of Code. This project will allow an administrator to turn any view into a widget.

As I have experience with this, having implemented Views Slideshow (any view into a slideshow), Embedded Media Field (embedding external "widgets" from YouTube, Flickr, etc.), and a widget for Maplight, and am interested in being a mentor this year, I plan to offer to mentor that project, along with Alex Urevick-Ackelsberg.

Tim Berners-Lee spoke last week on the topic, saying that the semantic web will supersede the monolithic giants of Facebook and Google. As Dries recently indicated at his State of Drupal address in Boston, the Drupal of the future will be semantic web.

The Drupal of the Future will explode your site into a million pieces. And if your site can handle that, it will thrive in that multifaceted environment.

YouTube Expands API: Good for Embedded Media Field

So YouTube just added some new features to their API:

  • Upload videos and video responses to YouTube
  • Add/Edit user and video metadata (titles, descriptions, ratings, comments, favorites, contacts, etc)
  • Fetch localized standard feeds (most viewed, top rated, etc.) for 18 international locales
  • Perform custom queries optimized for 18 international locales
  • Customize player UI and control video playback (pause, play, stop, etc.) through software

How does this apply to Embedded Media Field? And how about to Drupal as a whole?

Embedded Media Field still needs to tie into the Media Mover module, firstly, to even allow uploading (harvesting) videos and sending them to YouTube (processing) before storing them in the content field. Once it does that, though, we can get a little smarter. Perhaps allowing users to post responses through the API, which would become YouTube videos showing up in response to a video there, and automatically also becoming a response to the Drupal content.

We can also tap into the custom queries when selecting video to embed.

Finally, we should be able to have more control over the UI, and could use jQuery to control the playback of the video, perhaps autoplaying a few seconds after the page load, or maybe jumping forward to our favorite part of the video. We'll have to see about that.

What does that mean for the Internet? As pointed out by Erick Schonfeld at TechCrunch, Google's just flexing their muscles a bit more, trying to ensure the bulk of video on the Internet goes through GooTube. At least Embedded Media Field is taking a more open approach, independently supporting many other providers, such as Blip.TV, Revver, and Brightcove.

Aaron

Low Hanging Fruit

During our Drupal Multimedia panel on Monday, Nate Haug (quicksketch) mentioned that soon we will be discontinuing the Image module, and providing a migration for existing Image Nodes to ImageField (or its replacement).

The same thing needs to happen to the Video module. That could happen now. The module that provides a migration path for Video nodes will be king. But they'll also need to tap into the planned hook_file for d7, to keep from being dethroned.

Even if the Video module wants to survive, it will need to migrate from its current 4.6 mindset of video-as-a-node.

I'm just saying.

Calling all Writers at DrupalCon!

Recap of the first topic of my last message, for emphasis:

The obvious topic for the March newsletter is the DrupalCon, of course. There are over 800 people here, though and we need to recruit people to write up their favorite session/s. If you are at the conference, please write up at least one session, and/or find three other people who can write up a session. We only need a paragraph or two, but feel free to write up a whole big article if you're inspired.

Proof of Concept for Stand-alone Drupal Newsletter

Sneak preview of this discussion (if you decide not to click through to the rest of this discussion topic): http://drupal-newsletter.org/issue/2008/01

This DrupalCon has been phenomenal! We had an impromptu BoF session yesterday for the Drupal Newsletter. The three big things that came out of that were a plan for March's newsletter, the newsletter length, and building a stand-alone site for the newsletter.

The obvious topic for the March newsletter is the DrupalCon, of course. There are over 800 people here, though and we need to recruit people to write up their favorite session/s. If you are at the conference, please write up at least one session, and/or find three other people who can write up a session. We only need a paragraph or two, but feel free to write up a whole big article if you're inspired.

To the second item, we plan to use a system of teasers for the next issue. We'll put each section and/or article in the groups, and just link a manually created teaser in the digest that gets e-mailed and posted on d.o. We'll refine that process as we continue creating future newsletters.

Which is yet another strong case for a stand-alone newsletter site, bringing us to the third item of discussion. We created a working group, currently consisting of Alex UA, mlsamualson, and myself, to create a proof-of-concept stand-alone site. You can see it at http://drupal-newsletter.org/issue/2008/01 (which is just filler, as you'll see).

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.