如何复制 NetStream 对象?
我正在使用 BulkLoader 加载包含 10 个左右 FLV 文件的数组。 我希望能够在我的应用程序中独立使用和控制这些 FLV。 例如,FLV_1 可能会重复显示,但我想暂停一个实例并同时播放另一个实例。
我想将 NetStream 对象传递给其他 Video 对象并显示两者。 这可能吗? 如果是这样,我该如何去做呢?
I'm using BulkLoader to load an array of 10 or so FLV files. I want to be able to use and control these FLVs throughout my app independently. So for instance, FLV_1 may be displayed in duplicate but I want to pause one instance and play the other in tandem.
I would like to pass the NetStream object around to other Video objects and display both. Is this possible? If so, how do I go about doing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这绝对是可能的。 BulkLoader 将向您公开 NetStream 对象,因此您可以将其传递给 Video 或其他任何内容,例如:
问候
It's definitely possible. BulkLoader will expose you the NetStream object, so you can pass it around to Video or anything else, for example:
Regards
尚未对此进行测试,但从逻辑上讲,您不应该能够异步播放包含同一 NetStream 实例的多个视频,仅仅是因为暂停/播放等。 方法直接在 NetStream 实例上触发(而不是在视频容器上......)。
另一方面,您可能可以在不同的视频实例中同步播放 NetStream 的同一实例(需要仔细检查!)。
最简单的破解方法可能是将相同的 FLV 加载到两个不同的项目中(如果您使用 BulkLoader),使用唯一的 ID 引用它们,并希望最终用户启用了浏览器缓存。 此后,您将单独添加和控制每个 NetStream,就像处理两部不同的电影一样。
Haven't tested this but logically you shouldn't be able to play more than one video containing the same instance of a NetStream asynchronously, simply because the pause/play/etc. methods are triggered directly on the NetStream instance (and not on the Video containers...).
On the other hand you can probably play the same instance of a NetStream synchronously within different Video instances (to be double checked!).
Probably the easiest hack would be to load the same FLV into two different items (in case you use BulkLoader) referencing them with unique ID's and hoping the end-user has his browser cache enabled. Thereafter you would add and control each NetStream separately just as if you were handling two different movies.