/**
  * Generates the list of flashvars supported by this version of the player along with
  * their defaults.
  * @return A structured array of the flashvars.
  */
 private static function loadPlayerFlashVars()
 {
     $f_vars = array();
     //Load the player xml file.
     $xml = simplexml_load_file(LongTailFramework::$dir . "/player.xml");
     $config_file = LongTailFramework::$current_config_values;
     $config_values = LongTailFramework::getConfigValues();
     //Process the flashvars in the player xml file.
     foreach ($xml->flashvars as $flash_vars) {
         $f_var = array();
         $f_var_section = (string) $flash_vars["section"];
         $f_var_advanced = (string) $flash_vars["type"];
         //Ignore the flashvars categorized as "None."
         if ($f_var_advanced != "None") {
             foreach ($flash_vars as $flash_var) {
                 $default = (string) $flash_var->{"default"};
                 //If the config file was loaded and has an entry for the current flashvar
                 //use the value in the config file.
                 if ($config_file && $config_file->{$flash_var->name}) {
                     unset($config_values[(string) $flash_var->name]);
                     $default = (string) $config_file->{$flash_var->name};
                     $default = str_replace(LongTailFramework::getSkinURL(), "", $default);
                     $default = preg_replace("/(\\.swf|\\.zip)/", "", $default);
                 }
                 $values = (array) $flash_var->select;
                 $val = $values["option"];
                 $type = (string) $flash_var["type"];
                 //Load the possible values for the skin flashvar.
                 if ($flash_var->name == "skin") {
                     $type = "select";
                     $val = array_keys(LongTailFramework::getSkins());
                 }
                 $temp_var = new FlashVar((string) $flash_var->name, $default, (string) $flash_var->description, $val, $type);
                 $f_var[(string) $flash_var->name] = $temp_var;
             }
             $f_vars[$f_var_advanced][$f_var_section] = $f_var;
         }
     }
     unset($config_values["plugins"]);
     unset($config_values["ltas.cc"]);
     LongTailFramework::getPlugins($config_values);
     if ($config_values) {
         LongTailFramework::$loaded_additional_flash_vars = LongTailFramework::flattenAdditionalFlashVars($config_values);
     }
     LongTailFramework::$loaded_flash_vars = $f_vars;
 }