<!DOCTYPE html>
<html>
   <head>
      <link href="favicon.png" rel="shortcut icon">
      <meta charset="utf-8">
      <meta content="IE=edge" http-equiv="X-UA-Compatible">
      <meta property="og:title" content="7. schůze Výboru pro zdravotnictví 
 od 2022-03-30 14:00:00 do 2022-03-30 17:00:00">
      <meta property="og:url" content="https://videoarchiv.psp.cz/playa.php?cast=935">
      <meta property="og:image:type" content="image/png">
      <meta property="og:image:width" content="200">
      <meta property="og:image:height" content="113">
      <meta property="og:image" content="https://videoarchiv.psp.cz/images/videoarchiv_ogimage_08.jpg">
      <title>
      7. schůze Výboru pro zdravotnictví -  od 2022-03-30 14:00:00 do 2022-03-30 17:00:00      </title><!-- jQuery -->

      <script src="./plugins/jquery/jquery.min.js">
      </script><!-- Bootstrap 4 -->

      <script src="./plugins/bootstrap/js/bootstrap.bundle.min.js">
      </script>
      <script src="./plugins/videojs/video.min.js">
      </script>
      <script src="./plugins/videojs/videojs-playlist.min.js">
      </script>
      <script src="./plugins/videojs/videojs-playlist-ui.min.js">
      </script>
      <script src="./plugins/videojs/lang/cs.js">
      </script><!-- AdminLTE App -->

      <script src="./dist/js/adminlte.js">
      </script><!-- AdminLTE for demo purposes -->

      <script src="./dist/js/demo.js">
      </script><!-- Font Awesome Icons -->
      <link href="favicon.png" rel="shortcut icon">
      <!-- <link href="./dist/css/bootstrap.min.css" rel="stylesheet"> -->
      <link href="./plugins/fontawesome-free/css/all.min.css" rel="stylesheet">
      <link href="./dist/css/adminlte.css" rel="stylesheet">
      <!-- <link href="./dist/css/main.css" rel="stylesheet"> -->
      <link rel="stylesheet" href="./plugins/jquery-ui/jquery-ui.min.css">
      <link href="./plugins/videojs/video-js.min.css" rel="stylesheet">
      <link href="./plugins/videojs/videojs-playlist-ui.css" rel="stylesheet">
      <style>
      body {overflow-y: scroll; 
      }
      .vjs-text-track-display div {
       font-size: 1.5em;
       backgroudOpacity: 1;
}
      </style>
   </head>
   <body>
      <div id="header2">
         <div class="inner">
            <div class="part-content2">
               <p id="logo">
                  <a href="https://www.psp.cz"><img alt="Logo Poslanecká sněmovna Parlamentu České republiky" height="108" src="./loga/logo-poslanecka-snemovna-parlamentu-cr.png" width="307"></a> <a class="department-logo" href="https://videoarchiv.psp.cz"><img alt="video archiv" height="64" src="./loga/videoarchiv.png" width="197"></a>
               </p>
            </div>
         </div>
      </div>
      <!--Content-->

      <div align="center" class="part-content2">
            <div class="card mb-1 p-0 text-center">
              <p class="text-center mb-1 p-1" id="nadpis" style="font-size: 1.8em; align: text-center;">
              </p>
              <p class="text-center mb-1 p-1" id="casttext" style="font-size: 1em; align: text-center;">
              </p>
                              <div class="card-body  mb-0 p-0  text-center">
                  <div class="dropdown">
                     <a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle bg-secondary" data-toggle="dropdown" id="dropdownMenuButton" style="font-size: 1.2em;"></a>
                     <div id="dr" style="display : none">
                        <div aria-labelledby="dropdownMenuButton" class="dropdown-menu" id="drd">
                        </div>
                     </div>
                  </div>
               </div>
                          </div>

            <div class="card card-inverse text-center" style="max-width:70%;">
               <!-- <div  style="max-width: 500px;"> -->

               <div class="card-body  mb-0 p-0  text-center">
                  <div id='current1' style=' position:relative; text-align: center; font-size: 1.2em; padding: 0 0 0 50px'>
                  </div>
               </div>

               <div class="card-body  mb-1 p-1  text-center" style="max-width:100%;">
                  <div class="embed-responsive embed-responsive-16by9 z-depth-3 rounded">
                     <video autoplay="" class="video-js embed-responsive-item vjs-default-skin" id="gvideo1" preload="true" controls="true" data-setup={}>Video není podporováno Vaším prohlížečem</video>
                  </div>

                  <div class="overflow-x" id="plist">
                     <div class="vjs-playlist embed-responsive-item" style="height:110px;padding: 20px 0 0 0;background: #aaaaaa;">
                     </div>
                  </div>
               </div>

               <div class="card-body mb-0 p-0  text-center">
                        <ul class="nav nav-tabs" id="custom-tabs-three-tab" role="tablist">
                           <li id="selector" class="nav-item">
                              <a aria-controls="custom-tabs-three-home" aria-selected="false" class="nav-link" data-toggle="pill" href="#custom-tabs-three-home" id="custom-tabs-three-home-tab" role="tab">Kamera</a>
                           </li>

                           <li class="nav-item">
                              <a aria-controls="custom-tabs-three-profile" aria-selected="true" class="nav-link active" data-toggle="pill" href="#custom-tabs-three-profile" id="custom-tabs-three-profile-tab" role="tab">Odkaz</a>
                           </li>

                           <li class="nav-item">
                              <a aria-controls="custom-tabs-three-messages" aria-selected="false" class="nav-link" data-toggle="pill" href="#custom-tabs-three-messages" id="custom-tabs-three-messages-tab" role="tab">Vybrat část</a>
                           </li>
                        </ul>
                     </div>

                     <div class="card-body">
                        <div class="tab-content" id="custom-tabs-three-tabContent">
                           <div aria-labelledby="custom-tabs-three-home-tab" class="tab-pane fade" id="custom-tabs-three-home" role="tabpanel">
                              <div class=" btn-block" id="px">
                                 <input id="castid" name="" type="hidden" value="">
                              </div>
                           </div>

                           <div aria-labelledby="custom-tabs-three-profile-tab" class="tab-pane fade active show" id="custom-tabs-three-profile" role="tabpanel">
                           <div class="input-group">  
                           <a class="btn btn-outline-secondary btn-rounded btn-sm form-control" href="#" id="urlx" onclick="window.open(this.href,'PSP player','height=750,width=760,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0,copyhistory=no,resizable=0'); return false;"></a>
                           <button class="btn btn-outline-dark btn-rounded btn-sm" id="addon2"><i class="far fa-copy"></i></button>   
               </div>
                          </div>

                           <div aria-labelledby="custom-tabs-three-messages-tab" class="tab-pane fade" id="custom-tabs-three-messages" role="tabpanel">
                           <table class="table-sm">
                  <tr>
                  <td>  
                  <button type="button" id="bfrm" class="btn btn-primary btn-rounded btn-sm ml-8  btn-block" >Označit začátek</button>
                  </td>
                  <td> 
                  <input type="text" class="disabled" id="frm" size="12" value="" disabled/>
                  </td>
                  <td>
                <button class="btn btn-outline-secondary btn-rounded btn-sm  btn-block" onclick="resetfrm();document.getElementById('frm').value = ''">Zrušit</button>
</td>
</tr>
<tr>
              <td>  
             <button type="button" id="btom" class="btn btn-primary btn-rounded btn-sm ml-8  btn-block" >Označit konec</button>
             </td>
             <td>  
             <input type="text" class="disabled" id="tom"  size="12" value=""  disabled/>
             </td>
             <td> 
             <button class="btn btn-outline-secondary btn-rounded btn-sm  btn-block" onclick="resettom();document.getElementById('tom').value = ''">Zrušit</button>
             <input type="hidden" id="hciid" value="" />
             </td>
</tr>
</table>
            <div id="visi" class="input-group">
            <a class="btn btn-outline-secondary btn-rounded btn-sm form-control" href="" id="url_link" onclick="window.open(this.href,'PSP player','height=750,width=760,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0,copyhistory=no,resizable=0'); return false;"></a>
            <button class="btn btn-outline-dark btn-rounded btn-sm " id="addon1"><i class="far fa-copy"></i></button>
            </div>     
                            </div> 
                          </div>
               </div>
               </div>

               </div>
               
        


      <div id="footer2">
         <div class="part-content2">
            <!-- Footer Info -->

            <div id="footer-info">
               <div class="footer-section footer-site-info">
                  <p>
                     Parlament České republiky, Poslanecká sněmovna, Sněmovní 4, 118 26, Praha 1 - Malá Strana
                  </p>
               </div>

               <div class="footer-section footer-contact">
                  <p>
                     <b>Telefon na spojovatelku:</b> 257 171 111
                  </p>

                  <p class="no-print">
                     <strong><a href="https://www.psp.cz/sqw/hp.sqw?k=33">Informace dle zákona 106/1999 Sb.</a></strong>
                  </p>
               </div>

               <div class="footer-section footer-social">
                  <p>
                     <a class="youtube" href="https://www.psp.cz/sqw/hp.sqw?k=325">YouTube</a>
                  </p>

                  <p>
                     <a class="facebook" href="https://www.psp.cz/sqw/hp.sqw?k=327">Facebook</a>
                  </p>

                  <p>
                     <a class="twitter" href="https://www.psp.cz/sqw/hp.sqw?k=326">Twitter</a>
                  </p>

                  <p>
                     <a class="instagram" href="https://www.psp.cz/sqw/hp.sqw?k=334">Instagram</a>
                  </p>
               </div>

               <div class="clear">
               </div>
            </div>
            <!--/ Footer Info -->
         </div>
      </div>
      <script>
 
      function ChangeUrl(title, url) {
    if (typeof (history.pushState) != "undefined") {
        var obj = { Title: title, Url: url };
        history.pushState(obj, obj.Title, obj.Url);
    } else {
        alert("Browser does not support HTML5.");
    }
}

      $('#urlc').val(window.location.origin);
      var data

      function resetfrm() {
       $('#frm').val('');
         if ($('#frm').val() != '') {
           var tmo = '&tmo=' + $('#frm').val();
         } else {
           var tmo = '';
         }
         if ($('#tom').val() != '') {
           var tmd = '&tmd=' + $('#tom').val();
         } else {
           var tmd = '';
         }
         //$('#urlc').val(window.location.origin + '/playa.php?cast=' + castid + tmo + tmd);
         if (tmd != '' || tmo != '')
         {
          $("#visi").show();
         $("#url_link").attr({"href" : window.location.origin + "/playa.php?cast=" + ccd +tmo + tmd});
         $('#url_link').html(window.location.origin + "/playa.php?cast=" + ccd +tmo + tmd);
         } else {
          $("#visi").hide();
           $("#url_link").attr({"href" : ""});
         $('#url_link').html("");
           
         }
       }

       function resettom() {
       $('#tom').val('');
         if ($('#frm').val() != '') {
           var tmo = '&tmo=' + $('#frm').val();
         } else {
           var tmo = '';
         }
         if ($('#tom').val() != '') {
           var tmd = '&tmd=' + $('#tom').val();
         } else {
           var tmd = '';
         }
         //$('#urlc').val(window.location.origin + '/playa.php?cast=' + castid + tmo + tmd);
         if (tmd != '' || tmo != '')
         {
          $("#visi").show();
         $("#url_link").attr({"href" : window.location.origin + "/playa.php?cast=" + ccd +tmo + tmd});
         $('#url_link').html(window.location.origin + "/playa.php?cast=" + ccd +tmo + tmd);
         } else {
          $("#visi").hide();
           $("#url_link").attr({"href" : ""});
         $('#url_link').html("");
           
         }
       }

      var player = videojs('#gvideo1' , {controls: true});
      player.playlistUi({horizontal : true});
      function secToTimer(sec){
      let o = new Date(0)
      let p = new Date(sec*1000)  
      return new Date(p.getTime()-o.getTime())
       .toISOString()
       .split("T")[1]
       .split("Z")[0]
       .split(".")[0]
      }
    
      function playsub(cid)
      {
      var nd='';
      var tmo='';
      var tmd='';
      var castid=cid;
      $('#urlc').val(window.location.origin + '/playa.php?cast=' + castid);
      $('#urlx').attr({'href': window.location.origin + '/playa.php?cast=' + castid + ''});
      $('#urlx').html( window.location.origin + '/playa.php?cast=' + castid + '');
         
      ChangeUrl("", window.location.origin + "/playa.php?cast=" + castid + "");

     
                  
      $.ajax({
               url: 'subname.php?subakce='+cid,
               type : "GET",
               async: false,
               success:function(response){
                  nadpis.innerHTML=response;
               }
      });
      $.ajax({
               url: 'subtext.php?subakce='+cid,
               type : "GET",
               async: false,
               success:function(response){
                  casttext.innerHTML=response;
               }
      });
      var res='';
      $.ajax({
         url: 'subcname.php?subakce=' + cid,
         type: "GET",
         async: false,
         success: function(response) {
           dropdownMenuButton.innerHTML = response;
           res= response;
         } 
       });
      
       document.title = nadpis.innerHTML+' - '+res.replace(/&nbsp;/g, ' ');

       $.ajax({
         type: 'GET',
         url: './casti.php?subakce=' + cid,
         async: false,
         contentType: "application/json; charset=utf-8",
         dataType: "json",
         success: function(response) {
           if ((response != '') && (response != null)) {
            
             datas = response;
             $('#dr').show();
             var opt = '';
             for (var i = 0; i < datas.length; i++) {
              if (datas[i].showdt === 't') {
               opt += '<a href="" class="dropdown-item bg-secondary" style="font-size: 0.8em;" onclick="playsub(' + datas[i].Id + ');">' + datas[i].Name +'&nbsp;&nbsp;od: '+ datas[i].st + '&nbsp;&nbsp;do: '+ datas[i].stp +'<\/a>'
               } else {
               opt += '<a href="" class="dropdown-item bg-secondary" style="font-size: 0.8em;" onclick="playsub(' + datas[i].Id + ');">' + datas[i].Name +'<\/a>'
               }
             }
             //opt += '<\/select>'
               //alert(opt);
             drd.innerHTML = opt;
             // $('.selectpicker').selectpicker({
             //   style: 'btn-info',
             //   size: 4
             // });
             // $('.selectpicker').selectpicker('refresh');
           }else {
             $('#dr').hide();
             drd.innerHTML = '';
           } 
         }
       });

      $.ajax({
               url: 'subfiles.php?subakce='+cid+'',
               type : "GET",
               async: false,
               contentType: "application/json; charset=utf-8",
               dataType: "json",
               success:function(response){
                 if ((response!="")&&(response!=null)) {
                   vid = response;
                   var videosrc = [];

                   $('#dropdownMenuButton').attr({"href":window.location.origin+ '/playa.php?cast='+cid });
                   $('#dropdownMenuButton').html(res);
            console.log(vid.length);
            if (vid.length<=1) {
              $("#plist").hide();
            } else {
              $("#plist").show();
            }
            for(var i = 0; i < vid.length; i++){
             if (vid[i].typ!='U')
             {
             var str=vid[i].name;
             var n = str.indexOf(".mp4");
             var tm = str.substring(n,n-6);
             
             var btime = tm.substring(0,2)+':'+tm.substring(2,4);
             } else
             {
               var btime=vid[i].name;
               //console.log(vid[i].name);
             }
	     
             videosrc.push({name: btime, 
		sources: [{src: vid[i].name, type: 'video/mp4'}], 
		 textTracks: [{
                kind: 'captions',
                label: 'česky',
                srclang: 'cz',
                src: vid[i].name + '.vtt',
                default:true}],
		thumbnail: [{srcset: vid[i].name+'.png',type: 'image/png',
			media: '(min-width: 200px;)'}, 
		{src: vid[i].name+'.png'}]});
           }

           // for(var i = 0; i < vid.length; i++){
           //   var str=vid[i].name;
           //   var n = str.indexOf(".mp4");
           //   var tm = str.substring(n,n-6);
             
           //   var btime = 'Čas od: '+tm.substring(0,2)+':'+tm.substring(2,4)+':'+tm.substring(4,6);
           //   //videosrc.push({name: btime, sources: [{src: vid[i].name, type: 'video/mp4'}]});
           //   videosrc.push({name: btime, sources: [{src: vid[i].name, type: 'video/mp4'}], thumbnail: [{srcset: vid[i].name+'.png',type: 'image/png',media: '(min-width: 200px;)'}, {src: vid[i].name+'.png'}]});
           // }
           player.playlist([]);
           player.playlist(videosrc);
           player.playlistUi({playOnSelect:true,
             horizontal : true});
           player.playlist.autoadvance(0);
           player.playlist.first();
           player.play();
                 }
               }
      });
      }

      var dourl="";
      nadpis.innerHTML = 'Konec záznamu';
      player.on('timeupdate', function(){
       //console.log(player.currentTime()+' / '+player.duration());
      var str = player.currentSrc();
      var n = str.indexOf(".mp4");
      var tm = str.substring(n,n-6);
      var dt = str.substring(n-6,n-14);
      stop.innerHTML = '';
      var ssec = ((parseInt(tm.substring(0,2))*3600)+(parseInt(tm.substring(2,4))*60)+(parseInt(tm.substring(4,6))))
      var btime = tm.substring(0,2)+':'+tm.substring(2,4)+':'+tm.substring(4,6)  
      var curri = player.playlist.currentIndex();
      if (vid[curri].to>0) 
      {
       if (player.currentTime()>=vid[curri].to) 
       {
         player.pause();
         player.currentTime(vid[curri].to);
         stop.innerHTML = 'Konec záznamu';
       }
       }
      if (vid[curri].from>0) {if (player.currentTime()<vid[curri].from) {player.currentTime(vid[curri].from)}}

      current1.innerHTML =dt.substring(6,8)+'.'+dt.substring(4,6)+'.'+dt.substring(0,4) + '<br><i class="fas fa-clock"><\/i>' + secToTimer((ssec)+ player.currentTime())
      dourl = dt.substring(6,8)+'.'+dt.substring(4,6)+'.'+dt.substring(0,4) + ' ' + secToTimer((ssec)+ player.currentTime());
      });

      var  datax;
      var cbt=0;
      var datas=[];
      var ccd=935;
      $(document).ready(function(){
       $('#frm').val('');
             $('#tom').val('');
             $('#urlc').val(window.location.origin + '/playa.php?cast=' + ccd);
             $('#urlx').attr({'href': window.location.origin + '/playa.php?cast=' + ccd + ''});
             $('#urlx').html( window.location.origin + '/playa.php?cast=' + ccd + '');
              $("#visi").hide();
              $('#url_link').attr({'href':''});
              $('#url_link').html('');
             var camname='';

       $.ajax({
         type: 'GET',
         url: './camname.php?subakce=' + ccd,
         async: false,
         success: function(response) {
           if ((response != '') && (response != null)) {
             datas = response;
             camname=datas;
       }
       }
       });
      $.ajax({
           type: 'GET',
           url: './views.php?subakce='+ccd,
           async: false,
           contentType: "application/json; charset=utf-8",
           dataType: "json",
           success: function(response) {
             if ((response!='')&&(response!=null)) {
                   datas = response;
                   $('#selector').show();
                  var opt='<select id="selview" class="selectpicker  btn-block">';
                  opt+='<option value="-1">'+camname+'<\/option>'
                  for(var i = 0; i < datas.length; i++){
                    opt+='<option value="'+datas[i].idcam+'">'+datas[i].cam+'<\/option>'
           }
           opt+='<\/select>'
           //alert(opt);
           px.innerHTML=opt;
          
           } else { $('#selector').hide();}
       }
      });

      // $.ajax({
      //    type: 'GET',
      //    url: './casti.php?subakce=' + ccd,
      //    async: false,
      //    contentType: "application/json; charset=utf-8",
      //    dataType: "json",
      //    success: function(response) {
      //      if ((response != '') && (response != null)) {
            
      //        datas = response;
      //        $('#dr').show();
      //        var opt = '';
      //        for (var i = 0; i < datas.length; i++) {
      //          opt += '<a href="#" class="dropdown-item bg-secondary" style="font-size: 0.8em;" onclick="playsub(' + datas[i].Id + ');">' + datas[i].Name +'&nbsp;&nbsp;od: '+ datas[i].st + '&nbsp;&nbsp;do: '+ datas[i].stp +'<\/a>'
      //        }
      //        //opt += '<\/select>'
      //          //alert(opt);
      //        drd.innerHTML = opt;
      //        // $('.selectpicker').selectpicker({
      //        //   style: 'btn-info',
      //        //   size: 4
      //        // });
      //        // $('.selectpicker').selectpicker('refresh');
      //      }else {
      //        $('#dr').hide();
      //        drd.innerHTML = '';
      //      } 
      //    }
      //  });

      function getf(cid)
      {  
      cbt=0;
      $.ajax({
           type: 'GET',
           url: './files.php?cid='+cid,
           success: function(result) {
               datax = jQuery.parseJSON(result);
           }
       });
      }

      function mkurl() {
         if ($('#frm').val() != '') {
           var tmo = '&tmo=' + $('#frm').val();
         } else {
           var tmo = '';
         }
         if ($('#tom').val() != '') {
           var tmd = '&tmd=' + $('#tom').val();
         } else {
           var tmd = '';
         }
         //$('#urlc').val(window.location.origin + '/playa.php?cast=' + castid + tmo + tmd);
         if (tmd != '' || tmo != '') 
         {
         $("#visi").show();
         $("#url_link").attr({"href" : window.location.origin + "/playa.php?cast=" + ccd +tmo + tmd});
         $('#url_link').html(window.location.origin + "/playa.php?cast=" + ccd +tmo + tmd);
         } else {
          $("#visi").hide();
           $("#url_link").attr({"href" : ""});
         $('#url_link').html("");
         }
       }

      $('#bfrm').on('click', function() {
       $('#frm').val(dourl);
       mkurl();
      });  

      $('#btom').on('click', function() {
       $('#tom').val(dourl);
       mkurl();
      });

     
      });

      $('#addon1').on('click', function(e) {
    e.preventDefault();
  var copyText = $('#url_link').attr("href");

  document.addEventListener('copy', function(e) {
    e.clipboardData.setData('text/plain', copyText);
    e.preventDefault();
  }, true);

  document.execCommand('copy');  
  //console.log('copied text : ', copyText);
  alert('Odkaz zkopírován do schránky: ' + copyText);
    
  });

  $('#addon2').on('click', function(e) {
    e.preventDefault();
  var copyText = $('#urlx').attr("href");

  document.addEventListener('copy', function(e) {
    e.clipboardData.setData('text/plain', copyText);
    e.preventDefault();
  }, true);

  document.execCommand('copy');  
  //console.log('copied text : ', copyText);
  alert('Odkaz zkopírován do schránky: ' + copyText);
    
  });

      $("#px").change(function(){
           var camid = $("#selview").val();
           var cid = 935;
           var currind = player.playlist.currentIndex();
           var currtm = player.currentTime();
           
           $.ajax({
               url: 'subfiles.php?subakce='+cid+'&camid='+camid+'',
               type : "GET",
               async: false,
               contentType: "application/json; charset=utf-8",
               dataType: "json",
               success:function(response){
                 if ((response!="")&&(response!=null)) {
                   vid = response;
                   var videosrc = [];
                
           
            for(var i = 0; i < vid.length; i++){
             if (vid[i].typ!='U')
             {
             var str=vid[i].name;
             var n = str.indexOf(".mp4");
             var tm = str.substring(n,n-6);
             
             var btime = tm.substring(0,2)+':'+tm.substring(2,4);
             } else
             {
               var btime=vid[i].name;
             }
             videosrc.push({name: btime, sources: [{src: vid[i].name, type: 'video/mp4'}], thumbnail: [{srcset: vid[i].name+'.png',type: 'image/png',media: '(min-width: 200px;)'}, {src: vid[i].name+'.png'}]});
           }
           player.playlist([]);
           player.playlist().clear;
           if (vid.length>=2) {
           player.playlist(videosrc);
           player.playlistUi({playOnSelect:true,
             horizontal : true});
           player.playlist.autoadvance(0);
           }
           
           player.play();
           player.playlist.currentItem(currind);
           player.currentTime(currtm);
               }
               }
      });
           
       });

      playsub(935);
      </script>
   </body>
</html>
