? dif
cvs diff: Diffing .
Index: README.txt
===================================================================
RCS file: /cvs/drupal/contributions/modules/jplayer/README.txt,v
retrieving revision 1.1
diff -u -p -r1.1 README.txt
--- README.txt	1 May 2010 04:28:08 -0000	1.1
+++ README.txt	21 Sep 2010 17:29:32 -0000
@@ -3,11 +3,13 @@
 The jPlayer module provides a wrapper around the jPlayer JavaScript library.
 This library provides an HTML5-based player, that uses a Flash fallback for
 browsers that do not support it. This module provides a default presentation
-for the player, as well as integration with CCK file fields. This makes it
-possible to easily convert the display of any file field into an audio player.
+for the player, as well as integration with CCK file fields and embedded audio
+fields. This makes it possible to easily convert the display of any file field
+or embedded audio field into an audio player.
 
 This player will only work with MP3 files, so please be sure to restrict the
-file upload extensions on your file fields to only allow the mp3 extension.
+file upload extensions on your file fields or embedded audio fields to only
+allow the mp3 extension.
 
 jPlayer module was written by Nate Haug.
 
@@ -16,8 +18,11 @@ This Module Made by Robots: http://www.l
 Dependencies
 ------------
 
-* CCK (Content module)
-* FileField
+* CCK (Content module) [http://drupal.org/project/cck]
+
+Either or both of:
+* FileField [http://drupal.org/project/filefield]
+* Embedded Media Field [http://drupal.org/project/emfield]
 
 Install
 -------
@@ -32,14 +37,14 @@ Install
 3) In your Drupal site, enable the module under Administer -> Site building ->
    Modules (/admin/build/modules).
 
-4) Add or configure a FileField under Administer -> Content management ->
-   Content types -> [type] -> Manage Fields
+4) Add or configure a FileField or Embedded audio field under Administer ->
+   Content management -> Content types -> [type] -> Manage Fields
    (admin/content/node-type/[type]/fields). Restrict the upload extension to
-   only allow the mp3 extension. It's also a good idea to enable the Description
-   option, as this can be used to label your files when they are displayed in
-   the playlist.
+   only allow the mp3 extension. It's also a good idea to enable the
+   Description option, as this can be used to label your files when they are
+   displayed in the playlist.
 
-5) Configure the display of your FileField to use "jPlayer player". If your want
+5) Configure the display of your field to use "jPlayer player". If your want
    to have a multi-file field display as a playlist of songs, you may use the
    "jPlayer multi-file playlist" formatter.
 
Index: jplayer.info
===================================================================
RCS file: /cvs/drupal/contributions/modules/jplayer/jplayer.info,v
retrieving revision 1.1
diff -u -p -r1.1 jplayer.info
--- jplayer.info	1 May 2010 04:28:08 -0000	1.1
+++ jplayer.info	21 Sep 2010 17:29:32 -0000
@@ -3,4 +3,3 @@ name = jPlayer
 description = Provides an HTML5-compatible with Flash-fallback audio player.
 package = User interface
 core = 6.x
-dependencies[] = filefield
Index: jplayer.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/jplayer/jplayer.module,v
retrieving revision 1.3
diff -u -p -r1.3 jplayer.module
--- jplayer.module	27 Jul 2010 13:27:54 -0000	1.3
+++ jplayer.module	21 Sep 2010 17:29:32 -0000
@@ -6,7 +6,7 @@
  * Provides an HTML5-compatible with Flash-fallback audio player.
  *
  * This module provides functionality for loading the jPlayer library and
- * formatters for CCK FileFields.
+ * formatters for CCK FileFields or Embedded media audio (emaudio) fields.
  */
 
 /**
@@ -67,13 +67,13 @@ function jplayer_field_formatter_info() 
   return array(
     'jplayer_single' => array(
       'label' => t('jPlayer player'),
-      'field types' => array('filefield', 'audiofield'),
+      'field types' => array('filefield', 'audiofield', 'emaudio'),
       'multiple values' => CONTENT_HANDLE_CORE,
       'description' => t('Display an audio file as an HTML5-compatible with Flash-fallback audio player.'),
     ),
     'jplayer_playlist' => array(
       'label' => t('jPlayer multifile playlist'),
-      'field types' => array('filefield', 'audiofield'),
+      'field types' => array('filefield', 'audiofield', 'emaudio'),
       'multiple values' => CONTENT_HANDLE_MULTIPLE,
       'description' => t('Display multi-value fields as an HTML5-compatible with Flash-fallback audio player.'),
     ),
@@ -185,3 +185,17 @@ function jplayer_get_version($directory 
 
   return $version;
 }
+
+/**
+ * Return the source URL for an audio file from a given CCK field element.
+ */
+function jplayer_get_source_url($element) {
+  $url = '';
+  if (!empty($element['filepath'])) {
+    $url = file_create_url($element['filepath']);
+  }
+  elseif (!empty($element['embed'])) {
+    $url = $element['embed'];
+  }
+  return $url;
+}
cvs diff: Diffing includes
Index: includes/jplayer.theme.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/jplayer/includes/jplayer.theme.inc,v
retrieving revision 1.2
diff -u -p -r1.2 jplayer.theme.inc
--- includes/jplayer.theme.inc	17 Jun 2010 15:34:52 -0000	1.2
+++ includes/jplayer.theme.inc	21 Sep 2010 17:29:32 -0000
@@ -13,7 +13,7 @@ function template_preprocess_jplayer_for
 
   $vars['mode'] = 'single';
   $vars['item'] = array(
-    'url' => file_create_url($vars['element']['#item']['filepath']),
+    'url' => jplayer_get_source_url($vars['element']['#item']),
     'label' => !empty($vars['element']['#item']['data']['description']) ? $vars['element']['#item']['data']['description'] : $vars['element']['#item']['filename'],
   );
   $vars['player_id'] = 'jplayer-' . $vars['element']['#node']->nid . '-' . str_replace('_', '-', $vars['element']['#field_name']) . '-' . $vars['element']['#item']['#delta'];
@@ -42,7 +42,7 @@ function template_preprocess_jplayer_for
     }
     $vars['items'][] = array(
       'class' => implode(' ', $classes),
-      'url' => file_create_url($vars['element'][$key]['#item']['filepath']),
+      'url' => jplayer_get_source_url($vars['element'][$key]['#item']),
       'label' => !empty($vars['element'][$key]['#item']['data']['description']) ? $vars['element'][$key]['#item']['data']['description'] : $vars['element'][$key]['#item']['filename'],
     );
     $number++;
cvs diff: Diffing theme
