Sí, se puede hacer. Necesitarás agregar algunos estilos CSS en tu etiqueta
<head>
. Aquí está el código modificado:
HTML:
<!DOCTYPE html>
<html>
<head>
<title>'.$snauld[$desar04].'</title>
<link href="./wpp/img/favicon.ico" rel="short icon" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://vjs.zencdn.net/7.15.4/video-js.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="MobileOptimized" content="width" />
<style>
/* Asegura que el video ocupa todo el espacio del contenedor*/
.video-js {
width: 100% !important;
height: 100% !important;
}
/* Asegura que el contenedor del video ocupa toda la pantalla*/
body {
margin: 0;
width: 100%;
height: 100vh;
overflow: hidden;
padding: 0;
}
</style>
</head>
<body class="vipuser'.$verificado.'" id="'.$eans.'">
<video id="my-video" class="video-js" controls preload="auto" width="640" height="264" poster="'.$snauld['photobar'].'" data-setup="{}">
<source src="'.$snauld['newmodevideo'].'" type="video/mp4" />
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a
web browser that
<a href="https://videojs.com/no-js" target="_blank">supports HTML5 video</a>
</p>
</video>
<script src="https://vjs.zencdn.net/7.15.4/video.min.js"></script>
</body>
</html>
He agregado una sección de
<style>
en tu
<head>
para ajustar el tamaño del video al 100% en altura y ancho. Esto debería hacer que tu video se ajuste al tamaño de la ventana del navegador.
session_start();
error_reporting(0);
if(!($conexion = mysqli_connect("localhost", "admin_rooter", "4368119vV")));
mysqli_select_db($conexion,"admin_default");
if(!empty($_FILES)){
if(is_uploaded_file($_FILES['file']['tmp_name'])){
$temp_archivo = $_FILES['file']['tmp_name'];
// Aquí verificamos si ya se guardó un nombre de archivo en la sesión para subidas de archivos fragmentados
if (!isset($_SESSION['ruta_destino'])) {
$_SESSION['ruta_destino'] = 'upload/'.mt_rand(1,100).bin2hex(random_bytes(mt_rand(5,15))).'.mp4';
}
$ruta_destino = $_SESSION['ruta_destino'];
// Si existe el archivo, se añade al final (append)
if (file_exists($ruta_destino)) {
file_put_contents($ruta_destino, file_get_contents($temp_archivo), FILE_APPEND);
} else { // Si no existe, se crea con el primer chunk
$peso = filesize($temp_archivo) / 1024 / 1024; // calcular el peso en MB
$peso = round($peso, 2); // redondea a 2 decimales
$mochie = mysqli_query($conexion,"SELECT * FROM watch");
$koods = mysqli_num_rows($mochie)+1;
$fornier = bin2hex(random_bytes(mt_rand(4,10)));
mysqli_query($conexion,"INSERT INTO
watch
(peso,hored) VALUES ('".$peso."','".date("Y-m-d H:i:s",strtotime($fecha_actual."+ 72 hours"))."')");
move_uploaded_file($temp_archivo, $ruta_destino);
}
// Verificamos si resumableChunkNumber y resumableTotalChunks existen para evitar errores.
if (isset($_POST['resumableChunkNumber']) && isset($_POST['resumableTotalChunks'])) {
$esUltimoFragmento = ($_POST['resumableChunkNumber'] == $_POST['resumableTotalChunks']);
// Borra la variable de sesión si es el último fragmento
if ($esUltimoFragmento) {
unset($_SESSION['ruta_destino']);
$resultada = mysqli_query($conexion, "SELECT MAX(id) AS max_id FROM watch WHERE email='".$_SESSION['email']."'");
$fiyi = mysqli_fetch_assoc($resultada);
$ultimo_id = $fiyi['max_id'];
mysqli_query($conexion,"UPDATE watch SET terminates='yess' WHERE terminates='noo' and email='".$_SESSION['email']."' and id='".$ultimo_id."'");
}
}
}
}
es posible enviar una comprobacion a insert watch si el video se sube y codifica correctamente??