how to hide html5 player for iPad on done button click

Total Post:61

Points:429
iPhone 
 1636  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. 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. 

      Modified On Mar-30-2018 01:33:48 AM

Answer