title: JWPlayer with fancybox and oncomplete event
body: <p>I'm using JwPlayer with fancybox, and I would like to detect when user has watched finish the video. </p>
  
  <p>I tried aftershow and oncomplete but it's not working. Below is my code. Can anyone help to see what I should change to be able to detect once the video has finished playing? Thank you!</p>
  
  <pre><code>$(".video_show").fancybox({
                     content : '&lt;div id="myElement"&gt;Loading the player...&lt;/div&gt;',
                      fitToView : true,
                      afterShow : function() {
                          this.content = jwplayer('myElement').setup({            
                              flashplayer: "js/jwplayer.flash.swf",
                              file: this.href,
                              height: 360,
                              width: 640,
                              autoStart : false,
                              stretching : "fill"
                          }); 
                          // Store references to tag and rates
                          var videoTag;
                          var currentRate = 1;
  
                      },
                       events:{
                          onComplete: function() {
                              return alert("Im done");
                          }
                       }
  
                  }); 
  </code></pre>