Alternative Ways To Close HTML5 Video-player - Stack Overflow
Có thể bạn quan tâm
I heard there is no way to close HTML5 video-player. So I wrote an alternative way. With the following code, double click on any character of these sentences, a video will start playback from a fixed temporal position (100 sec) at the spatial position where you would double-click. Next, press any key to stop the video and erase the video player.
But this way uses window-refresh (window.location.reload()) and so isn't gentle for eyes. I wonder if there are alternatives gentle for eyes.
My code:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <style> video { display: none; position: fixed; } </style> </head> <body> <video></video> <li>Double click on any character of these sentences.</li> <li>A video will start playback from a fixed temporal position (100 sec) <li>at the spatial position where you would double-click.</li> <li>Next, press any key to stop the video and erase the video player.</li> <script> document.addEventListener('DOMContentLoaded', (e) => { //PLAYBACK VIDEO document.querySelector('body').addEventListener('dblclick', (e) => { const video = document.querySelector('video'); video.controls = true; video.width = "200"; video.autoplay = true; video.src="https://archive.org/download/BigBuckBunny_328/BigBuckBunny.ogv#t=100"; video.style.display = 'block'; video.style.left = e.clientX + 'px'; video.style.top = e.clientY + 'px'; }); // CLOSE PLAYER document.querySelector('body').addEventListener('keypress', (e) => { window.location.reload();//<<--- LOOK AT THIS!!! }); }); </script> </body> </html>Từ khóa » Html5 Video Alternative
-
10 HTML5 Video Players That Are Better Than Flash - MonsterPost
-
Accessible HTML5 Video Player Alternatives And Similar Sites / Apps
-
5 Open Source HTML5 Video Players For 2019 - Bits And Pieces
-
The 15 Best HTML5 Video Players: A Definitive Guide For 2022
-
Ultimate HTML5 Video-Player Showdown: 12 Players Compared
-
HTML Video - W3Schools
-
Top 13 HTML5 Video Players For The Web Reviewed [2021]
-
Top 17 Online Video Players For 2022 - VdoCipher
-
Video.js - Make Your Player Yours | Video.js
-
Best HTML5 Video Players For 2022 | Wowza Media Systems
-
The Video Embed Element - HTML: HyperText Markup Language
-
5 Best HTML5 Video Players Alternatives To JW Player
-
Best HTML5 Video Players For Professional Video And Streaming
-
5 Great HTML5 Video Players - SitePoint