Flash 视频流和嵌入
用户在我们的 DAM 服务器上上传不同类型的文件(图像、视频、音频、文档等),并对这些文件执行不同的操作。我们拥有所有这些资产的公共链接,无需任何身份验证即可进行访问。
我们在处理上传到我们服务器上的 Flash 视频时遇到一些问题。使用公共链接就可以下载并保存该文件。但是,当在博客文章中使用公共链接时,视频不会显示。当我尝试使用其中一个桌面 Flash 播放器打开同一视频时,它在下载文件时可以正常播放,但在指向公共链接时却无法播放。
我在博客文章中使用的嵌入代码是这样的 -
<object type="application/x-shockwave-flash" width="550" height="400" data="http://dam_server/flash/flashplayer.swf?file=url_encoded_public_url">
<param name="movie" value="http://dam_server/flash/flashplayer.swf?file=url_encoded_public_url" />
</object>
来自我们服务器的相关响应标头 -
Server: Microsoft-IIS/6.0
Connection: close
Content-Disposition: attachment; filename="video.flv"
P3P: CP="NOI DSP COR CURa PSDa OUR NOR NAV STA"
Accept-Ranges: bytes
Content-Length: 1001503
Expires: -1
Last-Modified: Mon, 12 Sep 2011 08:29:01 GMT
ETag: "-1245634458"
Cache-Control: private
Content-Type: application/octet-stream
可能我们正在使用不正确的值设置一些响应标头。
该视频在我们的系统中可以正常播放,但不能在博客等独立页面中播放。有什么想法可能会出问题吗?
ps 我已经检查了这里发布的许多类似问题,但无法获得所需信息。
Users upload different types of files (images, videos, audio, docs etc) on our DAM server and perform different operations on those. We have public links for all these assets to enable an access without any authentication.
We are having some problem working with flash videos uploaded on our server. Using a public link one can download and save the file alright. However when a public link is used in say a blog post, the video does not get displayed. When I try to open the same video using one of the desktop flash players it plays it fine when file is downloaded but fails to do so when pointed to a public link.
The embed code I use in a blog post is like this -
<object type="application/x-shockwave-flash" width="550" height="400" data="http://dam_server/flash/flashplayer.swf?file=url_encoded_public_url">
<param name="movie" value="http://dam_server/flash/flashplayer.swf?file=url_encoded_public_url" />
</object>
The relevant response headers from our server -
Server: Microsoft-IIS/6.0
Connection: close
Content-Disposition: attachment; filename="video.flv"
P3P: CP="NOI DSP COR CURa PSDa OUR NOR NAV STA"
Accept-Ranges: bytes
Content-Length: 1001503
Expires: -1
Last-Modified: Mon, 12 Sep 2011 08:29:01 GMT
ETag: "-1245634458"
Cache-Control: private
Content-Type: application/octet-stream
Probably we are setting some of the response headers with incorrect values.
The video plays alright within our system, but not in an independent page like a blog. Any ideas what might be going wrong?
p.s. I have checked many similar questions posted here but could not get required information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题不在于跨域调用。我唯一要做的就是为我们正在使用的 Flash 播放器设置文件类型。我们的公共链接没有扩展名。因此,除非明确指定文件类型,否则 Flash 播放器无法识别文件类型。
The problem wasn't with cross domain calls. The only thing I had to do was set file-type for the flash player we are using. Our public links do not have an extension. So the flash player wasn't recognizing the file type unless the file-type was specified explicitly.