Notice: Undefined variable: player_type in jplayer_sort_files() (line 195 of /.../sites/all/modules/jplayer/includes/jplayer.theme.inc).

I manually changed the jPlayer module from the theme you provided to Pink Flag (from the jPlayer website).
http://www.jplayer.org/latest/jPlayer.Pink.Flag.2.1.0.zip

When navigating into a node, I get the error above.

WORKAROUND:

Modify includes/jplayer.theme.inc near line 185 as follows:

  if ($type == 'single') {
    $item = array_shift($playlist);
    $playlist = array();
    $playlist[] = $item;
  }

//CUSTOM - BEGIN
if (!isset($player_type)){
    $player_type="";
}
//CUSTOM - END

  return array('files' => $files, 'extensions' => implode(',', $extensions), 'playlist' => $playlist, 'type' => $player_type);
}

Thank you for the great module. I really appreciate all of your work.

Comments

marco_cruz’s picture

Thanks a lot!

webadpro’s picture

For the best solution, I would say please view: http://drupal.org/node/1192826

Z2222’s picture

Why is the other solution better?

(This one worked for me.)

scito’s picture

Status: Active » Closed (duplicate)

Marking this as duplicate of #1192826: Undefined variable: player_type in jplayer_sort_files() since this is issue is older and has a more complete patch.