Flash:VideoPlayer.load 方法有时会失败...思考为什么以及如何恢复?
我有一部电影使用 VideoPlayer 类加载 flv。 它是通过加载函数来完成的。
以下是我正在执行的代码示例:
_root.createEmptyMovieClip("SlideA", 1);
...
SlideA.loadMovie(urlContainingFunctionForLoadVideo);
... // SlideA has completely loaded
SlideA.loadVideo(urlToFLV);
function loadVideo(url)
{
this.attachMovie("VideoPlayer", "my_vp", this.getNextHighestDepth(), {x:0, y:0});
my_vp.load(url);
}
我正在使用 Flash 8 IDE 导出到 Flash 8 和 ActionScript 2.0。 我看到的是,有时此功能会失败,但只有当其他内容首先加载到 SlideA 中时才会失败。 加载的影片是使用 ActionScript 1.0 的 Flash 6 影片。 我发现当加载失败时 VideoPlayer.bytesTotal 是未定义的并且永远不会改变。 该文件可以被缓存或不被缓存,并且这种情况会发生。 考虑如何处理这个问题?
I have a movie that loads an flv using the VideoPlayer class. It does it with the load function.
Here is a code sample of what I'm doing:
_root.createEmptyMovieClip("SlideA", 1);
...
SlideA.loadMovie(urlContainingFunctionForLoadVideo);
... // SlideA has completely loaded
SlideA.loadVideo(urlToFLV);
function loadVideo(url)
{
this.attachMovie("VideoPlayer", "my_vp", this.getNextHighestDepth(), {x:0, y:0});
my_vp.load(url);
}
I'm using the Flash 8 IDE exporting to Flash 8 and ActionScript 2.0. What I'm seeing is that sometimes this function fails but only when something else has been loaded into SlideA first. The loading movie is a Flash 6 movie using ActionScript 1.0. I'm seeing that when the load fails that VideoPlayer.bytesTotal is undefined and that never changes. The file can be cached or not cached and this happens. Thoughts on how to deal with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现使用VideoPlayer是错误的想法,而是直接使用NetStream和NetConnection。
I found out that using VideoPlayer was just the wrong idea and instead just used NetStream and NetConnection directly.
也许问题是
Maybee the issue is