在 swf 文件中嵌入二进制视频数据
是否可以播放编译时嵌入 swf 中的数据的视频(使用 [Embed]
元标记)?
Flash CS3 等提供的“导入视频->嵌入”功能是不可接受的,因为它有许多严重的限制(包括声音同步问题、最大帧数和其他注意事项)
我有兴趣能够捆绑swf 中的 flv 视频数据(以及其他资源),将由 AIR 应用程序播放。
我认为这是不可能的。 有人不同意吗?
Is it possible to play video from data that has been embedded in a swf at compile time (with the [Embed]
metatag)?
The "Import Video->Embed" feature provided by Flash CS3 etc. is not acceptable because it has many severe limitations (including sound synchronization issues, a maximum number of frames, and other caveats)
I'm interested in being able to bundle flv video data in a swf (along with other assets), which will be played by an AIR application.
I don't think it can be done. Anyone disagree?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
只要您的视频是 FLV,那么答案是肯定的 - 您可以使用 NetStream.appendBytes() 来播放嵌入的 ByteArray:
As long as your video is an FLV, then the answer is yes - you can use
NetStream.appendBytes()
to play the embeddedByteArray
:您可以使用 Flash IDE 将 flv 导入 swf 文件 - 我之前已经这样做过。 您可以将其像声音一样拖放到影片剪辑的时间轴上,然后将该影片剪辑拖放到舞台上以供其播放。 在 Flash CS3 中,执行“文件”>“导入”>“导入视频”并选择 flv。 选择视频,然后在向导的下一站选择“嵌入.....”,这是Adobe 开发人员中心关于将 flv 嵌入到 swf 中的文章。
我自己没有这样做,但我看不出为什么您可以从加载的 swf 库访问 flv。
仅供参考:看起来这是一个被推迟的错误。 Adobe 目前似乎不允许使用 Embed 元标记进行嵌入。 这是关于该问题的论坛帖子以及指向<的链接href="https://bugs.adobe.com/jira/browse/SDK-259" rel="nofollow noreferrer">错误跟踪器。
You can import a flv into a swf file using the Flash IDE - I've done that before. You can drop it onto the timeline of a MovieClip just like a sound and then drop that movieclip onto the stage for it to play. In Flash CS3 do File>Import>Import Video and select the flv. Choose the video and then on the next stop of the wizard choose "Embed ..... ", Here is a link to an Adobe Developer center article on embedding flvs into swfs.
I have not done so myself, but I can see no reason why you could access the flv from the library of a loaded swf.
FYI: It looks like this was a bug that was deferred. It doesn't look like Adobe currently allows embedding using the Embed meta tag. Here is a forum post on the issue and a link to the bug tracker.
可以使用 Flash IDE 将视频嵌入到 SWF 中,但这不是一个很好的选择:
这些引用来自这篇文章< /a> 有点旧了,但据我所知,其中关于嵌入视频的说法仍然有效。
It's possible to embed video into SWFs with the Flash IDE but it's not a very good option:
Those quotes are from this article. It's a bit old but as far as I know, what is said there about embedding video still holds true.
哦,是的,显然您可以使用
Embed
元标记将二进制数据嵌入到 swf 中。是否可以从 ByteArray 播放嵌入视频不是我现阶段无法以某种方式回答的问题......
Oh yeah, so apparently you can embed binary data in a swf using the
Embed
meta tag.Whether you can playback embedded video from a ByteArray or not is not something I cannot answer one way or another at this stage ...
只是遇到了同样的问题并寻找更“灵活”的解决方案。
看来这些天动态嵌入的工作非常简单:
注意:检查
library.swf
中的屏幕偏移。 就我而言,它们被搞乱了,所以它只是显示在屏幕外。 (感谢上帝赐予咖啡)祝你今天过得愉快!
just had the same problem and searched for a more "flex"ible solution.
seems these Days dynamic embedding works perfectly simple:
Note: Check the screen offsets within the
library.swf
. In my case they were messed up, so it simply displayed offscreen. (ThankGodForCoffee)Have a nice Day!