Prevent HTML5 video from being downloaded (right-click saved)?

前端 未结 20 2390
醉酒成梦
醉酒成梦 2020-11-22 15:33

How can I disable \"Save Video As...\" from a browser\'s right-click menu to prevent clients from downloading a video?

Are there more complete solutions that prevent

20条回答
  •  猫巷女王i
    2020-11-22 16:34

    @Clayton-Graul had what I was looking for, except I needed the CoffeeScript version for a site using AngularJS. Just in case you need that too, here's what you put in the AngularJS controller in question:

        # This is how to we do JQuery ready() dom stuff
        $ ->
            # let's hide those annoying download video options.
            # of course anyone who knows how can still download
            # the video, but hey... more power to 'em.
            $('#my-video').bind 'contextmenu', -> 
                false
    

    "strange things are afoot at the circle k" (it's true)

提交回复
热议问题