使用 PHP 获取 flv 文件以嵌入 swf 控件
所以想做:从受保护的目录获取 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
嗯,由于播放器要求客户端从服务器获取播放器和 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
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"
不确定“使用 PHP 将其作为参数提供给 swf 嵌入式播放器”是什么意思,但看起来您想要做的是:
如果这就是您想要的,那么 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:
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.