Migrate JWPlayer customization to Omeka 2.1.1

I'm trying to upgrade from Omeka 1.5 to 2.1.1 and everything has gone smoothly with the exception of integrating JWPlayer for embedding uploaded media into my items/show pages.

I should note that I'm pretty new to Omeka and have "inherited" the 1.5 site. So these customizations are not my own. I may be missing something simple...

On the current 1.5 site the file "application/helpers/media.php" has been customized as follows:

...
class Omeka_View_Helper_Media
{
    /**
     * Array of MIME types and the callbacks that can process it.
     *
     * Example:
     * array('video/avi'=>'wmv');
     *
     * @var array
     */
    static protected $_callbacks = array(
        'application/ogg'   => 'ogg',
        'audio/ogg'         => 'ogg',
        'audio/x-ogg'       => 'ogg',
        'audio/aac'         => 'aac',
        'audio/x-aac'       => 'aac',
        'audio/aiff'        => 'aiff',
        'audio/x-aiff'      => 'aiff',
        'audio/midi'        => 'midi',
        'audio/x-midi'      => 'midi',
        'audio/mp3'         => 'jwplayera',
        'audio/mpeg'        => 'jwplayera',
        'audio/mpeg3'       => 'jwplayera',
        'audio/mpegaudio'   => 'jwplayera',
        'audio/mpg'         => 'jwplayera',
        'audio/x-mp3'       => 'mp3',
        'audio/x-mpeg'      => 'mp3',
        'audio/x-mpeg3'     => 'mp3',
        'audio/x-mpegaudio' => 'mp3',
        'audio/x-mpg'       => 'mp3',
        'audio/mp4'         => 'mp4',
        'audio/x-mp4'       => 'mp4',
        'audio/wav'         => 'wav',
        'audio/x-wav'       => 'wav',
        'image/bmp'         => 'image',
        'image/gif'         => 'image',
        'image/jpeg'        => 'image',
        'image/jpg'         => 'image',
        'image/pjpeg'       => 'image',
        'image/png'         => 'image',
        'image/tif'         => 'image',
        'image/tiff'        => 'image',
        'image/x-ms-bmp'    => 'image',
        'video/mp4'         => 'jwplayerv',
        'video/mpeg'        => 'mov',
        'video/ogg'         => 'mov',
        'video/quicktime'   => 'jwplayerv',
        'audio/wma'         => 'wma',
        'audio/x-ms-wma'    => 'wma',
        'video/avi'         => 'wmv',
        'video/msvideo'     => 'wmv',
        'video/x-msvideo'   => 'wmv',
        'video/x-flv'       => 'jwplayerv',
        'video/x-ms-wmv'    => 'wmv',
      /**  'video/x-ms-wmv'    => 'wmv', **/
    );...

... public function jwplayerv($file,array $options=array())
    {
        $path = html_escape($file->getWebPath('archive'));
        $fileName = item_file('Original Filename', null, array(), $file);
        $html = "\n\n".'<!-- Start of embedded code -->'."\n"
              .'<script type="text/javascript" src="'.WEB_ROOT.'/jwplayer/jwplayer.js"></script>'
              . '<video src="'.$path.'" '
              . 'height="240" width="320" '
              . 'id="'.$fileName.'"> </video>'
              . '<script type="text/javascript"> jwplayer("'.$fileName.'").setup({flashplayer: "'.WEB_ROOT.'/jwplayer/player.swf"}); </script>'."\n"
              . '<!-- End of embedded code -->'."\n\n";
              /*. '<a href="'.$path.'">'.$fileName.'</a>';*/
        return $html;
    }

    public function jwplayera($file,array $options=array())
    {
        $path = html_escape($file->getWebPath('archive'));
        $fileName = item_file('Original Filename', null, array(), $file);
        $html = "\n\n".'<!-- Start of embedded code -->'."\n"
              .'<script type="text/javascript" src="'.WEB_ROOT.'/jwplayer/jwplayer.js"></script>'
              . '<audio src="'.$path.'" '
              . 'height="23" width="320" '
              . 'id="'.$fileName.'"> </audio>'
              . '<script type="text/javascript"> jwplayer("'.$fileName.'").setup({flashplayer: "'.WEB_ROOT.'/jwplayer/player.swf", controlbar:"bottom"}); </script>'."\n"
              . '<!-- End of embedded code -->'."\n\n";
              /*. '<a href="'.$path.'">'.$fileName.'</a>';*/
        return $html;
    }
...

Although "application/helpers" does not seem to exist in 2.1.1, it seemed like "application/views/helpers" would be equivalent. So I tried simply adding the file to this dir. As you may have guessed, this was not helpful.

So my question is - in 2.1.1, where / how should this code be included in order to embed attached files of the specified MIME types on both "admin/items/show" and "items/show pages".

Notes:

*I've tried using the HTML5 Media plugin and it works great... except that I need to be able to embed my media into other websites. JWPlayer produces a nice block of code that can easily be pasted into other sites.

*Other methods of integrating JWPlayer or equivalent are welcome as well. I'm looking for maximum file type and browser compatibility.

Your best move is probably to write this as a plugin instead.

The add_file_display_callback function lets you register a callback function for given MIME types and/or file extensions. You can call that in an initialize hook and register your jwplayerv and jwplayera functions (which would also move to the plugin).

There's a few immediately-obvious relevant differences in 2.0 that mean your actual display functions need tweaking: getWebPath('archive') is now just getWebPath(), and item_file() is now metadata().