Using the jQuery Media Plugin, we can add support for QuickTime, Windows Media, Real Player, and iframe, allowing the embedding of a wide variety of file formats. The module I'm submitting here glues Asset and jQuery Media together. The jQuery Media Drupal module is required and must be activated on all content types that may embed assets.

jQuery Media also supports mp3, flv, and swf, but I've omitted those types from this module since they are already supported in Asset Bonus.

Comments

wmostrey’s picture

Wow this is amazing! Thank you so much for your work on this David! It would be so great if this could replace the asset_bonus module altogether, that would tie in perfectly with the future of the asset module.

Do you have the code for mp3, flv and swf support? If so it would be awesome if you could add it and re-send the module.

David Lesieur’s picture

I did not code anything for mp3, flv and swf, but it's true that it probably makes more sense (and should be pretty easy) to support those though jQuery Media as well.

wmostrey’s picture

Status: Needs review » Needs work
StatusFileSize
new6.72 KB

I can't seem to get it to work for mp3 and flv/swf. Could you take a quick look? It generates a blank space of the defined size but the player itself doesn't show up.

David Lesieur’s picture

StatusFileSize
new6.89 KB

I did some tests... MP3 and FLV embedding works properly in a node (at least with JW Player as the player for MP3 and FLV), but doesn't work in the Asset Wizard. It is probably because we're missing the following little bit of JavaScript that is normally added by jquery_media_add():

<script type="text/javascript">
if (Drupal.jsEnabled) {
  $(document).ready(function() {
    $.fn.media.defaults.flvPlayer = '/jwplayer/player.swf';
    $.fn.media.defaults.mp3Player = '/jwplayer/player.swf';
    $('a.media, .filefield-item a').media();
  });  
}
</script>

In my jQuery Media settings, I have set my default players to '/jwplayer/player.swf', but without the above code jQuery Media will look for 'mediaplayer.swf'.

The last version you have posted was missing WMA support. I suppose it was removed by mistake, so I'm posting a version with WMA support back in. MP3 and FLV support are not fixed though.

Note: Relying on jQuery Media for MP3 embedding is somewhat less user-friendly than just enabling Asset Bonus because more configuration work is needed to get up and running (setting the player, possibly having to tweak the flashvars). Also, it looks like 1PixelOut doesn't readily work with jQuery Media.

wmostrey’s picture

Status: Needs work » Closed (won't fix)