Formulario para reproducir video de Fembed con Proxy

  • Autor Autor zcriptz
  • Fecha de inicio Fecha de inicio
zcriptz

zcriptz

1
Ómicron
Programador
Verificación en dos pasos activada
Verificado por Whatsapp
Suscripción a IA
Usando el código PHP que publiqué en este tema:

Solo cambié:
PHP:
$url = 'https://feurl.com/v/kkxeds3jqnge83q';

Por:
PHP:
$url = $_GET['url'];

Lo guardé y nombré fembed.php

Puede adelantarse/atrasarse el video.

Código HTML/Javascript: (Debe guardarse en un archivo a parte, no en el mismo)
Insertar CODE, HTML o PHP:
<html>
    <head>
        <script>
            function makePlayer(){
                videoElement = document.createElement('video');
                videoElement.className = 'video-js';
                videoElement.style = 'width:100%;height:100%';
                document.body.appendChild(videoElement);
            }
            function playVideo(url){
                if(!window.videoElement)
                    makePlayer();
                ;
                videoForm = document.getElementById('videoForm');
                videoElement.src = 'fembed.php?url='+encodeURI(url);
                videoElement.play();
                videoElement.controls = 1;
                videoElement.onplay = function(){ videoForm.style.display = 'none' };
                videoElement.onpause = function(){ videoForm.style.display = '' };
                return false
            }
        </script>
        <style>
            body{
                margin:0;
                padding:0;
                background:black;
                color:white;
                width:100%;
                height:100%;
            }
            #videoForm{
                z-index:2;
                position:absolute;
                line-height:50px;
                font-size:20px;
            }
            #urlInput{
                width:300px;
            }
        </style>
    </head>

    <body>
      <form id="videoForm" method="post" onsubmit="return playVideo(document.getElementById('urlInput').value)">
        URL de Fembed: <input id="urlInput" type="text"><input type="submit" value="Reproducir">
      </form>
    </body>
</html>

Al ponerle pausa vuelve a mostrar el formulario arriba del video para poder colocar otra URL.


Les puede ayudar a aprender a crear elementos, y a usar <video>. 👍
 
Última edición:
Y luego porque tengo que cerrar fembed y mystream xD
 
Funciona! Muchas gracias!!, me gustaria cambiar el reproductor.
 
Excelente muchas gracias. Una pregunta.
Se podría implementar algo como esto para descargar?
 
Atrás
Arriba