<input type="hidden" id="baseUrl" name="baseUrl" value="<?php echo base_url(); ?>">
<input type="hidden" id="manage_single_video_id" name="manage_single_video_id" 
       value="<?php if(isset($manage_single_video)){ 
                        echo $manage_single_video->manage_video_id; 
                    }elseif (isset($manage_video[0])) {
                        echo $manage_video[0]->manage_video_id; 
                    }
                ?>">
<script type="text/javascript" src="<?php echo base_url(); ?>back_end_resource/manage_admin_video/view_single_video.js"></script>
<script>
    var screen_height = $( window ).height();
</script>

<div class="col-sm-10 col-sm-offset-1 text-center form-group" id="video-container">
    <?php 
        $resolution = "<script>document.writeln(screen_height);</script>";
        //echo "Screen Resolution: ". $resolution;
    ?>
    <?php 
        if(isset($manage_single_video)){ 
    ?>
            <div class="row">
                <video poster="<?php echo base_url('image/tt_single_video_view.png'); ?>" controls>
                    <source src="<?php echo base_url() . $manage_single_video->manage_video_location; ?>" type="video/mp4">                                                              
                </video>
            </div>
    <?php 
        }elseif (isset ($manage_video)) { 
            foreach ($manage_video as $manage_video_info){
                if(isset($resolution) && !empty($resolution)){
                    if($resolution >= str_replace('p','',$manage_video_info->manage_video_location_resolution)){
    ?>
                        <div class="row">
                            <video poster="<?php echo base_url('image/tt_single_video_view.png'); ?>" controls>
                                <source src="<?php echo base_url() . $manage_video_info->manage_video_location; ?>" type="video/mp4">                                                              
                            </video>
                        </div>
    <?php 
                        break; 
                    }
                }   
            }  
        } 
    ?>
</div>
<script src="<?php echo base_url('resource_library/js-video-player/plyr.js'); ?>"></script>
<link href="<?php echo base_url('resource_library/js-video-player/plyr.css'); ?>" rel="stylesheet" type="text/css">

