diff --git xspf_playlist.module xspf_playlist.module
index b4315da..0c1c8b2 100644
--- xspf_playlist.module
+++ xspf_playlist.module
@@ -107,21 +107,6 @@ function xspf_playlist_form_node_type_form_alter(&$form, &$form_state) {
     '#description' => t('Image files in a playlist need to have a duration (in seconds) for which they are shown.'),
   );
 
-  // Get all the thumbnail sources
-  $sources = array();
-  drupal_alter('xspf_node_thumb_sources', $sources, $content_type);
-  $form['xspf_playlists']['thumbnails'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Select Thumbnails Files'),
-  );
-  $form['xspf_playlists']['thumbnails']['xspf_node_thumb_sources'] = array(
-    '#title' => t('Thumbnail field Types'),
-    '#type' => 'select',
-    '#options' => $sources,
-    '#multiple' => true,
-    '#default_value' => variable_get('xspf_node_thumb_sources_'. $content_type, ''),
-    '#description' => t('Select the thumbnail type you would like to use. You can select multiple, but if multiple thumbnails for an item exist, the first one found will be used.'),
-  );
 }
 
 
@@ -131,7 +116,7 @@ function xspf_playlist_form_node_type_form_alter(&$form, &$form_state) {
 
 
 /**
- * Implements hook_xspf_file_sources().
+ * Implements hook_xspf_node_file_sources().
  *
  * @param unknown_type $soures
  * @param unknown_type $type
@@ -143,18 +128,6 @@ function xspf_playlist_xspf_node_file_sources_alter(&$sources, $content_type) {
 
 
 /**
- * Implements hook_xspf_thumb_sources().
- *
- * @param unknown_type $soures
- * @param unknown_type $type
- */
-function xspf_playlist_xspf_node_thumb_sources_alter(&$sources, $content_type) {
-  // These are the default source modules that this module implements
-  xspf_playlist_sources($sources, $content_type);
-}
-
-
-/**
  * Implements hook_xspf_node_items_alter()
  *
  * @param object $node is a drupal node object
@@ -179,70 +152,6 @@ function xspf_playlist_xspf_node_items_alter(&$items, $node) {
   }
 }
 
-
-/**
- * Implementation of hook_xspf_playlist_item_alter().
- *
- * Add the thumbnail into the playlist. All thumbnails for the specified
- * node are loaded and cached locally. If a node has multiple entries,
- * a new thumbnail will be used for each item until there are no thumbnails
- * left. At this point the first thumbnail will be repeated.
- *
- * @param array $item
- * @param object $node
- */
-function xspf_playlist_xspf_node_playlist_item_alter(&$item, $node) {
-  $thumbs = array();
-  // Have we loaded the thumbs for this node before?
-  static $nodes = array();
-
-  if (! $thumbs = $nodes[$node->nid]) {
-    // Get the enabled sources
-    $enabled_sources = variable_get('xspf_node_thumb_sources_'. $node->type, NULL);
-    // Get the sources defined by this module
-    $sources = array();
-    xspf_playlist_sources($sources, $node->type);
-    foreach ($sources as $source_id => $source_key) {
-      if (in_array($source_id, $enabled_sources)) {
-        list(, $type, $identifier) = explode('--' ,$source_id);
-        $function = 'xspf_playlist_node_thumb_' . $type;
-        if (function_exists($function)) {
-          // Includes were already loaded in xspf_playlist_sources();
-          $function($thumbs, $node, $identifier);
-        }
-      }
-    }
-
-    // Did we find any thumbnails?
-    if ($thumbs) {
-      // Store our thumbnails
-      $nodes[$node->nid]['thumbs'] = $thumbs;
-      $nodes[$node->nid]['count'] = 0;
-    }
-    else {
-      // Nothing to do
-      return;
-    }
-  }
-
-  // Set the count to the number of thumbnails used
-  $count = $nodes[$node->nid]['count'];
-  // Increment the counter
-  $nodes[$node->nid]['count']++;
-
-  // If we do not have enough thumbnails use the first thumbnail
-  if ($count > count($thumbs)) {
-    $count = 0;
-  }
-
-  // Add the image to our playlist
-  $data = array(
-    'key' => 'image',
-    'value' => xspf_playlist_url($nodes[$node->nid]['thumbs'][$count])
-  );
-  xspf_playlist_item_set_value($item, $data);
-}
-
 /* ******************************************************* */
 /* Internal Functions                                      */
 /* ******************************************************* */
@@ -532,3 +441,28 @@ function xspf_playlist_playlist_header_default() {
   );
   return $configuration;
 }
+
+/**
+ * integrate XSPF with the flvmediaplayer module to provide urls
+ * @param string $op is the operation being called
+ * @param string $name is the action name being called
+ * @param array $config is an array of configuration values
+ */
+function xspf_playlist_flvmediaplayer_file_use($op, $name = NULL, $node = NULL, $config = NULL) {
+  switch ($op) {
+    case 'define':
+      return array('xspf_playlist--1' => t('XSPF Playlist for each node'));
+    break;
+    case 'file':
+      // make sure that there are files for this node
+      if (variable_get('xspf_playlist_enabled_type_' . $node->type, FALSE)) {
+        $items = array();
+        // this library is needed as it is only loaded when accessing by the menu
+        include_once(drupal_get_path('module', 'xspf_playlist') . '/includes/xspf_playlist.node.inc');
+        drupal_alter('xspf_node_items', $items, $node);
+        // Do we have anything to display?
+        return $items ? xspf_playlist_url('node/'. $node->nid .'/xspf') : '';
+      }
+    break;
+  }
+}
diff --git xspf_playlist_audio/xspf_playlist_audio.info xspf_playlist_audio/xspf_playlist_audio.info
deleted file mode 100644
index f7a3f84..0000000
--- xspf_playlist_audio/xspf_playlist_audio.info
+++ /dev/null
@@ -1,15 +0,0 @@
-; $Id: xspf_playlist_audio.info,v 1.1.2.2.2.1 2008/12/14 18:37:12 arthuregg Exp $
-name = "XSPF Playlist Audio"
-description = "Integrates Audio Module files with XSPF Playlists."
-package = "Media"
-dependencies[] = xspf_playlist
-dependencies[] = audio
-
-
-core = 6.x
-; Information added by drupal.org packaging script on 2010-11-12
-version = "6.x-2.x-dev"
-core = "6.x"
-project = "xspf_playlist"
-datestamp = "1289565118"
-
diff --git xspf_playlist_audio/xspf_playlist_audio.module xspf_playlist_audio/xspf_playlist_audio.module
deleted file mode 100644
index 4d26e3a..0000000
--- xspf_playlist_audio/xspf_playlist_audio.module
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-// $Id: xspf_playlist_audio.module,v 1.1.2.1.2.1.2.1 2010/08/24 18:38:51 arthuregg Exp $
-
-/**
- * @FILE This module provides integration with the Audio module with XSPF playlists
- *
- */
-
-/**
-* implemenation of hook_xspf_playlist_use
-* @param string $op
-* @param object $node
-* @param array $config
-*/
-function xspf_playlist_audio_use($op, $node, $config) {
-  switch($op) {
-    case 'define' :
-        $define['audio--1'] = t('Use audio node file');
-      return $define;
-    break;
-
-    case 'return':
-      if ($config == 1) {
-        if ($item = xspf_playlist_create_file_item($node, xspf_playlist_url($node->audio_file->filepath))) {
-          $items[] =  $item;
-          return $items;
-        }
-      }
-   break;
-  }
-}
\ No newline at end of file
diff --git xspf_playlist_cck/xspf_playlist_cck.info xspf_playlist_cck/xspf_playlist_cck.info
deleted file mode 100644
index 9fca44e..0000000
--- xspf_playlist_cck/xspf_playlist_cck.info
+++ /dev/null
@@ -1,13 +0,0 @@
-; $Id: xspf_playlist_cck.info,v 1.1.2.1.2.3.2.1 2010/10/12 21:04:37 aaron Exp $
-name = "XSPF Playlist CCK"
-description = "Integrates CCK fields with XSPF Playlists."
-package = "Media"
-dependencies[] = xspf_playlist
-dependencies[] = content
-core = 6.x
-; Information added by drupal.org packaging script on 2010-11-12
-version = "6.x-2.x-dev"
-core = "6.x"
-project = "xspf_playlist"
-datestamp = "1289565118"
-
diff --git xspf_playlist_cck/xspf_playlist_cck.module xspf_playlist_cck/xspf_playlist_cck.module
deleted file mode 100644
index 1c9b64a..0000000
--- xspf_playlist_cck/xspf_playlist_cck.module
+++ /dev/null
@@ -1,160 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @FILE This module provides integration with the CCK module with XSPF playlists.
- *       Provides support for image fields, text, video_cck, and emfield.
- *
- */
-
-
-/* ********************************************** */
-/* XSPF HOOKS                                     */
-/* ********************************************** */
-
-/**
- * Implements hook_xspf_node_file_sources_alter().
- *
- * @param $sources
- *   Array, set of sources that this node can use
- * @param $content_type
- *   String, node content type
- */
-function xspf_playlist_cck_xspf_node_file_sources_alter(&$sources, $content_type) {
-  // Get the fields for this content type
-  $type = content_types($content_type);
-  if ($fields = $type['fields']) {
-    foreach ($fields as $field) {
-      if (in_array($field['type'], array('text', 'image', 'filefield', 'file_video', 'video_cck', 'emvideo'))) {
-        $sources[$field['field_name']] = t('CCK: !label', array('!label' => $field['widget']['label']));
-      }
-    }
-  }
-}
-
-
-/**
- * Implements hook_xspf_node_items_alter()
- *
- * @param object $node is a drupal node object
- * @param int $limit
- * @return array of item arrays
- */
-function xspf_playlist_cck_xspf_node_items_alter(&$items, $node) {
-  // Get the types of file sources
-  $sources = variable_get('xspf_playlist_node_file_sources_' . $node->type, array());
-  // Get the fields for this content type
-  $type = content_types($node->type);
-  if ($fields = $type['fields']) {
-    foreach ($fields as $field) {
-      // Is this field enabled?
-      if (in_array($field['field_name'], $sources)) {
-        // Get the handler function
-        $function = 'xspf_playlist_cck_'. $field['type'] .'_handler';
-        if (function_exists($function)) {
-          $function($items, $node, $field['field_name']);
-        }
-      }
-    }
-  }
-}
-
-
-/**
- * Handles the emfield video field type
- *
- * @param $items
- * @param $node
- * @param $field_name
- */
-function xspf_playlist_cck_video_cck_handler(&$items, $node, $field_name) {
-  $items = array();
-  // extract all the embeded items from this field
-  foreach ($node->{$field_name} as $field) {
-    if ($field['data']['flash']['url']) {
-      if ($xspf_item = xspf_playlist_build_file_item($node, $field['data']['flash']['url'])) {
-        $items[] = $xspf_item;
-      }
-    }
-  }
-}
-
-
-/**
- * Handles the image field type
- *
- * @param $items
- * @param $node
- * @param $field_name
- */
-function xspf_playlist_cck_image_handler(&$items, $node, $field_name) {
-  $items = array();
-  // extract all the embeded items from this field
-  foreach ($node->{$field_name} as $field) {
-    if ($field['filepath']) {
-      if ($xspf_item = xspf_playlist_build_file_item($node, $field['filepath'])) {
-        $items[] = $xspf_item;
-      }
-    }
-  }
-}
-
-
-/**
- * Handles the text field type
- *
- * @param $items
- * @param $node
- * @param $field_name
- */
-function xspf_playlist_cck_text_handler(&$items, $node, $field_name) {
-  $items = array();
-  // extract all the embeded items from this field
-  foreach ($node->{$field_name} as $field) {
-    if ($field['value']) {
-      if ($xspf_item = xspf_playlist_build_file_item($node, $field['value'])) {
-        $items[] = $xspf_item;
-      }
-    }
-  }
-}
-
-
-/**
- * Handles the file field type
- *
- * @param $items
- * @param $node
- * @param $field_name
- */
-function xspf_playlist_cck_filefield_handler(&$items, $node, $field_name) {
-  $items = array();
-  // extract all the embeded items from this field
-  foreach ($node->{$field_name} as $field) {
-    if ($field['filepath']) {
-      if ($xspf_item = xspf_playlist_build_file_item($node, file_create_url($field['filepath']))) {
-        $items[] = $xspf_item;
-      }
-    }
-  }
-}
-
-
-/**
- * Handles the Embedded Video Field (emfield) type
- *
- * @param $items
- * @param $node
- * @param $field_name
- */
-function xspf_playlist_cck_emvideo_handler(&$items, $node, $field_name) {
-  $items = array();
-  // extract all the embeded items from this field
-  foreach ($node->{$field_name} as $field) {
-    if ($field['value'] && $field['provider']) {
-      if ($xspf_item = xspf_playlist_build_file_item($node, emfield_include_invoke('emvideo', $field['provider'], 'embedded_link', $field['value'], $field['data']))) {
-        $items[] = $xspf_item;
-      }
-    }
-  }
-}
diff --git xspf_playlist_thumb/xspf_playlist_thumb.module xspf_playlist_thumb/xspf_playlist_thumb.module
index 1c61f71..22cdd48 100644
--- xspf_playlist_thumb/xspf_playlist_thumb.module
+++ xspf_playlist_thumb/xspf_playlist_thumb.module
@@ -29,7 +29,7 @@ function xspf_playlist_thumb_form_node_type_form_alter(&$form, $form_state) {
     '#type' => 'select',
     '#options' => $fields,
     '#multiple' => true,
-    '#default_value' => variable_get('xspf_thumb_types_'. $type, ''),
+    '#default_value' => variable_get('xspf_thumb_types_'. $type, 'xspf_playlist_thumb--1'),
     '#description' => t('Select the thumbnail type you would like to use. You can select multiple, but if multiple thumbnails for an item exist, the first one found will be used.'),
   );
 
@@ -53,27 +53,24 @@ function xspf_playlist_thumb_form_node_type_form_alter(&$form, $form_state) {
 /* ******************************************************* */
 
 /**
- * Implementation of hook_xspf_playlist_item_alter().
+ * Implementation of hook_xspf_node_playlist_item_alter().
  * Add the thumbnail into the playlist
  *
  * Add player and bookmark metadata.
  * @param array $item
  * @param object $node
- * @param string $url
- * @param string $thumb
- * @param $meta
  */
-function xspf_playlist_thumb_xspf_playlist_item_alter(&$item, $node, $url) {
+function xspf_playlist_thumb_xspf_node_playlist_item_alter(&$item, $node) {
   // Look for modules that return potential thumbs.
   $modules = variable_get('xspf_thumb_types_'. $node->type, false);
   if ($modules) {
-    foreach ($modules as $module) {
+    foreach ($modules as $id => $module) {
       // split the name into parts
-      list($module_name, $separator, $config) = split('[--]', $module);
+      list($module_name, $config) = explode('--', $module);
       // invoke the thumbnail hook
       if (module_exists($module_name)) {
         $thumb = module_invoke($module_name, 'xspf_playlist_thumbnail', 'return', $node, $config);
-        if (isset($thumb)) {
+        if ($thumb) {
           // Some modules may pass back an array. Only take the first item
           if (is_array($thumb)) {$thumb = $thumb[0]; }
           // We're only returning the specified thumb.
@@ -85,7 +82,6 @@ function xspf_playlist_thumb_xspf_playlist_item_alter(&$item, $node, $url) {
   }
 }
 
-
 /**
  * implements hook_xspf_playlist_thumbnail
  * build the default options for the admin screen
@@ -119,7 +115,7 @@ function xspf_playlist_thumb_xspf_playlist_thumbnail($op, $node, $config = null)
       $form['xspf_thumb_default'] = array(
         '#type' => 'textfield',
         '#title' => t('Path to default thumbnail'),
-        '#default_value' => variable_get('xspf_thumb_default_'. $node, null),
+        '#default_value' => variable_get('xspf_thumb_default_'. $node, NULL),
         '#description' => t('Enter a path to a thumbnail you wish to use as a default'),
         '#prefix' => '<div id="xspf_playlist_thumb--4_config" class="xspf_playlist_config_thumb">',
         '#suffix' => '</div>',
@@ -128,7 +124,7 @@ function xspf_playlist_thumb_xspf_playlist_thumbnail($op, $node, $config = null)
     break;
 
     case 'return':
-      switch ($config){
+      switch ($config) {
         case 1:
           return;
         break;
@@ -136,11 +132,11 @@ function xspf_playlist_thumb_xspf_playlist_thumbnail($op, $node, $config = null)
           return xspf_playlist_thumb_get_attached_files($node);
         break;
         case 3:
-          return xspf_playlist_thumb_get_cck_filefield_files($node, variable_get('xspf_thumb_cck_filefield_'. $node->type, null));
+          return xspf_playlist_thumb_get_cck_filefield_files($node, variable_get('xspf_thumb_cck_filefield_'. $node->type, NULL));
         break;
         case 4:
           // return default thumbnail
-          return variable_get('xspf_thumb_default_'. $node->type, null);
+          return variable_get('xspf_thumb_default_'. $node->type, NULL);
         break;
       }
     break;
@@ -168,12 +164,12 @@ function xspf_playlist_thumb_get_attached_files($node) {
     $thumbs = array();
     foreach($node->files as $file) {
       // check the mime type of the file
-      if (strstr($file->filemime, 'image')) {
-        $thumbs[] = $file->filepath;
+      if (strstr($file->filemime, 'image') && isset($file->filepath)) {
+        $thumbs[] = file_create_url($file->filepath);
       }
     }
-  return isset($thumbs) ? $thumbs : '';
   }
+  return isset($thumbs) ? $thumbs : '';
 }
 
 /**
@@ -188,10 +184,12 @@ function xspf_playlist_thumb_get_cck_filefield_files($node, $field_name) {
   if (isset($node->{$field_name})) {
     $thumbs = array();
     foreach ($node->{$field_name} as $field) {
-      $thumbs[] = file_create_url($field['filepath']);
+      if (isset($field['filepath'])) {
+        $thumbs[] = file_create_url($field['filepath']);
+      }
     }
-  return isset($thumbs) ? $thumbs : '';
   }
+  return isset($thumbs) ? $thumbs : '';
 }
 
 /**
@@ -208,8 +206,8 @@ function xspf_playlist_thumb_cck_fields($content_type) {
           $return[$field['field_name']] .=  t('CCK !type: !name', array('!type' => $field['type'], '!name' => $field['widget']['label']));
       }
     }
-    return $return;
   }
+  return isset($return) ? $return : '';
 }
 
 /* ******************************************************** */
@@ -323,6 +321,7 @@ function xspf_playlist_thumb_delete($type, $id = NULL, $vid = NULL) {
  *   - thumbnail_path: The path to a file representing the playlist
  *     item's thumbnail image.
  */
+/*
 function xspf_playlist_thumb_load($item) {
 
   // At a minimum, test for a given type.
@@ -344,7 +343,7 @@ function xspf_playlist_thumb_load($item) {
   }
   return db_fetch_array(db_query('SELECT * FROM {xspf_playlist_thumb} WHERE ' . implode(' AND ', $conditions), $parameters));
 }
-
+*/
 
 /**
  * @TODO need to figure out if this is going to be supported
diff --git xspf_playlist_upload/xspf_playlist_upload.info xspf_playlist_upload/xspf_playlist_upload.info
deleted file mode 100644
index 4c70b02..0000000
--- xspf_playlist_upload/xspf_playlist_upload.info
+++ /dev/null
@@ -1,13 +0,0 @@
-; $Id: xspf_playlist_upload.info,v 1.1.2.1 2010/08/25 18:48:20 arthuregg Exp $
-name = "XSPF Playlist Upload"
-description = "Generates an XSPF playlist from node uploads."
-package = "Media"
-dependencies[] = xspf_playlist
-dependencies[] = upload
-core = 6.x
-; Information added by drupal.org packaging script on 2010-11-12
-version = "6.x-2.x-dev"
-core = "6.x"
-project = "xspf_playlist"
-datestamp = "1289565118"
-
diff --git xspf_playlist_upload/xspf_playlist_upload.install xspf_playlist_upload/xspf_playlist_upload.install
deleted file mode 100644
index 8cdfbd2..0000000
--- xspf_playlist_upload/xspf_playlist_upload.install
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-// $Id: xspf_playlist_upload.install,v 1.1.2.1 2010/08/25 18:48:20 arthuregg Exp $
-
-/**
- * Implementation of hook_uninstall().
- *
- * Remove variables handled by this module.
- */
-function xspf_playlist_upload_uninstall() {
-  // Clean up variables set by content type.
-  $types = _node_types_build();
-  if ($enabled_types = array_filter(variable_get('xspf_playlist_upload_types', FALSE))) {
-    foreach ($enabled_types as $type) {
-      $variables[] = 'xspf_' . $type . '_use';
-      $variables[] = 'xspf_playlist_'. $type .'_fields';
-      $variables[] = 'xspf_'. $type .'_thumb';
-      $variables[] = 'xspf_'. $type .'_thumb_first';
-    }
-  }
-  foreach ($variables as $name) {
-    variable_del($name);
-  }
-}
diff --git xspf_playlist_upload/xspf_playlist_upload.module xspf_playlist_upload/xspf_playlist_upload.module
deleted file mode 100644
index 6c9c959..0000000
--- xspf_playlist_upload/xspf_playlist_upload.module
+++ /dev/null
@@ -1,337 +0,0 @@
-<?php
-
-// $Id: xspf_playlist_upload.module,v 1.1.2.1 2010/08/25 18:48:20 arthuregg Exp $
-
-/**
- * @FILE provides content level integration for XSPF
- */
-
-
-/* ********************************************** */
-/* DRUPAL HOOKS                                   */
-/* ********************************************** */
-
-/**
- * Implementation of hook_menu().
- */
-function xspf_playlist_upload_menu() {
-  $items = array();
-
-  // Display a xspf playlist per node
-  $items['node/%node/xspf'] = array(
-    'page callback' => 'xspf_playlist_upload_view',
-    'page arguments' => array(1),
-    'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
-  );
-
-  // Allow users to edit xspf playlists
-  $items['node/%node/edit/xspf'] = array(
-    // @TODO build function
-    'page callback' => 'xspf_playlist_upload_edit',
-    'page arguments' => array(1),
-    // @TODO figure out access
-    'access arguments' => array('access content', 'build playlist on node'),
-    'type' => MENU_LOCAL_TASK,
-  );
-
-  return $items;
-}
-
-
-/**
- * Implementation of hook_perm().
- * @return array
- */
-function xspf_playlist_upload_perm() {
-  return array('build playlist on node');
-}
-
-
-/**
- * Implementation of hook_form_alter().
- * Display a playlist builder on the node edit form and add configuration fields
- * to the XSPF Playlist admin settings form.
- *
- * @param string $form_id
- * @param array $form
- */
-function xspf_playlist_upload_form_node_type_form_alter(&$form, &$form_state) {
-  // Get the current content type
-  $content_type = $form['#node_type']->type;
-  // Build the name of this variable
-  $variable_name = 'xspf_playlist_upload_enabled_type';
-
-  // modify the main XSPF form
-  $form['xspf_playlists'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('XSPF Playlists'),
-    '#collapsible' => TRUE,
-    '#collapsed' => variable_get($variable_name .'_'. $content_type, FALSE) ? FALSE : TRUE,
-  );
-
-  $form['xspf_playlists'][$variable_name] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Enabled'),
-    '#default_value' => variable_get($variable_name .'_'. $content_type, FALSE),
-    '#description' => t('Enable XSPF playlists on this content type'),
-  );
-
-  $form['xspf_playlists']['content'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Select playlist files'),
-  );
-  // Select what options will be used to build the playlist
-  $sources = array();
-  drupal_alter('xspf_node_file_sources', $sources, $content_type);
-  $form['xspf_playlists']['content']['xspf_playlist_upload_file_sources'] = array(
-    '#type' => 'select',
-    '#multiple' => TRUE,
-    '#title' => t('Build playlist files with'),
-    '#options' => $sources,
-    '#default_value' => variable_get('xspf_playlist_upload_file_sources_' . $content_type, array()),
-    '#description' => t('XSPF playlist will build a playlist from files associated with the items that you have selected.'),
-  );
-
-  // Add any config items that we've got
-  // make an artifical node
-  $my_node = new stdClass();
-  $my_node->type = $content_type;
-  foreach (variable_get('xspf_'. $content_type .'_use', array()) as $extension) {
-    $form['xspf_playlists']['content'][] =  xspf_playlist_invoke_fire('xspf_playlist_use', 'config', $my_node, $extension);
-  }
-
-  $form['xspf_playlists']['playlists'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Playlist Settings'),
-  );
-
-  // settings for item duration. Images need duration tags so that they rotate in the playlist
-  $options = array_values(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30));
-  $form['xspf_playlists']['playlists']['xspf_playlist_duration'] = array(
-    '#type' => 'select',
-    '#title' => t('Image duration'),
-    '#options' => $options,
-    '#default_value' => variable_get('xspf_playlist_duration_'. $content_type, 10),
-    '#description' => t('Image files in a playlist need to have a duration (in seconds) for which they are shown.'),
-  );
-
-}
-
-
-
-/* ********************************************** */
-/* XSPF HOOKS                                     */
-/* ********************************************** */
-
-
-/**
- * Implements hook_xspf_file_sources().
- *
- * @param unknown_type $soures
- * @param unknown_type $type
- */
-function xspf_playlist_upload_xspf_node_file_sources_alter(&$sources, $content_type) {
-  // Can we use Drupal's file attachments?
-  if (module_exists('upload')) {
-    $sources['upload'] = t('Drupal file attachments');
-  }
-}
-
-
-/**
- * Implements hook_xspf_node_items_alter()
- *
- * @param object $node is a drupal node object
- * @param int $limit
- * @return array of item arrays
- */
-function xspf_playlist_upload_xspf_node_items_alter(&$items, $node) {
-  // Get the types of file sources
-  $sources = variable_get('xspf_playlist_upload_file_sources_' . $node->type, array());
-  if (in_array('upload', $sources)) {
-    xspf_playlist_upload_get_attached_files($items, $node);
-  }
-}
-
-
-/* ******************************************************* */
-/* INTERNAL FUNCTIONS */
-/* ******************************************************* */
-
-
-/**
- * Landing page for producing the XSPF data for a given node- node/X/xspf
- *
- * @param $node
- *   Object, Drupal node
- * @return string
- *   XSPF XML
- */
-function xspf_playlist_upload_view($node) {
-  // Are playlists enabled on this node type?
-  if (variable_get('xspf_playlist_upload_enabled_type_' . $node->type, FALSE)) {
-    $items = array();
-    drupal_alter('xspf_node_items', $items, $node);
-    // Do we have anything to display?
-    if ($items) {
-      xspf_playlist_render($items);
-    }
-  }
-  // No content found.
-  return drupal_not_found();
-}
-
-
-/**
- * Finds files and adds them as items
- *
- * @param $items
- *   Array,
- * @param $node
- *   Object, Drupal node
- * @return array of items
- */
-function xspf_playlist_upload_get_attached_files(&$items, $node) {
-  // Loop through files
-  if (isset($node->files)) {
-    foreach ($node->files as $file) {
-      if ($item = xspf_playlist_upload_build_file($file, $node)) {
-        $items[] = $item;
-      }
-    }
-  }
-}
-
-
-/**
- * Create a generic item from a Drupal file and node
- *
- * @param $file
- * @param $node
- * @return xspf item
- */
-function xspf_playlist_upload_build_file($file, $node) {
-  // Is this file type supported?
-  if (xspf_playlist_filetype_supported($file->filepath)) {
-    // Create the item
-    $item = xspf_playlist_build_file_item($node, file_create_url($file->filepath));
-    // Set the title to the file name description only if it is different than
-    // the file name to force the description to be human set
-    if (isset($file->description) && ($file->description != $file->filename )) {
-      xspf_playlist_item_set_value($item, array('key' => 'title', 'value' => check_plain($file->description)), FALSE);
-    }
-    // Get the mime type for this file
-    $mime = file_get_mimetype($file->filepath);
-    $mime = explode('/', $mime);
-    $mime = $mime[0];
-    // Is this a useable type?
-    if (in_array($mime, array('image', 'video', 'audio'))) {
-      xspf_playlist_item_set_value($item, array('key' => 'type', 'value' => $mime));
-    }
-    return $item;
-  }
-}
-
-
-/* ******************************************************* */
-/* SETTINGS                                                */
-/* ******************************************************* */
-
-/**
- * builds the options for a node to choose thumbnails per file
- * @param array $form is a drupal form array
- */
-function xspf_playlist_upload_builder(&$form) {
-  // get all the thumbs
-  $thumbs = xspf_playlist_upload_thumbs($form['#node']);
-  // make it obvious that we've got thumbnails
-  $form['xspf_thumbnails'] = array(
-    '#type' => 'value',
-    '#value' => $thumbs,
-  );
-  $form['xspf_playlist'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Playlist builder'),
-    '#description' => t('You can define options for the playlist (if any) on this node here'),
-    '#collapsible' => TRUE,
-    '#collapsed' => FALSE,
-  );
-  // get all the files for this node
-  $items = xspf_playlist_upload_get_files_from_node($form['#node']);
-  $form['xspf_thumbnails_items'] = array(
-    '#type' => 'value',
-    '#value' => $items,
-  );
-  foreach($items as $xid => $item) {
-    $file = pathinfo(_xspf_playlist_item_get_value($item, 'location'));
-    $form['xspf_playlist']['xspf_playlist_thumb_'. $xid] = array(
-      '#type' => 'select',
-      '#title' => $file['basename'],
-      '#options'  => $thumbs,
-      // Find default from the thumb if already set.
-      '#default_value' => array_search(_xspf_playlist_item_get_value($item, 'image'), $thumbs),
-      '#description' => t('Select a thumbnail for this file.'),
-      '#attributes' => array('class' => 'xspf_thumb_select'),
-    );
-
-    $form['xspf_playlist']['xspf_'. $xid] = array(
-      '#type' => 'markup',
-      '#value' => theme('xspf_playlist_thumbnailer_picker', $thumbs, $xid),
-    );
-  }
-}
-
-
-/**
- * Build a list of content type names, either enabled types or all types
- * @param $enabled
- *   boolean FALSE returns all types; TRUE returns only enabled modules
- * @return array
- */
-function xspf_playlist_upload_content_type_names($enabled = FALSE) {
-  static $content_types, $return_types;
-
-  if (! $content_types) {
-    // get all the content types and put them into an array
-    $types = _node_types_build();
-    foreach($types[0] as $type){
-      $content_types[$type->type] = $type->name;
-    }
-  }
-
-  if (! $enabled) {
-    return $content_types;
-  }
-
-  if (! $return_types) {
-    $return_types = array();
-    // get the enabled content types
-    $node_types = variable_get('xspf_playlist_upload_types', array());
-    foreach ($node_types as $node_type) {
-      $return_types[$node_type] = $content_types[$node_type];
-    }
-  }
-  return $return_types;
-}
-
-
-/**
- * integrate XSPF with the flvmediaplayer module to provide urls
- * @param string $op is the operation being called
- * @param string $name is the action name being called
- * @param array $config is an array of configuration values
- */
-function xspf_playlist_upload_flvmediaplayer_file_use($op, $name = NULL, $node = NULL, $config = NULL) {
-  switch ($op) {
-    case 'define':
-      return array('xspf_playlist_upload--1' => t('XSPF Playlist for each node'));
-    break;
-    case 'file':
-      // make sure that there are files for this node
-      if (xspf_playlist_upload_items($node)) {
-        return xspf_playlist_url('node/'. $node->nid .'/xspf');
-      }
-    break;
-  }
-}
