<style>
    .required{
        color: #bf5050;
       }
    
</style>
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>View Lecture</h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">

                      
                      <div class="item form-group">
                       
                        <div class="col-md-offset-2 col-md-6 col-sm-6 col-xs-12">
                          
                                <?php
                              $custom_link=str_replace("watch?v=","embed/",$records['link']);
                         
                          if (strpos($custom_link, '&') !== false) {
                              $custom_link=substr($custom_link, 0, strpos($custom_link, "&"));
                              }
                              ?>
                          <iframe src="<?php echo $custom_link;?>?autoplay=1&loop=1&autopause=0" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>
                        </div>
                      </div>
                      
                 
                  </div>
                </div>
              </div>
          </div>
        </div>
        </div>
  
<script>
$(document).ready(function(){
   var dt = new Date();
   dt.setMinutes(dt.getMinutes() + <?php echo $records['time'];?>);

  var intervalID = window.setInterval(myCallback, 1000, dt);

function myCallback(a)
{
 var mytime = new Date();

 if(Date.parse(mytime)==Date.parse(dt))
 {
    $.ajax({
          type: "POST",
          data:{lec_id:<?php echo $records['id'];?>},
          url: "<?php echo base_url();?>Syllabus/update_status",
          success: function(msg){
           
         }
        });
 }
 
}
});
</script> 
  </body>
</html>