Actionscript - 视频播放器帮助! - 闪光
几天来我一直在尝试弄清楚如何让视频在 Flash 中播放,但几乎一无所获。我有下面的代码,但不知道还有什么可以尝试让它工作。有人可以帮忙吗?
var conn:NetConnection = new NetConnection();
conn.connect(null);
var nstream:NetStream = new NetStream(conn);
nstream.setBufferTime(10);
trailer.attach(nstream);
nstream.play("arthur.flv");
I've been trying for days to figure out how to get a video to play in flash and I have got pretty much nowhere. I have the code below but have no idea what else to try to get it to work. Can anyone please help?
var conn:NetConnection = new NetConnection();
conn.connect(null);
var nstream:NetStream = new NetStream(conn);
nstream.setBufferTime(10);
trailer.attach(nstream);
nstream.play("arthur.flv");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来您忘记了一个关键部分,您需要在 NetConnection 连接成功后将 NetStream 添加到视频对象。
请在此处查看 AS3 NetStream 文档。这里有很多信息和示例可以帮助您上路。
Looks like you forgot one crutial part, you need to add the NetStream to a video object after the NetConnection has connected successfully.
Take a look at the AS3 NetStream docs here. Theres ALOT of info and examples there to get you on your way.
舞台上是否添加了预告片?像这样:
您还检查过 NetStream 是否没有产生错误?像这样:
编辑:您还检查过网络状态和安全错误吗?像这样:
Is trailer added to the stage? Like this:
Also have you checked that the NetStream doesn't produce an error? Like this:
Edit: Also have you check the net status and security errors? Like this: