如何在OSMF中播放flv格式的byteArray?
我正在 Flex 中开发一个 Web 应用程序,它具有通过获取每个帧的快照来记录运行时的功能,然后将其编码到 ByteArray 中以进行视频播放。
我目前正在使用 NetStream.appendBytes() 播放 ByteArray FLV。它正在工作,但我刚刚发现 OSMF 并考虑将其集成到我的应用程序中。
OSMF 中可以播放 flv byteArray 吗?如果有一个关于如何做到这一点的例子那就太好了。谢谢!
I am developing an web application in flex which have a feature of recording the runtime by having a snapshot of each frames then encoding it into a ByteArray for video playback.
I am currently using NetStream.appendBytes() for playing the ByteArray FLV. It is working, but I just found out about OSMF and thinking bout integrating it in my application.
It is it possible to play the flv byteArray in OSMF? An example on how can it be done would be totally great. thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我现在可以在 OSMF 中播放 flv 字节数组。在此之前,我已经能够通过创建一个扩展 netStream 的新类并重写其 play 方法以使用 appendbytes 来播放 byteArray。所以我所做的就是让 OSMF 使用它。我这样做创建了这些类:
1. ByteStreamElement - 媒体元素
2. ByteStreamLoader - 扩展LoaderBase
3. ByteStreamLoadTrait - 扩展 LoadTrait
覆盖 netstremas 查找/播放方法:
并像这样使用它:
我真的不确定这是否是最好的方法。不确定我是否最好创建新类,或者我应该为 OSMF 编写某种插件来播放字节数组。另一件事是,我真正需要的是在需要时不断在播放器中追加字节。这就是为什么我仍然没有使用它,同时我会坚持使用我定制的“ByteStream 播放器”,直到我弄清楚这一点。
I am now able to play flv bytearrays in OSMF. Beforehand, I've already been able to play byteArray by creating a new class that extends netStream and overriding its play method to use appendbytes instead. So what I did was to make OSMF use it. I did this creating these classes:
1. ByteStreamElement - media element
2. ByteStreamLoader - extends LoaderBase
3. ByteStreamLoadTrait - extends LoadTrait
overriding netstremas seek/play method:
And using it like this:
Im really not sure though if this is the best way to do it. Not sure if it is best that i created new classes or I should have written some sort of plugin for OSMF to use to play bytearrays. And another thing is that, what I really need is it to contiually appendbytes in the player in case needed. That's why Im still not using this and for the mean time Ill stick with my custom made "ByteStream player" until I figure this out.