<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" crossorigin="anonymous">
  <script type="text/javascript" src="js/jquery.js"></script>
	        <link href="css/style.css" rel="stylesheet">

</head>
<body>
  <?php if(isset($uuid)){ ?>
  <button class="openn" onclick="openNav()">&#9776; TV</button>
  <div class="overlay" id="overlay" onclick="openNav()"></div>
  <div class="box" id="player"></div>

   
  <div id="mySidenav" class="sidenav">
    <?php if(!empty($_GET['next'])){$f=$_GET['next'];}else{$f=0;} ?>   
    <a class="nextbtn" style="color: white;"> <?php
      $sh = substr(explode(':',$nextok[$f])[1], 0, 30);
         $shok = substr($sh, 0, strrpos($sh, ' '));
      echo $shok;?></a> 
    <div style="text-align: center;"><a href="?cnn=<?=$ab;?>&next=<?php if(!empty($_GET['next'])){echo $_GET['next']+1; }else{ echo 2;} ?>" >NEXT> </a></div>
    <div style="text-align: center;"><a href="#" onclick="myFunction()">LIST</a></div>
    <div id="myDIV" style="display: none;">
        <a href="#" id="upup"></a>
      <?php	
        for ($z =0; $z <= 30; $z++) {
        $nextitle = explode(':',$nextok[$z]); 
        if(!empty($nextitle[0]) && !empty($nextitle[1]))
        $s = substr($nextitle[1], 0, 30);
           $sok = substr($s, 0, strrpos($s, ' '));
        ?>
      <a class="nextbtn" href="?cnn=<?=$ab;?>&next=<?=$z;?>"><?=$sok;?></a>	
      <?php	
      if($z==10){ echo '<button class="bbb" ><a href="#down2">^^^up^^^</a></button>';} 
        //$adsp.= $nextitle[0].',';	
        } 	
        	
        ?>
      <button class="bbb" ><a href="#upup">^^Top^^</a></button>  
		
      <a href="#" id="down2"></a>  
		 
    </div>
  <div id="myD">	
	<div id="down5"></div> 
      <a href="?cnn=ebstvWorldwide">EBS</a>
      <a href="?cnn=fanabroadcastingcorporate">FANA</a>
      <a href="?cnn=AddisWalta">Addis Walta</a>
      <a href="?cnn=EBCworld">EBC</a>
      <a href="?cnn=ArtsTvWorld">Art TV</a>
      <a href="?cnn=AHADUTVNETWORK">Ahadu TV</a>
      <a href="?cnn=AshamTube">Asham</a>
      <a href="?cnn=BalageruTV">Balageru</a>
      <a href="?cnn=AmharaMediaCorporation">Amhara TV</a>
      <a href="?cnn=NahooTVEthiopia">Nahoo</a>  
      <a id="down" href="?cnn=natehills9388">Sport Bick</a>  
      <a href="?cnn=NBCETHIOPIA">NBC TV</a>
	  
<button class="bbb" ><a href="#down">^^^up^^^</a></button>
	  
 <a href="?cnn=CoComelon#down">CoCoMelon</a> 
 <a href="?cnn=MashaBearEN#down">MashaBear</a> 
 <a href="?cnn=MrBean#down">Mr Bean</a> 
 <a href="?cnn=GrizzylesLemmings#down">Grizzy</a> 
 <a href="?cnn=wbkids#down">Tom & Jarry</a> 	  
 <a href="?cnn=YeEthiopiaLijochTV#down">የኢትዮጵያ ልጆች</a>
 <a href="?cnn=TeretTeret#down">Amharic Fairy Tales</a>
 <a href="?cnn=seifuonebs#down">Seifu on EBS</a>        
 <a href="?cnn=comedianeshetu#down">Donkey Tube</a>
 <a href="?cnn=TechTalkWithSolomon#down">Tech Talk</a> 
 <a href="?cnn=hagerietv#down">Hagerie Tv</a>
 <a id="down3" href="?cnn=KanaTelevision#down">Kana</a>
 <a href="?cnn=yekidusantarik6965#down">የቅዱሳን ታሪክ</a>
	  
<button class="bbb" ><a href="#down3">^^^up^^^</a></button>

      <a href="?cnn=MinewShewaTube#down3">MenewShew</a>
      <a href="?cnn=hoplessable#down3">Hope Music</a>
      <a href="?cnn=AwtarTVMusic#down3">Awtar Music</a>
      <a href="?cnn=NahomRecordsIncMusic#down3">Nahom Records</a>
      <a href="?cnn=ellarecords#down3">Ella Recoreds</a>
      <a href="?cnn=AmharicTV#down3">AmharicTV</a>
      <a href="?cnn=NetsebraqProductions#down3">Amharic Film</a>
      <a href="?cnn=SodereTV#down3">Sodere TV</a>
      <a href="?cnn=AmharaMediaCorporation#down3">Amhara TV</a> 
	<a href="?cnn=VOAAmharic#down3">VOA Amharic</a> 
    <a href="?cnn=bbcamharic#down3">BBC Amharic</a>
	<a href="?cnn=roha_tv#down3">Roha TV</a>  
      <a id="down4" href="?cnn=NBCETHIOPIA#down3">NBC ETHIOPIA</a>

<button class="bbb" ><a href="#down4">^^^up^^^</a></button>
    
      <a href="?cnn=abbay-tv#down4">Abbay Tv</a>
      <a href="?cnn=AddisMediaNetworkAMN#down4">Addis TV</a>
      <a href="?cnn=abelbirhanu1#down4">Abel birhanu 2</a>
      <a href="?cnn=EOTCTV#down4">EOTC TV</a>
      <a href="?cnn=Mereja360studio#down4">Ethio 360</a>
      <a href="?cnn=ESATtvEthiopia#down4">ESAT</a>
      <a href="?cnn=EthiopianMediaServices#down4">EMS Media</a>
      <a href="?cnn=zeethiopia#down4">Zehabesha</a>
      <a href="?cnn=AlemnehWasse#down4">Alemneh Wasse</a>
      <a href="?cnn=OBNoromiyaa#down4">OBN</a>
      <a href="?cnn=OromiaMedia#down4">OMN</a>      
      <a href="?cnn=AddisCompassMedia#down4">Addis Compass</a>
      <a href="?cnn=Reyot#down4">Ryot Teddy</a> 
      
<button class="bbb" ><a href="#down6">^^^up^^^</a></button>
 
<a href="?cnn=BetochComedy">Betoch Comedy</a>

      <a href="?cnn=travelethiopia-6169#down6">Travel Ethiopia</a>
      <a id="down6" href="?cnn=lifeofabel7414#down6">Life of Abel</a> 
     <a href="?cnn=aljazeeraenglish#down6">Aljazeera English</a>   
    <a href="?cnn=NBCNews#down6">NBC News</a>
    <a href="?cnn=NatGeo#down6">NatGeo</a>  
     <a href="?cnn=Netflix#down6">Netflix Triler</a>  
    <a href="?cnn=NinjaWarrior#down6">American Ninja Warrior</a>	
     <a href="?cnn=bbcearth#down6">BBC Earth</a>	  
      <a href="?cnn=stefhoffer#down6">Travel World</a>
      <a href="?cnn=pianorelax4k#down6">PIANO Wildlife</a>
      <a href="?cnn=BestEverFoodReviewShow#down6">Best Food Show</a>
      <a href="?cnn=topfives#down6">Top Fives</a> 
<button class="bbb"><a href="#down5">^^^TOP^^^</a></button>	  

      <a href="logout.php" >Logout</a>
      <br>
      <br>
      <a href="#" name="gomm"></a>
      <a href="#"></a>
    </div>
  </div>
  <script src="https://www.youtube.com/iframe_api"></script>
  <script>
    function myFunction() {
      var x = document.getElementById("myDIV");
      var y = document.getElementById("myD");
      if (x.style.display === "block") {
        x.style.display = "none";
        y.style.display = "block";
      } else {
        x.style.display = "block";
        y.style.display = "none";
    
      }
    }
  
	  
	  
  </script>
  <script>
    /**
     * Put your video IDs in this array
     */
    var videoIDs = [
    <?php
      //echo $countv;
      for ($y = $next; $y <= $countv; $y++) {
      $nextitle = explode(':',$nextok[$y]);    
      $adsp.= $nextitle[0].',';	
      } 
      echo str_replace(',,','',$adsp);
      //exit;	
      ?>

    ];
    
    var player, currentVideoId = 0;
    
    function onYouTubeIframeAPIReady() {
        player = new YT.Player('player', {
            height: '100%',
            width: '100%',
            vq:'medium',
            showinfo: 0,
            events: {
                'onReady': onPlayerReady,
                'onStateChange': onPlayerStateChange
            }
        });
    }
    
    function onPlayerReady(event) {
        event.target.loadVideoById(videoIDs[currentVideoId]);
    }
    
    function onPlayerStateChange(event) {
        if (event.data == YT.PlayerState.ENDED) {
            currentVideoId++;
            if (currentVideoId < videoIDs.length) {
                player.loadVideoById(videoIDs[currentVideoId]);
            }
        }
    }
    
    function openNav() {
    var z = document.getElementById("mySidenav");
    if (z.style.width == "250px") {   
    z.style.width = "0";
    }else{
    z.style.width = "250px";
    z.style.display = "block";
    setTimeout(function(){
        document.getElementById('mySidenav').style.width = '0';
    }, 10000); // 10000ms = 10s	
    
    }
    }
    function closeNav() {
    document.getElementById("mySidenav").style.width = "0";
    }
    
  </script>
	<?php } ?>
