在 Flash Player 中从 ByteArray 播放 FLV [英] Play FLV from ByteArray in Flash Player

查看:31
本文介绍了在 Flash Player 中从 ByteArray 播放 FLV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ByteArray 对象中存储了一个 Flash 视频文件 (FLV),我想播放此视频.有什么方法可以实现吗?也许使用炼金术?

I have a flash video file (FLV) stored in the ByteArray object and would like to play this video. Is there any way to achieve it? Maybe using Alchemy?

谢谢!

推荐答案

我认为为什么 ByteArray"实际上是一个问题......它是如何到达那里的?:)

i think "why ByteArray" is actually THE question ... how did it get there? :)

有很多方法......一种是由康拉德提供的......但正如他所说的那样会很慢......事实上,我认为它会比你想象的要慢得多......所以在这里另一个:

there are numerous approaches ... one was given by konrad ... but as he said it will be slow ... in fact, i think it'll be much slower than you can even imagine ... so here another one:

将 ByteArray 传递到服务器并从那里加载 flv ...有几个选项:

pass the ByteArray to a server and load the flv from there ... there are several options:

  • 远程服务器:将其加载到远程服务器(可能是分发您的 swf 的服务器)……仍然存在为什么不首先从那里分发 flv 的问题……
  • 本地服务器:
  1. 已安装:只需安装一个小型本地应用程序即可为您完成此操作,也就是说,您可以将字节数组推送到那里,然后通过合适的协议(HTTP、RTMP)检索它...
  2. 嵌入浏览器:与安装相同,但您可以简单地创建一个 Java Applet 来完成这项工作...... 签名 java小程序被允许绑定端口(是的,这对用户来说是一次额外的点击,但它尽可能舒适)这是你必须做的,其余的与安装的服务器真的一样......
  1. installed: simply install a tiny local app to do exactly that for you, that is, you can push the bytearray there and then retrieve it over a suitable protocoll (HTTP, RTMP) ...
  2. browser-embedded: same as installed, but you can simply create a Java Applet to do that job ... signed java applets are allowed to bind ports (yes, this is an extra click for the user, but it's as comfortable as it can get) which is what you'll have to do and the rest is really the same as with an installed server ...

在这两种情况下,您可能会遇到跨域策略问题(可能仅在发送时,因为我认为您可以跨域加载视频),您需要正确响应 FlashPlayer 的策略文件请求(您可以找到大量的东西)......你可以通过建立一个LocalConnection桥来绕过发送限制,作为这个 对于 C# ...

in both scenarios, you might run into crossdomain policy issues (probably only when sending, since i think you're allowed to load videos across domains), where you need to respond correctly to FlashPlayer's policy file requests (you can find tons of stuff on that) ... you could bypass sending restriction by making a LocalConnection bridge, as this one for C# ...

祝你好运……;)

啊好吧,现在我明白了......实际上,已经有一个非常相似的问题 ...我记得在 p2p 功能宣布后不久,对一些 adobe 家伙的简短采访...adobe 对此非常害羞...实际上它flash player 10正式发布后花了我几个星期才找到p2p(之前真的没有时间打扰)......

edit: ah ok, now i understand ... actually, there was already a very similar question ... i remember a short interview with some adobe guy, just shortly after p2p feature was announced ... adobe is very shy about this ... actually it took me weeks to find the p2p after flash player 10 was officially released (didn't really have time to bother before) ...

实际上,我认为这是故意制作的……在采访中,有人明确表示,adobe 并没有试图推开视频流媒体网站……最重要的两个可能是 youtube 和 google video ... youtube 是主要原因之一,为什么 Flash 播放器一开始变得如此流行......它归谷歌所有,因为谷歌视频......允许轻松创建 p2p 媒体平台会让谷歌很生气... 你不需要很多服务器......只是"好的软件,但这是负担得起的......我认为,adobe不想惹怒谷歌......一些原因:

actually, i think this is made on purpose ... in the interview, it was made clear, that adobe is not trying to push away video streaming sites ... the two most important probably are youtube and google video ... youtube is one of the main reasons, why flash player became so popular in the first place ... and it's owned by google, as google video ... allowing easy creation of a p2p media platform would piss google off a lot ... you don't need a lot of servers for that ... "just" good software, but that's affordable ... and i think, adobe does not want to piss off google ... some reasons:

  • 他们是搜索引擎
  • 他们需要谷歌允许索引基于 Flash 的网站
  • 谷歌大 n 倍
  • google 真的想在 RIA 市场上占有一席之地……他们拥有 GWT、chrome、V8本地客户端 ...
  • they are THE search engine
  • they need google to allow indexing flash based sites
  • google is n times bigger
  • google is really trying to get a huge chunk of the RIA market ... they have the GWT, chrome, the V8, the native client ...

所以我想 adobe 没有那么大的兴趣这样做......它几乎有点,就像谷歌宣布他们的支付系统(是 GPay 还是这样?),这是 PayPal 的直接并发...... eBay 是谷歌最重要的收入来源之一......实际上我再也没有听说过......

so i guess adobe does not have that much of an interest to do so ... it's pretty much a bit, like when google announced their payment system (was it GPay or so?), which was a direct concurrent of PayPal ... eBay is one of google's most important income sources ... and actually i never heard anything about it again ...

许多决策都是政治性的,当涉及到大公司时......我认为,不让 Flash Player 的 p2p 过于强大就是其中之一......

many decisions are political, when it comes to big companies ... and i think, the one not to make flash player's p2p too strong is one of them ...

这篇关于在 Flash Player 中从 ByteArray 播放 FLV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆