
<?php 
$videosrcext =  gl_imgtype($videosrc);
if($videosrcext<>'mp4'){
              //if http,then require video.php,bec this file not support http video
     require SYSBLOCKROOT.'videofile/video.php';
 }
else{


 if($blockimg=='') $videoimgv = STAPATH.'img/video.jpg';
   else  $videoimgv = get_img($blockimg);



$videopath = UPLOADPATH.'video/'.$videosrc.'?v='.CSSVERSION;
global $dmvideoreal; 
if(@$dmvideoreal<>'y'){
  getcssjs('assets/vendor/videojs/videoreal-js.css');
  getcssjs('assets/vendor/videojs/videoreal.min.js');
  $dmvideoreal='y';
}
  

//https://videojs.com/guides/setup/

 ?>

 <style type="text/css">
   
  .video-js .vjs-big-play-button {
      top: 50%;
      left: 50%;
      margin-top: -20px;
      margin-left: -40px;
   
}
.vjs-poster {background-size: cover;}
.videorealwrap{width: 800px;height: 350px; margin: 0 auto;margin-bottom: 30px;}

@media (max-width: 800px) { 
       .videorealwrap{width: 600px;height: 250px; }
 }

 @media (max-width: 600px) { 
       .videorealwrap{width: 400px;height:150px; }
        
 }

 </style>
 <div class="videorealwrap">
  <video
    id="my-video<?php echo $pidname?>"
    class="video-js dmvideoreal"
    controls
    preload="auto"  
  
    poster="<?php echo $videoimgv;?>"
    data-setup="{}" 
  >
    <source src="<?php echo $videopath?>" type="video/mp4" />
 
  </video>

<script type="text/javascript">
 
   var dmvideorealplayer = videojs('my-video<?php echo $pidname?>'  );

    
   if ($('body').width() > 800) {

     dmvideorealplayer.width(800);
     dmvideorealplayer.height(350);

      //  dmvideorealplayer.isFullscreen(true);
    }
  else if ($('body').width() <600) {
       dmvideorealplayer.width(400);
      dmvideorealplayer.height(150); 
    }

  else if ($('body').width() <800) {
       dmvideorealplayer.width(600);
      dmvideorealplayer.height(250); 
    }



 

</script>
</div>
<?php 
}
?>