Viewing file: video.php (4.43 KB) -rwxrwxr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!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">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="Ing. Diego Javier Menendez">
<link rel="icon" href="../../favicon.ico">
<title>Video reproductor</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Video -->
<link href="css/video.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css">
<!--
.navbar-header{
position: absolute;
z-index: 10;
background-color: #222;
}
.container-fluid {
height: 50px;
}
.noticias{
width:100%;
}
.noti_encabezado{
font-size: 18px; padding: 17px; background-color: #080808; margin: 0px;
}
.noti_bajada {
font-size: 18px; padding: 17px; color: #fff;
}
-->
</style>
</head>
<body style="background-color: #000; margin: 0px; padding: 0px;">
<div class="site_container">
<?php
//http://localhost/funciones/video/?mon=demo
$parametros = toba::memoria()->get_parametros();
$clave_get = toba::memoria()->get_parametro('fila_safe');
$claves_originales = toba_ei_cuadro::recuperar_clave_fila('2318', $clave_get); //Videos - Cuadro
//----- Obtengo datos necesarios ------------------------------------------------------------
if(isset($claves_originales['id_video'])) {
$id_video = $claves_originales['id_video'];
$video = toba::tabla('video')->get_video($id_video);
}elseif(isset($_REQUEST['id_video'])){
$id_video = $_REQUEST['id_video'];
$video = toba::tabla('video')->get_video($id_video);
}
if(!empty($video['id_video'])){
switch ($video['tipo']) {
case 'youtube':
//560 x 315 (16:9)
//800 x 450 (16:9)
if(empty(strpos($video['youtube'], '?'))){// ya tiene parametros, concatena con &
$url_paypal = $video['youtube'].'?autoplay=1';
}else{ //no tiene parametros, concatena con ?
$url_paypal = $video['youtube'].'&autoplay=1';
}
?>
<iframe width="800" height="450" src="<?php echo $url_paypal; ?>" frameborder="0" allowfullscreen style="margin:0px; padding:0px"></iframe>
<?php
break;
case 'url':
?>
(pendiente)
<?php
break;
case 'local':
default:
?>
<script type="text/javascript">
window.onload = function playlist(){
var reproductor = document.getElementById("backgroundvid"),
videos = ["video/<?php echo $video['archivo']; ?>"],
info = document.getElementById("info");
info.innerHTML = "Archivo: " + videos[0];
reproductor.src = videos[0];
reproductor.play();
reproductor.addEventListener("ended", function() {
var nombreActual = info.innerHTML.split(": ")[1];
var actual = videos.indexOf(nombreActual);
actual = actual == videos.length - 1 ? 0 : actual + 1;
this.src = videos[actual];
info.innerHTML = "Video: " + videos[actual];
this.play();
}, false);
}
</script>
<!-- <video src="http://localhost/funciones/video/entrevista.mp4" type="video/mp4" autoplay controls loop></video>-->
<!-- poster="placeholder.jpg" -->
<label style="color:#FFF;" id="info"></label>
<video id="backgroundvid" autoplay='autoplay' controls='controls' style="margin-bottom: 0px;"></video>
<?php
# code...
break;
}//fin switch tipo
} //fin no vacio video
?>
</div><!-- /.container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
|