使用 PHP 获取 flv 文件以嵌入 swf 控件

发布于 2024-07-18 08:22:43 字数 106 浏览 4 评论 0原文

所以想做:从受保护的目录获取 flv 文件,并使用 PHP 将其作为参数提供给 swf 嵌入式播放器。

这可能吗?

将文件内容发送到嵌入式播放器似乎不起作用。

So would like to do: get an flv file from a protected directory and feed it to a swf embedded player as a parameter using PHP.

Is this possible?

Sending the contents of the file to the embedded player does not seem to work.

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

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

发布评论

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

评论(3

叹沉浮 2024-07-25 08:22:43

嗯,由于播放器要求客户端从服务器获取播放器和 FLV,我怀疑这需要一个临时位置,用户可以通过 URL 访问 FLV。 最明显的解决方案是创建一个在合理时间内超时的过期 URL,以防止用户直接链接到 FLV。 我不确定是否有一种方法可以在不动态地将地址嵌入到 Flash 本身中的情况下对其进行保护 - 基本上,您不能使用将 FLV 的 URL 作为参数的通用播放器,如果需要额外的保护。

编辑:这是使用 JW 播放器的潜在解决方案:V4 中的代码 URL,用于防止水蛭

这里是另一个可能的解决方案,与我原来的评论类似: Flashcomguru.com:通过 PHP '流式传输' flv 视频,取两个

Well, since the player requires that the client fetches both the player and the FLV from the server, I suspect that this would require a temporary location from which the FLV is made accessible to the user via a URL. The most obvious solution is to create an expiring URL that times out in a reasonable amount of time, preventing users from linking directly to the FLV. I'm not sure if there's a way to keep it protected beyond this without embedding the address to the file in the flash itself dynamically - basically, you can't use a general purpose player that takes a URL for the FLV as a parameter if additional protection is required.

Edit: Here is a potential solution using the JW player: Code URL in V4 for protection against leechers

And here is another possible solution along the lines of my original comment: Flashcomguru.com: 'Streaming' flv video via PHP, take two

当爱已成负担 2024-07-25 08:22:43

Flashcomguru 链接看起来很有希望,但不确定我是否理解这些东西。
我不是 Flash 爱好者,但我知道有人可以提供帮助。

我也不知道如何创建“创建过期 URL”

The Flashcomguru link look promising, not sure I understand this stuff however.
I'm not a Flash guy but I know someone that may be able to help.

I'm also not sure how to create a 'create an expiring URL"

橪书 2024-07-25 08:22:43

不确定“使用 PHP 将其作为参数提供给 swf 嵌入式播放器”是什么意思,但看起来您想要做的是:

  1. 将 flv 文件存储在服务器中 DocumentRoot 之外的某个位置。
  2. 创建一个基于某些参数的 PHP 脚本,读取 flv 文件并为其提供服务。 我假设您计划在此 php 脚本中进行一些身份验证,以防止任何人仅调用您的 PHP 脚本并获取 flv,就好像它位于 DocumentRoot 中一样
  3. 创建一个 swf 剪辑,该剪辑将调用 PHP 脚本来检索 flv给客户。

如果这就是您想要的,那么 2 中读取和提供 flv 的脚本部分应该非常简单,使用来自 PHP API 的标准文件访问函数并在回显之前设置适当的内容类型标头。

Not sure what you mean with "feed it to a swf embedded player as a parameter using PHP", but looks like what you want to do is this:

  1. Store your flv file somewhere outside the DocumentRoot in your server.
  2. Create a PHP script that based on some parameter, reads the flv file and serves it. I'm assuming that you are planning to have some authentication in this php script to prevent anyone from just calling your PHP script and getting the flv as if it was in the DocumentRoot
  3. Create an swf clip that will call the PHP script to retrieve the flv to the client.

If that is what you want, the part of the script in 2 that reads and serves the flv should be pretty straight forward using the standard file accessing functions from the PHP API and setting the appropriate content-type header before echoing it out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文