允许脚本访问,阻止浏览器访问

发布于 2024-10-10 05:56:53 字数 514 浏览 0 评论 0原文

我正在使用 flowplayer 在我的网站上播放 flv 视频,我不希望用户知道视频的实际路径,这样他们就无法下载它们。但是当鼠标悬停在视频上时,视频路径在状态栏中可见(在 FireFox 中),例如: http ://www.example.com/videos/123.flv

因此,如果用户转到目录(视频),他就可以查看视频并下载它们。所以我在那里放了一个空的index.html文件,现在视频列表不显示。 :)

但是,如果用户在 url 中输入完整路径,则可以下载视频。 (显示下载对话框)。这是我的担心。所以我在 .htaccess 文件中添加了以下几行。

<文件〜“.flv$”> 命令拒绝、允许 不允许任何人 所有人都否认

现在的问题是,flowplayer无法播放视频。

那么我如何限制对浏览器上视频的访问,并只允许访问 flowplayer 呢?

iam playing flv videos in my site, using flowplayer, and i dont want the users to know the actual path of the video, so that they cant download them. But onmouseover on the video, the video path is visible in the statusbar (in FireFox), for ex: http://www.example.com/videos/123.flv

So if the user goes to the directory (videos), he can view the videos and can download them. So i put an empty index.html file there, now the video list is not displayed. :)

But still, if the user enters the complete path in the url, the video can be downloaded. (shows the download dialog box). This is my worry. So i added the following lines in my .htaccess file.

<files ~ ".flv$">
order deny,allow
allow from none
deny from all
</files>

Now the problem is that, the flowplayer is not able to play the video.

So how can i restrict access to the video on the browser, and allow access only to flowplayer?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丑丑阿 2024-10-17 05:56:53

简短的回答是你不能。数据必须先到达用户的计算机才能播放。

您可以尝试修改播放器,以便它发送额外的 HTTP 标头,并在没有它们的

  1. 情况下拒绝访问,但是: 用户可以嗅探流量并找出它们是什么
  2. 如果您可以修改播放器,您将删除以下代码无论如何现在都显示 URL

The short answer is that you can't. The data has to arrive on the user's computer before it can be played.

You could try to modify the player so that it sends additional HTTP headers, and deny access without them, but:

  1. The user could sniff the traffic and find out what they are anyway
  2. If you could modify the player, you would have removed the code to show the URL by now anyway
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文