Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width">
- <style>
- #vid { width:700px;margin:auto; }
- #p { font-size:40px; }
- #vid_ct { font-size:30px; }
- *{ font-family:segoe script;font-weight:bold;text-align:center; }
- #p_ { font-size:40px;margin-top:-35px; }
- </style>
- </head>
- <!-- We don't set any style to poster.The image(poster)must
- have the same ratio the video has.In this case 16/9.
- For each 16px width 9px height.We don't set height to the video,
- only width. Autoplay no longer runs.To start video needs a click. -->
- <body>
- <video id="vid" poster='video poster.png' controls>
- <source src='D:\STUFF\Mp4\ACDC - Rock N Roll Train (from Live at River Plate).mp4' type='video/mp4'>
- </video>
- <p id='p'>Video currentTime = <span id='vid_ct'></span></p>
- <p id='p_'>Video duration = <span id='vid_d'></span></p>
- <script>
- onload=()=>{
- vid_ct.innerHTML = vid.currentTime;
- vid_d.innerHTML = vid.duration;
- }
- vid.ontimeupdate=function(){
- vid_ct.innerHTML = vid.currentTime;
- if(vid.currentTime > 50){
- vid.pause();
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement