Viewing file: reproductor.php (21.65 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
setlocale (LC_TIME,"spanish");
//set listas a partir de distitnas fuentes ---------------------------------------------------------------------------------------
if(isset($_REQUEST['led'])){
$datos_led = toba::tabla('led')->get_led_por_codigo_activo($_REQUEST['led'], true);
if(!empty($datos_led['id_led'])) {
$id_lista_noticia = $datos_led['id_lista_noticia'];
$usar_streaming = $datos_led['usar_streaming'];
$usar_pantalla_negra = $datos_led['usar_pantalla_negra'];
}else{
echo "LED incorrecto";
exit;
}
$controles = '';
$navBulletsWrapper = false;
}else{
$usar_streaming = false;
$usar_pantalla_negra = false;
$controles = "controls";
$navBulletsWrapper = true;
$parametros = toba::memoria()->get_parametros();
$clave_get = toba::memoria()->get_parametro('fila_safe');
$claves_originales = toba_ei_cuadro::recuperar_clave_fila('2324', $clave_get); //Leds - Cuadro
//----- Obtengo datos necesarios ------------------------------------------------------------
if(isset($claves_originales['id_led']) and $_SESSION['cuadro_origen'] == 'leds_cuadro') {
$datos_led = toba::tabla('led')->get_led_activo($claves_originales['id_led']);
if(!empty($datos_led['id_lista_noticia'])) { $id_lista_noticia = $datos_led['id_lista_noticia']; }
}else{
$claves_originales = toba_ei_cuadro::recuperar_clave_fila('2330', $clave_get); //Listas de reproducción - Cuadro
//----- Obtengo datos necesarios ------------------------------------------------------------
if(isset($claves_originales['id_lista_noticia']) and $_SESSION['cuadro_origen'] == 'lista_reproduccion_cuadro') {
//$id_lista = null;
$id_lista_noticia = $claves_originales['id_lista_noticia'];
}
}
}
//----------- Set pantalla negra ---------------------------------------
$mostrar_pantalla_negra = false;
if($usar_pantalla_negra == 1) {
if(toba::tabla('feriado')->hay_feriado( date("Y-m-d") ) ){ //revisamos si es feriado
$dia = 'feriados';
}else{ //si no hay feriados, revisamos el dia
switch (date('N')) {
case 1: $dia = 'lunes'; break;
case 2: $dia = 'martes'; break;
case 3: $dia = 'miercoles'; break;
case 4: $dia = 'jueves'; break;
case 5: $dia = 'viernes'; break;
case 6: $dia = 'sabado'; break;
case 7: $dia = 'domingo'; break;
}
}
#$hora_desde = str_replace(':', '', $datos_led['hora_desde2']);
#$hora_hasta = str_replace(':', '', $datos_led['hora_hasta2']);
$hora_desde = str_replace(':', '', $datos_led['hora_'.$dia.'_desde']);
$hora_hasta = str_replace(':', '', $datos_led['hora_'.$dia.'_hasta']);
$hora_desde2 = str_replace(':', '', $datos_led['hora_'.$dia.'_desde2']);
$hora_hasta2 = str_replace(':', '', $datos_led['hora_'.$dia.'_hasta2']);
$hora_actual = date("His");
if( ($hora_actual >= $hora_desde and $hora_actual <= $hora_hasta) OR ($hora_actual >= $hora_desde2 and $hora_actual <= $hora_hasta2) ){
$imagen_pantalla_negra = 'img/fondo_pantalla_negra.png';
$mostrar_pantalla_negra = true;
}
}
//----------- Set streaming ---------------------------------------
$mostrar_streaming = false;
if($usar_streaming == 1) {
$hora_desde = str_replace(':', '', $datos_led['hora_desde']);
$hora_hasta = str_replace(':', '', $datos_led['hora_hasta']);
$hora_actual = date("His");
if( ($hora_actual >= $hora_desde and $hora_actual <= $hora_hasta) ){
$canal_streaming = $datos_led['canal_streaming'];
$mostrar_streaming = true;
}
}
//------------ Set noticias ---------------------------------------
if(!empty($id_lista_noticia)){
$datos_lista_noticia = toba::tabla('lista_noticia')->get_lista_noticia($id_lista_noticia);
if($datos_lista_noticia['estado'] == 'A'){
$noticias = toba::tabla('noticia')->get_noticias_lista($id_lista_noticia);
}else{
toba::notificacion()->agregar("Lista de Noticias #$id_lista_noticia Inactiva.", 'warning');
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="PUNTOCOM S.A.">
<link rel="icon" href="img/favicon.ico">
<title>AdminLED</title>
<link href="slider/js-image-slider.css" rel="stylesheet" type="text/css" />
<script src="slider/mcVideoPlugin.js" type="text/javascript"></script>
<script src="slider/js-image-slider.js" type="text/javascript"></script>
<link href="slider/generic.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
imageSlider.thumbnailPreview(function (thumbIndex) { return "<img src='img/fondo_video.png?t=" + (thumbIndex + 1) + "' style='width:180px;height:75px;' />"; });
</script>
<?php
if($navBulletsWrapper == false){
?>
<style type="text/css">
<!--
#slider div.navBulletsWrapper{
display: none;
visibility: hidden;
}
video{
cursor: none;
}
#slider{
cursor: none;
}
#slider .video {
cursor: none;
}
-->
</style>
<?php
}
?>
<?php
if($mostrar_streaming == true or $mostrar_pantalla_negra == true){
?>
<style type="text/css">
<!--
html, body {
height: 100%;
margin: 0; /* Reset default margin on the body element */
background: #000;
overflow: hidden;
}
iframe {
position: fixed;
background: #000;
border: none; /* Reset default border */
top: 0; right: 0;
bottom: 0; left: 0;
width: 100%;
height: 100%;
}
-->
</style>
<?php
}
?>
</head>
<body id="myimage">
<?php
//si usa pantalla negra la muestro
if($mostrar_pantalla_negra == true) {
echo '<img src="'.$imagen_pantalla_negra.'" />';
//si usa canal streaming lo invoca
}elseif($mostrar_streaming == true) {
if(!empty($canal_streaming)){
echo '<iframe frameborder="0" width="100%" height="100%" src="'.$datos_led['canal_streaming'].'&autoplay=true" allowfullscreen="true" webkitallowfullscreen="true" scrolling="no"></iframe>
';
}else{
echo "Error streaming";
}
//sino usa el reproductor
}else{
?>
<div id="sliderFrame">
<div id="slider" style="margin-bottom: <?php echo $alto_zolcalo_y_scroll; ?>">
<?php
//------------------------------------ Mostramos videos -----------------------------------------------
if(count($noticias)>0){
foreach($noticias as $dato){
switch ($dato['tipo']) {
case 'youtube':
//560 x 315 (16:9)
//800 x 450 (16:9)
echo '<a class="video" href="'.$dato['youtube'].'" data-autovideo="true">
<b data-src="img/fondo_video.png">'.$dato['descripcion'].'</b>
</a>';
break;
case 'url':
/*echo '
<!-- en vivo -->
<iframe class="video_ustream" src="http://www.ustream.tv/embed/20087208?wmode=direct" style="border: 0px none transparent; width: 1140px; height: 642px;" webkitallowfullscreen="" allowfullscreen="" frameborder="no"></iframe>
'; */
break;
case 'local':
echo '<video preload="none" data-image="img/fondo_video.png" '.$controles.' autoplay data-autovideo="true">
<source data-src="video/'.$dato['archivo_video'].'" type="video/mp4" />
</video>';
break;
case 'noticia':
//seteo imagen de fondo del slide noticia
switch ($dato['plantilla']) {
case 'C':
echo '<img src="img/fondo_video.png" alt="#caption'.$dato['id_noticia'].'" />';
break;
case 'B':
echo '<img src="img/fondo-noticia.png" alt="#caption'.$dato['id_noticia'].'" />';
break;
case 'A':
default:
echo '<img src="video/'.$dato['archivo'].'" alt="#caption'.$dato['id_noticia'].'" />';
break;
}
break;
case 'img':
//seteo imagen de fondo del slide noticia
switch ($dato['plantilla']) {
case 'C':
echo '<img src="img/fondo_video.png" alt="#caption'.$dato['id_noticia'].'" />';
break;
case 'B':
echo '<img src="img/fondo-noticia.png" alt="#caption'.$dato['id_noticia'].'" />';
break;
case 'A':
default:
echo '<img src="video/'.$dato['archivo'].'" alt="#caption'.$dato['id_noticia'].'" />';
break;
}
break;
default:
//echo '(desconocido)';
break;
}//fin switch tipo
} //fin foreach noticias
} //fin if(count($videos)>0){
?>
</div>
<!--thumbnails-->
<div id="thumbs" class="slider_div" data-autovideo="true" style="display: none;">
<?php
if(count($noticias)>0){
foreach($noticias as $key=>$dato){
switch ($dato['tipo']) {
case 'youtube':
case 'local':
echo '<div class="thumb slider_div">
<img src="img/fondo_video.png?t='.$key.'" /><div class="playvideo slider_div"></div>
</div>';
break;
case 'img':
case 'noticia':
default:
echo '<div class="thumb slider_div">
<img src="video/'.$dato['archivo'].'" />
</div>';
break;
}//fin switch tipo
}
}
?>
</div>
<div style="display: none;">
<?php
//recorre noticias para agregarle el html del frente
if(count($noticias)>0){
foreach($noticias as $dato){
if($dato['tipo'] == 'noticia' || $dato['tipo'] == 'img' ){
switch ($dato['plantilla']) {
case 'C':
echo '
<div id="caption'.$dato['id_noticia'].'" >
<div style="background-color: #fff; width: 100%; position: absolute; top: 0px; height: 27%" >
<div style="
margin: 0;
padding-bottom:1%;
font-size: 1.5vw;
text-transform: uppercase;
letter-spacing: 1px;
color: #000;
padding:1%;
padding-left:2%;
font-family: \'Open Sans\', sans-serif;
">'.$dato['copete'].'
</div>
<div style="
font-family: \'Open Sans\', sans-serif;
margin: 0;
padding-bottom:5%;
font-size: 4vw;
line-height: 1;
margin-bottom: 0;
color: #000;
padding-left:2%;
font-weight: bold;
">'.$dato['encabezado'].'
</div>
</div>
<div style="background-color: #fff; width: 100%; position: absolute; bottom: 25%; height: 48%">
<div style="position:absolute; left:4%; width:45%; height:100%;">
<img src="video/'.$dato['archivo'].'" alt="#caption'.$dato['id_noticia'].'" style="position:absolute;display:inline; width:100%; max-height: 100%;padding:1%;">
</div>
<div style= "position:absolute; left:51%; width:45%; height:100%;">
<img src="video/'.$dato['archivo_2'].'" alt="#caption'.$dato['id_noticia'].'" style="position:absolute;display:inline; width:100%; max-height: 100%;padding:1%;">
</div>
</div>
<div style="background-color: #fff; width: 100%; position: absolute; bottom: 0px; height: 25%">
<div style="
margin: 0;
font-size: 2.5vw;
line-height: 1.2;
padding:1%;
color: #000;
">'.$dato['bajada'].'
</div>
</div>
</div>';
break;
case 'B':
echo '
<div id="caption'.$dato['id_noticia'].'" >
<div style="position:absolute; left:1%; width:50%; height:96%;top: 2%">
<img src="video/'.$dato['archivo'].'" alt="#caption'.$dato['id_noticia'].'" style="position:absolute;display:inline;
width:100%; max-height:100%;">
</div>
<div style= "position:absolute; left:52%; width:46%; height:98%;top: 2%">
<div style="
margin: 0;
padding-bottom:5%;
font-size:1.5vw;
text-transform: uppercase;
letter-spacing: 1px;
color: #000;
font-family: \'Open Sans\', sans-serif;
">'.$dato['copete'].'
</div>
<div style="
font-family: \'Open Sans\', sans-serif;
margin: 0;
padding-bottom:10%;
font-size: 4vw;
line-height: 1;
margin-bottom: 0;
color: #000;
font-weight: bold;
">'.$dato['encabezado'].'
</div>
<div style="
margin: 0;
font-size: 2.5vw;
line-height: 1.2;
color: #000;
">'.$dato['bajada'].'
</div>
</div>
</div>';
break;
case 'A':
default:
if( is_null($dato['copete'])&& is_null($dato['encabezado']) && is_null($dato['bajada'])){
/* echo '
<div id="caption'.$dato['id_noticia'].'">
<div style="
position: absolute;
bottom: 0;
left: 0;
width: 96%;
overflow: hidden;
background-color: #000;
opacity: 0.8;
padding:2%">
</div>
</div>
'; */
} else {
echo '
<div id="caption'.$dato['id_noticia'].'">
<div style="
position: absolute;
bottom: 0;
left: 0;
width: 96%;
overflow: hidden;
background-color: #000;
opacity: 0.8;
padding:2%">
<div style="
font-family: \'Open Sans\', sans-serif;
margin: 0;
padding-bottom:1%;
font-size: 1.5vw;
text-transform: uppercase;
letter-spacing: 1px;
color: #fff;
font-weight: bold;
">'.$dato['copete'].'
</div>
<div style="
font-family: \'Open Sans\', sans-serif;
margin: 0;
padding-bottom:1%;
font-size: 3.5vw;
line-height: 1;
margin-bottom: 0;
color: #fff;
font-weight: bold;
">'.$dato['encabezado'].'
</div>
<div style="
margin: 0;
font-size: 2.2vw;
line-height: 1.2;
color: #fff;
font-weight: bold;
">'.$dato['bajada'].'
</div>
</div>
</div>
';
}
break;
}
}
}
}
?>
</div>
</div>
<?php
}
?>
</body>
</html>
|