*** videojs.tpl.php.orig	2010-10-31 09:49:36.000000000 -0400
--- videojs.tpl.php	2010-12-01 16:05:26.000000000 -0500
***************
*** 6,25 ****
   */
  ?>
   <!-- Begin VideoJS -->
    <div class="video-js-box" id="<?php print $player_id; ?>">
      <!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody -->
!     <video id="<?php print $player_id; ?>" class="video-js" width="<?php print(variable_get('videojs_width', 640))?>" height="<?php print(variable_get('videojs_height', 264))?>" controls="controls" preload="auto" poster="">
        <?php foreach ($items as $item):?>
        <?php $filepath = file_create_url($item['filepath']); ?>
!         <?php if($item['filemime'] == 'video/mp4') ?>
!           <source src="<?=$filepath?>" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
!         <?php if($item['filemime'] == 'application/octet-stream') ?>
!           <source src="<?=$filepath?>" type='video/webm; codecs="vp8, vorbis"' />
!         <?php if($item['filemime'] == 'application/ogg' || $item['filemime'] == 'video/ogg') ?>
!           <source src="<?=$filepath?>" type='video/ogg; codecs="theora, vorbis"' />
        <?php endforeach; ?>
        <!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->
        <!-- @TODO: Add Flowplayer on SWFTools or Flowplayer API modules -->
      </video>
    </div>
    <!-- End VideoJS -->
\ No newline at end of file
--- 6,31 ----
   */
  ?>
   <!-- Begin VideoJS -->
+   <?php if (count($items) > 0): ?>
    <div class="video-js-box" id="<?php print $player_id; ?>">
      <!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody -->
!     <video id="<?php print $player_id; ?>" class="video-js" width="<?php print($width)?>" height="<?php print($height)?>" controls="controls" preload="auto" poster="<?php print($poster_url)?>">
        <?php foreach ($items as $item):?>
        <?php $filepath = file_create_url($item['filepath']); ?>
!          <source src="<?php print(file_create_url($item['filepath']))?>" type="<?php print($item['videotype'])?>" />
        <?php endforeach; ?>
        <!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->
        <!-- @TODO: Add Flowplayer on SWFTools or Flowplayer API modules -->
+       <object class="vjs-flash-fallback" width="<?php print($width)?>" height="<?php print($height)?>" type="application/x-shockwave-flash"
+         data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">
+         <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
+         <param name="allowfullscreen" value="true" />
+         <param name="flashvars" value='config={"playlist":["<?php print($poster_url)?>", {"url": "<?php print(file_create_url($items[0]['filepath']))?>","autoPlay":false,"autoBuffering":true}]}' />
+         <!-- Image Fallback. Typically the same as the poster image. -->
+         <img src="<?php print($poster_url)?>" width="<?php print($width)?>" height="<?php print($height)?>" alt="Poster Image"
+           title="No video playback capabilities." />
+       </object>
      </video>
    </div>
+   <?php endif; ?>
    <!-- End VideoJS -->
\ No newline at end of file
