使用一个NetStream对象同时提供两个Video对象 [英] Use one NetStream object to feed two Video objects simultaneously

查看:124
本文介绍了使用一个NetStream对象同时提供两个Video对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将一个NetStream对象附加到两个独立的Video对象上,而不是从服务器中拉出多余的流。预期的行为将是两个视频的显示相同的内容。然而,看起来最后一个将NetStream附加到的视频是唯一一个显示内容的视频。



有其他人遇到过吗?我宁愿不去使用BitmapData克隆像素的不雅步骤,如果我不需要。



谢谢

这里的更多信息和演示。

这意味着您可以使用HTTP流式传输视频。您可以使用HTTP流式传输视频,然后使用单个HTTP流中的字节来提供两个不同的NetStream。所以你从HTTP流获取你的字节,然后你在每个NetStream对象上调用ns.appendBytes(inputbytes)。你将有2个NetStream对象,但它会为你节省试图为每个对象提供冗余流的带宽。



然后你可能碰到的是<在视频片段之间跳过如果你试图推出你自己的视频分配器。 Adobe支持在其视频服务器中的HTTP流拆分,但我一直没有找到一个很好的参考,显示如何滚动这个自己。

I'm trying to attach a single NetStream Object to two separate Video objects instead of pulling redundant streams from the server. The expected behavior would be for both Video's to display the same content. However, it seems that the last video I attach the NetStream to is the only Video that will display the content.

Has anyone else run into this? I'd rather not go to the inelegant steps of using BitmapData to clone pixels if I don't have to.

Thanks

解决方案

As of Flash 10.1 Adobe finally added some new functionality for connecting directly to the bytes for the NetStream object. The new method is called appendBytes, which as it suggests allows adding bytes programatically to the NetStream object. This is primarily used for Adobe's support of HTTP streaming (finally). There is some more info and demos for this here at bytearray.org.

What this means is that what you may be able to do is stream your video using HTTP streaming. You can get your video streamed using HTTP streaming, then feed your two different NetStreams with the bytes from the single HTTP stream. So you get your bytes from HTTP streaming, then you call ns.appendBytes(inputbytes) on each NetStream object. You'll have 2 NetStream objects, but it will save you the bandwidth of trying to pull redundant streams for each.

What you may then run into is that you have skipping between your video segments if you try to roll your own video splitter. Adobe supports the HTTP stream splitting in its video server, but I haven't been able to find a good reference that shows how do roll this myself.

这篇关于使用一个NetStream对象同时提供两个Video对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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