Ver Mensaje Individual
  #3 (permalink)  
Antiguo 25/03/2015, 12:48
Avatar de omar_gutierrez
omar_gutierrez
 
Fecha de Ingreso: febrero-2011
Mensajes: 144
Antigüedad: 13 años, 2 meses
Puntos: 2
Respuesta: pausar video html5

Gracias por responder Alexis. Funciona excelente, hay disculpen si me tarde en regresar aqui, segui investigando el caso y di con informacion (http://stackoverflow.com/) que me sirvio.

Dejare el esqueleto del proyecto que tengo por si alguien lo llega a requerir

Código HTML:
<meta charset="utf-8">
    
<div style="width:720px; margin: 0 auto; padding:0; border:0; ">

<div id="MENU" style="display:none; position:relative; top: 100px; z-index:999; padding:0; border:0;">
<button id="maquila" style="color:#fff; background-color:#f00; width:140px; padding:0; border:0; margin:0;" onclick="maquilair()" type="button">Ir a maquila</button>
<button id="lejos" style="color:#fff; left: 315px; background-color:#f00; width:140px; padding:0; border:0; margin:0;" onclick="lejosir()" type="button">Ir Lejos</button>
<button id="lejos" style="color:#fff; left: 315px; background-color:#f00; width:140px; padding:0; border:0; margin:0;" onclick="altoteir()" type="button">Super alto</button>
<button id="repetir" style="z-index:99999; color:#fff; left: 315px; background-color:#f00; width:140px; padding:0; border:0; margin:0; display:none;" onclick="otravez()" type="button">¡OTRA VEZ!</button>
</div>
    <video id="myVideo" width="700" autoplay>
     
      <source src="http://player.vimeo.com/external/122806127.mobile.mp4?" type="video/mp4">
      Your browser does not support HTML5 video.
    </video>
    
</div>

<script src="//code.jquery.com/jquery-1.11.2.js"></script>
<script>
$(document).ready(function() {
    document.getElementById('myVideo').addEventListener("timeupdate", function() {
        if(this.currentTime > 2 & this.currentTime < 2.5) {
            $("#MENU").show();
            myVideo.pause();
        }
        if(this.currentTime > 3 ) {
            $("#MENU").hide();

        }
        if(this.currentTime > 54.5 ) {
            $("#MENU").hide();

        }
        if(this.currentTime > 135.5 ) {
            $("#MENU").show();
            $("#repetir").show();
            myVideo.pause();
        }

    });
    
     $("#repetir").click(function(){
        $("#repetir").hide();
         $("#MENU").hide();
     });
    
});
    
    

var vid = document.getElementById("myVideo");

function maquilair() { 
    vid.currentTime=94;
    vid.play();
};

function lejosir() { 
    vid.currentTime=34;
    vid.play();
}
function otravez() {
    vid.currentTime=0;
    vid.play();
}
function altoteir() {
    vid.currentTime=55;
    vid.play();
}
</script>