我正在玩OSMF并且在运行一个超级简单的例子时遇到问题。
我在Arch Linux上的VirtualBox上运行Flash CS5(只是说因为我认为这可能与底层的东西有关)。 我也在使用OSMF 1.6 Sprint 1。
无论如何我试图运行这个简单的例子:
package { import flash.display.Sprite; import org.osmf.containers.MediaContainer; import org.osmf.elements.VideoElement; import org.osmf.media.DefaultMediaFactory; import org.osmf.media.MediaElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; public class OPlayer extends Sprite { public function OPlayer() { var filePath:String = "testvid.flv"; var resource:URLResource = new URLResource(filePath); var mediaFactory:DefaultMediaFactory = new DefaultMediaFactory(); var mediaElement:MediaElement = mediaFactory.createMediaElement(resource); var mediaPlayer:MediaPlayer = new MediaPlayer(mediaElement); var mediaContainer:MediaContainer = new MediaContainer(); mediaContainer.addMediaElement(mediaElement); addChild(mediaContainer); } }}
不幸的是,我不断收到以下编译错误:
1046: Type was not found or was not a compile-time constant: StageVideoEvent.I am playing around with OSMF and have a problem running even a super simple example.
I am running Flash CS5 on Win7 in VirtualBox on Arch Linux (just saying because I thought that this may have something to do with the underlying stuff). Also I am using OSMF 1.6 Sprint 1.
Anyways I am trying to run this simple example:
package { import flash.display.Sprite; import org.osmf.containers.MediaContainer; import org.osmf.elements.VideoElement; import org.osmf.media.DefaultMediaFactory; import org.osmf.media.MediaElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; public class OPlayer extends Sprite { public function OPlayer() { var filePath:String = "testvid.flv"; var resource:URLResource = new URLResource(filePath); var mediaFactory:DefaultMediaFactory = new DefaultMediaFactory(); var mediaElement:MediaElement = mediaFactory.createMediaElement(resource); var mediaPlayer:MediaPlayer = new MediaPlayer(mediaElement); var mediaContainer:MediaContainer = new MediaContainer(); mediaContainer.addMediaElement(mediaElement); addChild(mediaContainer); } }}
And unfortunately I keep getting the following compile error:
1046: Type was not found or was not a compile-time constant: StageVideoEvent.最满意答案
StageVideo上周才正式发布,你的版本可能还没有使用新的API进行更新。
此PDF包含有关在Flex中使用它的信息: http : //download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p1_releasenotes.pdf
我看到你正在使用Flash CS5,你需要一个playerglobal.swc,你可以尝试使用Flex,但我不认为它会起作用。 寻找特定的Flash CS5。
UPDATE
我做了一个快速搜索,它似乎不适用于Flash Professional CS5,只是通过Flex编译器。
StageVideo was only officially released last week, your version probably hasen't been updated with the new API's.
This PDF has info on using it with Flex: http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p1_releasenotes.pdf
I see you are using Flash CS5, you'll need a playerglobal.swc for that, you could try the Flex one, but I don't think it'll work. Look for a Flash CS5 specific one.
UPDATE
I did a quick search and it doesn't look like it is available for Flash Professional CS5 yet, just through the Flex compiler.
更多推荐
发布评论