<script type="text/javascript">
    // Charge le player
    flowplayer("player", "<?php echo flash_path('flowplayer-3.1.2.swf') ?>",
               {
                   clip: {url: "<?php echo film_video_path($filmVideo['file']); ?>",
                          autoPlay: false,
                          autoBuffering: true,
                          onSeek: function() {
                              playerSeek();
                          }
                         },

                   plugins: {

                       content: {url: "<?php echo flash_path('flowplayer.content-3.1.0.swf') ?>",
                                 backgroundColor: 'transparent',
                                 display: 'none',
                                 style: {p: {fontSize: 15}}
                                }

                   },

                   onLoad: function() {
                       playerLoaded(this);
                   },

                   onUnload: function() {
                       playerUnloaded(this);
                   },
                   onError: function(code,msg) {
                       alert(msg);
                   },
               });


               function loadSegments() {

                   if ($f().getClip() == undefined) {
                       window.setTimeout("loadSegments()",2000);
                       return false;
                   }

                   var duration = Math.round($f().getClip().fullDuration*10) * 100;


                   var segments = tagTool.segments;

                   for (seg in segments) {
                       var segd = segments[seg].sout - segments[seg].sin;
                       var percent = Math.round(segd * 100 / duration);
                       var offset = Math.round(segments[seg].sin * 100 / duration);
                       var c = $('#seg_container_template').clone().removeAttr("id");
                       $("#segments").append(c);
                       $("span", c).html('<strong>' + tagTool.segments[seg].tag +'</strong> par ' + segments[seg].user);
                       $("#seg_0", c).css({'margin-left': offset+'%', 'width': percent+'%'})
                       .attr('id', 'seg_' + seg)
                       .click(function() {
                           seg_id = $(this).attr("id");
                           seg_id = seg_id.substr(seg_id.indexOf('_') + 1);
                           tagTool.playSegment(seg_id, $("#pauseAfter").val());
                       });
                       c.show();
                   }
               }


               function playerSeek() {
                   tagTool.rebuildCurrentTags(tagTool.player.getTime() * 1000);
               }


               function playerLoaded(player) {

                   // Charge les tags
    				

                   tagTool.player = $f("player");
                   tagTool.showTagInPage = false;

               }
    </script>
<div id="editor">
	<h1><?php

		echo $film->getTitle();
		// original title if exist

		if($film->getOriginalTitle()!= null)
		{
			echo " <span class=\"ost\">{".$film->getOriginalTitle()."}</span>";
		}
	?>
	<span class="film-infos">De <?php echo thd_render_flat_list($film->getDirectorsArray(), 'name'); ?></span></h1>
	<div class="section">
		<div id="player" class="player-ba"></div>	
	<div class="tag-action"><a href="" class="link-button">Tagger le film</a></div>
	</div>
</div>
