title: How to get End Event of YouTube Video
body: <p>I am working on site where I have one image. Clicking on that image it opens a jQuery dialogue. In this dialogue i open iframe and src of iFrame is YouTube Videos URL. I want that when video stops, page should automatically redirect to the contact us Page. </p>
  
  <p>Below is the JavaScript Code that I used to open a dialogue when someone clicks on image of video.</p>
  
  <pre><code>&lt;script type="text/javascript" &gt;
          $(function() {
              $( "#dialog" ).dialog({
                  autoOpen: false,
                  position:['',100],
                  show: {
                      effect: "blind",
                      duration: 1000
                  },
                  hide: {
                      effect: "fade",
                      duration: 1000
                  }
              });
              $( "#opener" ).click(function() {
                 $( "#dialog" ).dialog( "open" );
                 $("#vieoplayId").attr("src","http://www.youtube.com/embed/T6DJcgm3wNY?autoplay=1");
              });
         });
  </code></pre>
  
  <p>Below is the HTML Code </p>
  
  <pre><code>&lt;div id="dialog"&gt;
     &lt;div id="dialog1"&gt;
        &lt;iframe  id="vieoplayId"  src="about:blank" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen&gt;&lt;/iframe&gt;
       &lt;/div&gt;
  &lt;/div&gt;                                    
   &lt;div class="video_container"&gt;
      &lt;img src="../images/img1.jpg" id="opener" style="cursor:pointer;"&gt;
   &lt;/div&gt;
  </code></pre>