HOW TO HIDE HTML5 PLAYER FOR IPAD ON DONE BUTTON CLICK

Brad Pitt

Total Post:61

Points:429
Posted by  Brad Pitt
iPhone 
 1319  View(s)
Ratings:
Rate this:
Hi Everyone,

I am playing video in iPad it is working fine but I want that when user enter done button, player should close.
Any idea how to do this. 
I'm trying as following

<!DOCTYPE html>
<head>
<meta charset=”utf-8?>
<meta name=”apple-mobile-web-app-capable” content=”yes” />
<title>My Video</title>
<link rel=”apple-touch-icon” href=”icon.png” />
<style>
body {margin:0;}
</style>
</head>
<body>
<video width=”1024? height=”750? controls=”true”>
<source src=”videos/test.m4v” />
</video>
</body>
</html>

Thanks in advance. 
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: how to hide html5 player for iPad on done button click

    Hi Brad,


    You can try as following

    <!DOCTYPE html>
    <head>
    <meta charset=”utf-8?>
    <meta name=”apple-mobile-web-app-capable” content=”yes” />
    <title>My Video</title>
    <link rel=”apple-touch-icon” href=”icon.png” />
    <script>
      function onClickDone(){
      document.getElementById('myvideotag').pause();
      document.getElementById('myvideotag').style.display = "none";
    }
    </script>
    <style>
    body {margin:0;}
    </style>
    </head>
    <body>
    <button onclick="onClickDone()">Done</button>
    <video id="myvideotag" width=”1024? height=”750? controls=”true”>
    <source src=”videos/test.m4v” />
    </video>
    </body>
    </html>

    Thanks in advance. 

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!