Inline Video with jQuery Media!

Here’s a two-step formula for simple inline video, assuming you have jQuery Media installed on your site, doing both of these configuration steps from Administration > Site configuration > jQuery Media (at /admin/settings/jquery_media):

  1. Open the Node types field set and check the node type for which you wish inline video.
  2. Open the Classes field set, and enter .node .content a in the Media class text field. (You can separate classes by comma if you want to keep existing class invocations.)

Then just add a link to a video inline to your content. Doesn’t matter if it was uploaded with the node or through FTP. (The second step assumes you’re using the Garland theme, or another theme that uses that CSS class designation. You might need to check the node in FireBug if you’re not sure.)


Notes: This method is easy, though admittedly a bit heavy-handed. The down-side is it will be invoked regardless of whether the node actually contains a video link (fortunately it’s a lightweight jQuery plugin). If you want more fine-tuned control, you can skip the first step, use a PHP filter, and just invoke it manually from in your node, using jq_add(‘jquery_media’) (assuming you have the jQ module enabled; jquery_media_add(); otherwise). (I don’t actually recommend that, because of all the security issues involved. Just stick with the first method.)

The cool thing is this will work with pretty much any media player, including the upcoming Media Player for Drupal!