简体   繁体   中英

Prevent user from seeking in HTML5 Video

I'm trying to prevent a user from seeking but can't seem to get it to work. Here's how I bind to the event. Any ideas how I can prevent it from happening?

         @$('#video').bind("seeking", (e) =>
            e.preventDefault()
            e.stopPropagation()
          )

you can do what I did, hide the video element, keep a canvas in it's place, and keep some custom play/pause, mute/unmute button on it as overlay, and you can keep drawing the canvas using requestAnimationFrame or setTimeout

edit : a demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM