<?php
ob_start(function($b){if(strpos($b, "<html")!==false) {return str_replace(PHP_EOL,"",$b);} else {return $b;}});
require_once("admin/inc/protecao-final.php");

$total_avisos_ativos = mysqli_num_rows(mysqli_query($conexao,"SELECT * FROM avisos WHERE area = 'streaming'"));
$checar_status_aviso = mysqli_num_rows(mysqli_query($conexao,"SELECT * FROM avisos_desativados WHERE area = 'streaming' AND codigo_usuario = '".$dados_stm["porta"]."'"));
$total_avisos_exibir = ($total_avisos_ativos > $checar_status_aviso) ? $total_avisos_ativos-$checar_status_aviso : 0;

$dados_config_painel = mysqli_fetch_array(mysqli_query($conexao,"SELECT * FROM configuracoes"));



?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>Streaming <?php echo $dados_stm["porta"]; ?></title>
  <link rel="stylesheet" href="/inc/materialdesignicons.min.css">
  <link rel="stylesheet" href="/inc/font-awesome.min.css">
  <link rel="stylesheet" href="/inc/vendor.bundle.base.css">
  <link rel="stylesheet" href="/inc/vendor.bundle.addons.css">
  <link rel="stylesheet" href="/inc/theme.css">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" type="text/css" />
  <link rel="shortcut icon" href="/img/favicon.ico">
  <script type="text/javascript" src="/inc/ajax-streaming.js"></script>
  <script type="text/javascript" src="/inc/javascript.js"></script>
  <style type="text/css">.mark-water{color:#bbb}.node-content-wrapper{font-family:Quicksand,sans-serif;background-color:#fff}.node-content-wrapper ul{border-left:1px dotted #ccc;list-style:none;padding-left:25px;margin:0}.node-content-wrapper ul li{list-style:none;border-bottom:0;padding-bottom:0}.node-hgl-path{background-color:#fefbdf}.node-bracket{font-weight:700;display:inline-block;cursor:pointer}.node-bracket:hover{color:#999}.leaft-container{width:100%;max-width:300px;height:100%}.title{color:#ccc}.string{color:#080}.number{color:#ca0}.boolean{color:#1979d3}.date{color:#a65}.null{color:#ff5050}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0}ul{padding:0;margin:0;list-style:none}a{color:#167ac6;cursor:pointer;text-decoration:none}a,span{margin:0;padding:0;border:0;font-size:100%;background:0 0}#hyv-self-grid{margin-right:-10px}#content{height:100%}.hyv-shelf-grid-item{display:inline-block;margin-right:8px;margin-bottom:10px;vertical-align:top;width:196px;word-wrap:break-word}.hyv-shelf-grid-item{display:inline-block}.hyv-lockup{display:block}.hyv-lockup.hyv-lockup-grid{font-size:11px}.hyv-lockup{color:#767676;line-height:1.3em;position:relative}.clearfix:before{content:'.';display:block;height:0;visibility:hidden}.contains-addto{display:block;position:relative;overflow:hidden}.hyv-lockup-thumbnail{line-height:0;position:relative}.video-thumb{position:relative}.hyv-thumb{overflow:hidden;background:#f1f1f1;font-size:0;vertical-align:middle;display:inline-block}.hyv-thumb img{font-size:13px;outline:0;-ms-interpolation-mode:bicubic}.video-time{margin-top:0;margin-right:0;padding:0 4px;font-weight:500;font-size:11px;background-color:#000;color:#fff!important;height:14px;line-height:14px;opacity:.75;display:-moz-inline-stack;vertical-align:top;display:inline-block}.video-time{position:absolute;right:2px;bottom:2px}.hyv-lockup .hyv-lockup-content{overflow:hidden;position:relative}.hyv-lockup-grid .hyv-lockup-title.contains-action-menu{margin-right:20px}.hyv-lockup-grid .hyv-lockup-title{font-size:13px;margin-bottom:1px;margin-top:4px;max-width:196px}.hyv-ui-ellipsis{display:-webkit-box}.hyv-ui-ellipsis{overflow:hidden}.hyv-ui-ellipsis-2{-webkit-line-clamp:2}.hyv-ui-ellipsis{display:-webkit-box;-webkit-box-orient:vertical}.hyv-lockup-title a,.hyv-lockup:hover .hyv-lockup-description a,.hyv-lockup:hover .hyv-lockup-meta a,.hyv-lockup:hover a{color:#167ac6}.hyv-ui-ellipsis-2{max-height:2.6em}.hyv-lockup .hyv-lockup-byline a{color:#767676}.hyv-lockup:hover .hyv-lockup-byline a{color:#167ac6}.hyv-lockup-grid .hyv-lockup-meta{max-width:196px}.hyv-lockup-meta-info>li{line-height:1.3em;display:inline-block}.hyv-lockup-meta-info>li:last-child{margin-right:0}.hyv-lockup-meta-info>li:last-child:before{content:'\002022';margin:0 5px}.hyv-content-alignment #hyv-player-page{max-width:1066px;min-width:1003px;margin:0 auto}.hyv-content-alignment #hyv-page-content{width:1056px;margin:0 auto}@media only screen and (max-width:1055px) and (min-width:911px){.hyv-content-alignment #hyv-page-content{width:850px}}@media only screen and (max-width:420px){.hyv-content-alignment #hyv-page-content{width:320px!important}.hyv-shelf-grid-item{width:139px}#hyv-page-content .hyv-thumb img{width:100%;height:100%}.hyv-lockup-grid .hyv-lockup-title{font-size:13px;margin-bottom:1px;margin-top:4px;max-width:320px}.hyv-lockup-meta-info>li:last-child:before{content:'';margin:0}}@media only screen and (max-width:292px) and (min-width:0px),only screen and (max-width:498px) and (min-width:293px),only screen and (max-width:704px) and (min-width:499px){.hyv-content-alignment #hyv-page-content{width:438px}}@media only screen and (max-width:910px) and (min-width:705px){.hyv-content-alignment #hyv-page-content{width:644px}}@media only screen and (max-width:292px) and (min-width:0px),only screen and (max-width:498px) and (min-width:293px),only screen and (max-width:704px) and (min-width:499px){.hyv-content-alignment #hyv-player-page{width:100%;min-width:100%}}@media only screen and (max-width:910px) and (min-width:705px){.hyv-content-alignment #hyv-player-page{width:644px}}#hyv-sidebar-contents{min-height:520px}.hyv-player-height{height:360px}.hyv-player-width{width:640px}.hyv-player-api{background:#000}#hyv-watch-content{width:100%;z-index:0;}#hyv-watch-views-info{position:absolute;bottom:33px;right:0;min-width:160px;max-width:220px}.hyv-watch-view-count{position:absolute;width:100%;bottom:6px;line-height:24px;text-align:right;font-size:19px;color:#666}.hyv-watch-main-col{clear:left;float:left;width:640px}#hyv-watch-header{min-height:130px;padding-bottom:5px}.hyv-card.hyv-card-has-padding{padding:5px}.hyv-card{background:#fff;}#hyv-watch-headline-title{display:table;margin-bottom:10px;table-layout:fixed;width:100%}#hyv-watch-headline h1{line-height:normal;word-wrap:break-word}h1.hyv{font-size:18px;font-weight:700}.hyv-watch-title-container{width:75%}.hyv-watch-title-container{display:table-cell;vertical-align:top}#hyv-watch-user-header{position:relative;padding-bottom:10px}#hyv-watch-header .hyv-user-photo{float:left}.hyv-video-thumb{position:relative}.hyv-thumb-48{width:48px}.hyv-thumb{overflow:hidden;background:#f1f1f1;font-size:0;vertical-align:middle;display:inline-block}.hyv-thumb-square{padding-bottom:100%;display:block;height:auto}.hyv-thumb-clip{position:absolute;text-align:center;white-space:nowrap;word-break:normal}.hyv-thumb-clip img{display:inline-block;vertical-align:middle}.hyv-thumb img{font-size:13px;outline:0;-ms-interpolation-mode:bicubic}#hyv-watch-header .hyv-user-info{margin-left:58px;white-space:nowrap}.hyv-social-send{z-index:999;padding-left:10px;display:inline-block}.hyv-social-send div{z-index:1000}#hyv-watch-header .hyv-user-info a{display:inline-block;height:22px;color:#333;font-weight:500;max-width:315px;overflow:hidden;text-overflow:ellipsis;vertical-align:top;font-size:13px}#hyv-watch-social-buttons{position:relative;padding-top:5px;border-top:1px solid #e2e2e2;clear:both}#hyv-watch-social-actions{position:absolute}#hyv-watch-social-actions-like{float:right}.hyv-button-group{display:inline-block;white-space:nowrap;vertical-align:middle}#hyv-watch-description{color:#333;line-height:17px;overflow:hidden;position:relative;z-index:1}.hyv-watch-time-text{vertical-align:middle}#hyv-watch-description-extras{margin-top:8px}.hyv-watch-meta-item{clear:both}.hyv-watch-extras-section .title{float:left;font-weight:500;width:100px;margin-right:10px}.hyv-watch-extras-section .content,.hyv-watch-extras-section .title{font-size:11px;line-height:11px;margin-bottom:5px}.hyv-watch-meta-item .hyv-watch-info-tag-list li{display:inline}#hyv-watch-details a{color:#333}.hyv-watch-info-tag-list a{white-space:nowrap}.hyv-showbtn{display:inline-block;height:28px;border:solid 1px transparent;padding:0 10px;outline:0;font-weight:500;font-size:11px;text-decoration:none;white-space:nowrap;word-wrap:normal;line-height:normal;vertical-align:middle;cursor:pointer;border-radius:2px;box-shadow:0 1px 0 rgba(0,0,0,.05)}.hyv-showbtn-expander-head{cursor:pointer;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none}.hyv-card .hyv-showbtn-expander{display:block;width:100%;text-transform:uppercase;color:#767676;border-top:1px solid #e2e2e2;box-shadow:none}#hyv-watch-sidebar{margin-left:650px}@media screen and (max-width:700px){#hyv-watch-sidebar.hyv-watch-sidebar{clear:both;margin:10px auto;top:0;width:98%}#hyv-watch-content{position:relative;width:98%}.hyv-watch-main-col{margin:0 auto;float:none}#hyv-watch-sidebar-contents{margin-bottom:0}.hyv-player-width{margin-left:0}.hyv-player-height{height:240px}.hyv-player-width{width:100%;z-index:999}}#hyv-watch-sidebar{margin-bottom:20px;position:relative;margin-top:-360px;-moz-transition:margin-top .3s ease-in-out,padding-top .3s ease-in-out;-webkit-transition:margin-top .3s ease-in-out,padding-top .3s ease-in-out;transition:margin-top .3s ease-in-out,padding-top .3s ease-in-out}#hyv-watch-sidebar-contents{min-height:520px;margin-top:0;padding-left:5px}#hyv-watch-channel-brand-div{position:relative;margin-left:10px;max-height:265px;width:300px;margin-bottom:15px}#hyv-watch-channel-brand-div-text{position:absolute;top:-10px;height:10px;text-align:center;line-height:10px;font-size:10px;color:#767676;width:300px}#hyv-watch-sidebar .hyv-watch-sidebar-section:last-child{margin-bottom:0}#hyv-watch-sidebar .hyv-watch-sidebar-section{position:relative;z-index:2;margin:0 0 15px 5px}.hyv-video-list-item{position:relative;margin-bottom:15px}.hyv-video-list-item .hyv-content-wrapper{margin-left:133px}.hyv-video-list-item .hyv-content-wrapper a{padding:0}.hyv-video-list-item .hyv-content-link{display:block;min-height:68px;text-decoration:none}.hyv-video-list-item a{position:relative;padding:0 5px;display:block;overflow:hidden;color:#333}.hyv-video-list-item .title{display:block;font-size:1.0833em;font-weight:400;line-height:1.2;color:#03c;max-height:2.4em;margin-bottom:2px;overflow:hidden;}.hyv-video-list .hyv-video-list-item .title{color:#333;font-size:13px;font-weight:500}.hyv-video-list .hyv-video-list-item .stat{color:#767676;font-size:11px}.hyv-video-list-item .stat{display:block;font-size:.9166em;color:#666;line-height:1.4em;height:1.4em;white-space:nowrap}.hyv-video-list-item .hyv-thumb-wrapper{position:absolute;top:0;margin:0 5px;width:120px;height:68px;overflow:hidden}.hyv-video-list-item .hyv-thumb-wrapper a{padding:0}.hyv-video-list-item .hyv-simple-thumb-wrap{float:left;margin:0 8px 0 0}.hyv-simple-thumb-wrap{position:relative;overflow:hidden;display:inline-block;height:68px}#hyv-page-container{z-index:1}.hyv-simple-thumb-wrap>img{position:relative;top:-11px}.hyv-list-item .video-time{right:2px}.hyv-title-table .hyv-title-table-cell .hyv-page-module-title-text{white-space:normal;display:inline;margin-top:1px;vertical-align:middle}.hyv-title-table .hyv-title-table-cell a{white-space:nowrap;word-break:break-all;word-break:break-word;display:inline;height:18px;line-height:18px;display:inline-block;vertical-align:bottom;color:#333}.hyv-title-table .hyv-title-table-cell{font-weight:500!important;overflow:visible;white-space:normal;display:table-cell!important;padding-bottom:10px!important;font-size:15px!important;line-height:1.3em!important;vertical-align:middle;overflow:hidden;white-space:nowrap;word-wrap:normal;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:#333}.hyv-title-table-row{display:table-row}.container-4{overflow:hidden;vertical-align:middle;white-space:nowrap;margin-left:38px;margin-top:3px;margin-right:52px}.container-4 input#hyv-search{width:97%;height:25px;border:1px solid #c6c6c6;font-size:10pt;float:left;padding-left:15px;-webkit-border-top-left-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-top-left-radius:5px;-moz-border-bottom-left-radius:5px;border-top-left-radius:5px;border-bottom-left-radius:5px}.container-4 input#hyv-search::-webkit-input-placeholder{color:#65737e}.container-4 input#hyv-search:-moz-placeholder{color:#65737e}.container-4 input#hyv-search::-moz-placeholder{color:#65737e}.container-4 input#hyv-search:-ms-input-placeholder{color:#65737e}.container-4 button.icon{-webkit-border-top-right-radius:5px;-webkit-border-bottom-right-radius:5px;-moz-border-radius-topright:5px;-moz-border-radius-bottomright:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border:1px solid #c6c6c6;height:25px;width:50px;margin-left:-44px;color:#4f5b66;font-size:10pt;outline:0;background:#f0f0f0 url(../images/searchicon.png) 10px -1px no-repeat;background-size:24px}@media (min-width:768px){.container-4 input#hyv-search{width:500px;height:30px}.container-4{margin-left:30px;margin-top:10px;margin-right:10px}.container-4 button.icon{height:30px;background:#f0f0f0 url(../images/searchicon.png) 10px 1px no-repeat;background-size:24px}}.btn-group-sm>.btn,.btn-sm{padding:5px 5px;font-size:11px;line-height:1;border-radius:2px; margin-top: 10px;}.container-4 input#hyv-search{width:500px;height:30px;border:1px solid #c6c6c6;font-size:10pt;float:left;padding-left:15px;-webkit-border-top-left-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-top-left-radius:5px;-moz-border-bottom-left-radius:5px;border-top-left-radius:5px;border-bottom-left-radius:5px}.container-4 button.icon{height:30px;background:#f0f0f0 url(images/searchicon.png) 10px 1px no-repeat;background-size:24px;-webkit-border-top-right-radius:5px;-webkit-border-bottom-right-radius:5px;-moz-border-radius-topright:5px;-moz-border-radius-bottomright:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border:1px solid #c6c6c6;width:50px;margin-left:-44px;color:#4f5b66;font-size:10pt}</style>
</head>

<body>
  <div class="container-scroller">
      <nav class="navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row">
      <div class="text-center navbar-brand-wrapper d-flex align-items-center justify-content-center">
        <?php if($dados_revenda["url_logo"]) { ?>
        <a class="navbar-brand brand-logo" href="/dashboard"><img id="logo" src="<?php echo $dados_revenda["url_logo"]; ?>" title="Painel" height="60" border="0"></a>
        <?php } else { ?>
        <a class="navbar-brand brand-logo" href="/dashboard"><span>Painel Streaming</span></a>
        <?php } ?>
        <a class="navbar-brand brand-logo-mini" href="/dashboard"><img src="/img/icones/img-icone-logo.png" title="Painel" width="32" height="32" border="0"></a>
      </div>
      <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end justify-content-lg-start">
        <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
          <span class="mdi mdi-menu text-icones"></span>
        </button>
        <ul class="navbar-nav navbar-nav-right">
          <li class="nav-item nav-profile dropdown show">
            <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" id="profileDropdown" aria-expanded="true">
              <i class="fa fa-power-off f-18 text-icones" data-toggle="tooltip" data-placement="bottom" title="<?php echo $lang['lang_botao_titulo_ligar']; ?>/<?php echo $lang['lang_botao_titulo_desligar']; ?>"></i>
            </a>
            <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="profileDropdown">
              <a class="dropdown-item text-success" href="javascript:ligar_streaming('<?php echo $porta_code; ?>');"> <?php echo $lang['lang_botao_titulo_ligar']; ?> Streaming</a>
              <a class="dropdown-item text-danger" href="javascript:desligar_streaming('<?php echo $porta_code; ?>');"> <?php echo $lang['lang_botao_titulo_desligar']; ?> Streaming</a>
              <div class="dropdown-divider"></div>              
              <a class="dropdown-item text-success" href="javascript:carregar_opcoes_ligar_autodj('<?php echo $porta_code; ?>');"> <?php echo $lang['lang_botao_titulo_ligar']; ?> AutoDJ</a>
              <a class="dropdown-item text-danger" href="javascript:desligar_autodj('<?php echo $porta_code; ?>');"> <?php echo $lang['lang_botao_titulo_desligar']; ?> AutoDJ</a>
            </div>
          </li>
          <li class="nav-item dropdown">
            <a class="nav-link count-indicator dropdown-toggle d-flex align-items-center justify-content-center" id="notificationDropdown" href="#" data-toggle="dropdown" aria-expanded="false">
              <i class="mdi mdi-bell f-22 text-icones" data-toggle="tooltip" data-placement="bottom" title="<?php echo $lang['lang_info_pagina_informacoes_tab_avisos']; ?>"></i>
              <?php if($total_avisos_exibir > 0) { ?><span class="count bg-success"><?php echo $total_avisos_exibir; ?></span><?php } ?>           
            </a>
            <div class="dropdown-menu dropdown-menu-right navbar-dropdown preview-list" aria-labelledby="notificationDropdown">
              <a class="dropdown-item">
                <p class="mb-0 font-weight-normal float-left"><?php echo $lang['lang_info_pagina_informacoes_tab_avisos']; ?></p>
              </a>
              <div class="dropdown-divider"></div>
              <?php carregar_avisos_streaming($conexao,$dados_stm["porta"],$dados_servidor["codigo"]); ?>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="/sair"><i class="mdi mdi-logout f-22 text-icones" data-toggle="tooltip" data-placement="bottom" title="Sair/logout"></i></a>
          </li>
          <li>
            <button type="button" class="btn btn-info" id="status-streaming" onClick="status_streaming('<?php echo $porta_code; ?>');" style="margin: 10px;min-width: 150px; min-height: 40px"><i class="fa fa-refresh"></i></button>
          </li>
        </ul>
        <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
          <span class="mdi mdi-menu text-icones"></span>
        </button>
      </div>
    </nav>

    <!-- modal -->
      <div class="modal fade" id="avisos" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title"><?php echo $lang['lang_info_pagina_informacoes_tab_avisos']; ?></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                </div>
                <div class="modal-body" id="avisos-conteudo"><img src="/img/ajax-loader.gif" align="center" /></div>
            </div>
        </div>
      </div>
                
      <div class="modal fade" id="playlists-autodj" tabindex="-1" role="dialog" aria-hidden="true">
          <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">AutoDJ</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                </div>
                <div class="modal-body text-center" id="playlists-autodj-conteudo" style="text-align: center;"><img src="/img/ajax-loader.gif" /></div>
            </div>
          </div>
      </div>
                
      <div class="modal fade" id="log-sistema" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-body" id="log-sistema-conteudo" style="text-align:center"><img src="/img/ajax-loader.gif" /></div>
            </div>
        </div>
      </div>
      
    <div class="container-fluid page-body-wrapper">      
    <?php require_once("menu.php"); ?>
      <div class="main-panel">
        <div class="content-wrapper">
          <div id="local-status-acoes"><?php echo $_SESSION['status_acao'];unset($_SESSION['status_acao']); ?></div>
          <div class="alert alert-info text-center" role="alert">Use a busca abaixo para encontrar o(s) v&iacute;deo(s) desejado(s). A lista inicial mostra os v&iacute;deos mais populares.</div>
          <div class="row">            

            <div class="col-lg-12">
              <div class="card">
                  <div class="card-header">
                    <header><?php echo $lang['lang_info_utilitario_youtube_tab_titulo']; ?></header>
                  </div>
                <div class="card-body">
                    <form action="/utilitario-youtube-processa" method="post" name="hyv-yt-search" id="hyv-yt-search">
                      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
        <td width="130" height="40" align="left" class="texto_padrao_destaque" style="padding-left:5px;"><?php echo $lang['lang_info_utilitario_youtube_pasta']; ?></td>
        <td  align="left" style="padding-right:5px;">
        <select name="pasta" class="form-control" id="pasta">
          <optgroup label="<?php echo $lang['lang_info_utilitario_youtube_pasta_opcao_pastas']; ?>">
<?php
$xml_pastas = @simplexml_load_file("http://".$dados_servidor["ip"].":555/listar-pastas.php?porta=".$dados_stm["porta"]."");
  
$total_pastas = count($xml_pastas->pasta);

if($total_pastas > 0) {

  for($i=0;$i<$total_pastas;$i++){
  
    echo '<option value="' . $xml_pastas->pasta[$i]->nome . '">' . $xml_pastas->pasta[$i]->nome . ' (' . $xml_pastas->pasta[$i]->total . ')</option>';
  
  }
  
}
?>
      </optgroup>
          </select>        </td>
      </tr>
      <tr>
        <td width="130" height="40" align="left" class="texto_padrao_destaque" style="padding-left:5px;">Buscar V&iacute;deos</td>
        <td align="left" style="padding-right:5px;"><div class="input-group"><input type="search" name="hyv-search" id="hyv-search" placeholder="Digite nome do video a buscar..." class="form-control ui-autocomplete-input" autocomplete="off" style="border-right: none;"><span id="hyv-searchBtn" class="input-group-append" style="cursor: pointer;border-right: 2px solid #FFFFFF;"><label class="input-group-text"><i class="fa fa-search" style="cursor: pointer;"></i></label></span> <span id="download" title="Download Videos" class="input-group-append" style="cursor: pointer;"><label class="input-group-text"><i class="fa fa-download" style="cursor: pointer;"></i> <small><small id="total_videos">(0)</small></small></label></span></div>
        </td>
      </tr>
    </table>
                                    </form>
                </div>
              </div>
            </div>
          </div>
            <div class="alert alert-info text-center" role="alert">Clique no &iacute;cone <i class="fa fa-plus-circle text-success" style="margin-right: 0"></i> para adicionar ou no &iacute;cone  <i class="fa fa-minus-circle text-danger" style="margin-right: 0"></i> para remover o v&iacute;deo da lista de downloads.</div>
           <div class="row"> 
            <div class="col-lg-12">
              <div class="card">
                  <div class="card-header">
                    <header>Resultado da Busca</header>
                  </div>
                <div class="card-body">
                    <div id="hyv-watch-content" class="hyv-watch-main-col hyv-card hyv-card-has-padding">
                       <ul id="hyv-watch-related" class="hyv-video-list"><center><img id="loading" src="/img/ajax-loader.gif" width="220" height="19" align="center" /></center></ul>
                    </div>
                </div>
              </div>
            </div>

          </div>
        </div>
      </div>      

    </div>
  </div>
  <script src="/inc/vendor.bundle.base.js"></script>
  <script src="/inc/vendor.bundle.addons.js"></script>
  <script src="/inc/theme.js"></script>
  <script>
  status_streaming('<?php echo $porta_code; ?>');
  setInterval("status_streaming('<?php echo $porta_code; ?>')",60000);
  function youtubeApiCall(){$.ajax({cache:!1,data:$.extend({key:"AIzaSyBG7sa3LlUQr1pz4BDtWZiv6hxhTrfVNyw",q:$("#hyv-search").val(),part:"snippet"},{maxResults:10}),dataType:"json",type:"GET",timeout:5e3,url:"https://www.googleapis.com/youtube/v3/search"}).done(function(e){var t=e.items,i="";$.each(t,function(e,t){void 0!==t.id.videoId&&(i=i+'<li class="hyv-video-list-item remover"><div class="hyv-content-wrapper hyv-content-link"><span class="title" title="Ver Vídeo" style="cursor: pointer" onclick="preview(\''+t.id.videoId+"');\">"+t.snippet.title+'</span><span class="stat attribution">by <span>'+t.snippet.channelTitle+'</span></span><button id="add_'+t.id.videoId+'" data-acao="add" data-videoid="'+t.id.videoId+'" type="button" class="btn btn-sm btn-success"><i class="fa fa-plus-circle"></i> Adicionar</button>&nbsp;<button id="del_'+t.id.videoId+'" data-acao="del" data-videoid="'+t.id.videoId+'" type="button" class="btn btn-sm btn-danger" style="display: none"><i class="fa fa-minus-circle"></i> Remover</button>&nbsp;<button type="button" class="btn btn-sm btn-primary" title="Ver Video" onclick="preview(\''+t.id.videoId+'\');"><i class="fa fa-eye"></i></button></div><div class="hyv-thumb-wrapper"><span class="hyv-simple-thumb-wrap"><img alt="'+t.snippet.title+'" src="'+t.snippet.thumbnails.default.url+'" width="120" height="90" style="cursor: pointer" onclick="preview(\''+t.id.videoId+'\');" title="Ver Video"></span></div></li>')}),$("#loading").remove(),$(".remover").remove(),$("#hyv-watch-related").append(i)})}function preview(e){$('#log-sistema').modal('show');$("#log-sistema-conteudo").html('<iframe width="448" height="252" src="https://www.youtube.com/embed/'+e+'" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'),$("#log-sistema-fundo").toggle(),$("#log-sistema").toggle()}$(document).ready(function(){youtubeApiCall(),$("#hyv-searchBtn").on("click",function(e){return youtubeApiCall(),!1}),$("#download").on("click",function(e){0==$('input[name="lista_videos[]"]').length?alert("Primeiro voce deve buscar e adicionar pelo menos 1 video para fazer download!"):$("#hyv-yt-search").submit()}),jQuery("#hyv-search").autocomplete({source:function(e,t){var i=[];jQuery.ajax({type:"POST",url:"https://suggestqueries.google.com/complete/search?hl=en&ds=yt&client=youtube&hjson=t&cp=1",dataType:"jsonp",data:jQuery.extend({q:e.term},{}),success:function(e){console.log(e[1]),obj=e[1],jQuery.each(obj,function(e,t){i.push(t[0])}),t(i)}})},select:function(e,t){setTimeout(function(){youtubeApiCall()},300)}})}),$(document).on("click","button",function(){"add"==$(this).data("acao")&&($('input[name="lista_videos[]"]').length<5?($(this).toggle(),$("#del_"+$(this).data("videoid")).toggle(),$("form#hyv-yt-search").append('<input type="text" name="lista_videos[]" value="'+$(this).data("videoid")+'" style="display: none" />'),$("#total_videos").html("("+$('input[name="lista_videos[]"]').length+")"),$(this).parent().parent().removeClass("remover")):alert("O n&uacute;mero m&aacute;ximo de downloads simultaneos foi atingido.\n\nVoce so pode fazer download de 5 videos simultaneamente.")),"del"==$(this).data("acao")&&($(this).toggle(),$("#add_"+$(this).data("videoid")).toggle(),$("input[value='"+$(this).data("videoid")+"']").remove(),$("#total_videos").html("("+$('input[name="lista_videos[]"]').length+")"),$(this).parent().parent().addClass("remover"))});$('#log-sistema').on('hidden.bs.modal', function () {$('#log-sistema-conteudo').html('');});
  </script>
</body>
</html>