Cerrar video cuando termina en iOS

4/Sep/2014 381

En iOS, cuando intentamos utilizar un elemento <video /> nos vemos obligados a que el player del dispositivo se haga cargo. No podemos aplicar autoplay ni responder a su comportamiento, ya que es intrínseco del sistema operativo y no del browser. Felizmente iOS implementó un callback el cual responde a eventos del video y en este caso, responde cuando el video termina. Cuando tocamos un video podemos saber el final de éste y aplicar algún evento mediante JavaScript.

Dado el siguiente elemento de video:

<video id="video" controls>
<source src="http://vjs.zencdn.net/v/oceans.webm" type="video/webm"></source>
<source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4"></source>
</video>

Con JavaScript podemos escuchar el final del video y aplicar algún otro evento:

$('#video').bind('ended', function() {   
  // Cerramos la ventana del video
  var videoEl = document.getElementById('video');  
  videoEl.webkitExitFullScreen();
});

Comentarios

  1. zithromaxeska [#]

    does zithromax contain penicillin zithromax tablets zepak antibiotics

  2. www.iherb.com [#]

    Can I simply just say what a relief to discover somebody that really
    knows what they are discussing on the web. You certainly understand how to bring an issue to light and make it important.

    More and more people ought to read this and understand this side of
    the story. It’s surprising you are not more popular since you surely possess
    the gift. quest bars https://www.iherb.com/search?kw=quest%20bars quest
    bars

  3. HenryUnfiP [#]

    gay dating match
    gay bears dating sites
    gay male dating in alabama

  4. canadian pharmacies [#]

    canadian pharcharmy online

  5. HenryUnfiP [#]

    dating gay lesbian service
    gay sock feet dating sites
    gay hipster dating

  6. zyrtec best price [#]

    periactin – https://allergyd.com

  7. buy zyrtec online [#]

    warnings for cetirizine – https://allergyd.com

  8. pharmaceptica.com [#]

    tadalafil peptides https://www.pharmaceptica.com/

  9. coupon for zyrtec allergy medicine [#]

    warnings for cetirizine – http://allergyd.com

  10. zyrtec sale [#]

    what is cetirizine hydrochloride 10mg – https://allergyd.com

  11. GafInvake [#]

    canadian cialis order

  12. prednisoneonline [#]

    prednisone no prescription day dosage prednisone weight gain

  13. ivermectin for humans [#]

    General Dope Far this product
    https://ivermectstromect.com ivermectin for humans
    https://ivermectinsts.com ivermectina comprar
    https://ivermectinsts.com buy ivermectin 12 mg for humans
    https://ivermectinsts.com stromectol ivermectin amazon
    https://stromectolivermect.com is ivermectin safe for people

  14. provigilonline [#]

    where to buy modafinil adrafinil vs modafinil

  15. www.pharmaceptica.com [#]

    hloroquine https://www.pharmaceptica.com/

  16. ivermectin tablets for humans [#]

    stromectol ivermectin http://stromectolforte.com/ is ivermectin a prescription drug stromectol pil

  17. ivermectin usa [#]

    ivermectin tablets over counter https://stromectolforte.com/# ivermectin for humans where to buy ivermectin for sale uk

  18. GazInvake [#]

    buy real cialis online canada

  19. accutane for acne [#]

    side effects of accutane isotretinoina

  20. cialis price [#]

    generic cialis buy cialis usa

  21. modafinildosage [#]

    modafinil moa modafinil india

  22. bactrim drug class [#]

    trimethoprim sulfate and polymyxin b sulfate trimethoprim sulfate and polymyxin b sulfate

  23. viagra without a doctor prescription language en [#]

    red cross cpr http://medspublic.com – viagra price

  24. ivermectin on amazon [#]

    buy ivermectin 12 mg for humans http://stromectolforte.com/ ivermectin stromectol price in india

  25. stromectolforte.com [#]

    ivermectin for humans for sale cvs https://stromectolforte.com/ how to buy stromectol stromectol for humans

  26. ivermectin tablets for humans [#]

    ivermectin https://stromectolforte.com/# stromectol 12 mg is ivermectin a prescription drug

  27. GustavoVet [#]

    resume writing service reviews
    professional resume services

  28. GustavoVet [#]

    cosmetology research paper
    help with essay writing

  29. GaloInvake [#]

    zithromax pills online

CSSLab