Flash:VideoPlayer.load 方法有时会失败...思考为什么以及如何恢复?

发布于 2024-07-13 16:58:05 字数 645 浏览 3 评论 0原文

我有一部电影使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

十六岁半 2024-07-20 16:58:05

我发现使用VideoPlayer是错误的想法,而是直接使用NetStream和NetConnection。

I found out that using VideoPlayer was just the wrong idea and instead just used NetStream and NetConnection directly.

只等公子 2024-07-20 16:58:05

也许问题是

this.getNextHighestDepth() try getNextHighestDepth() or SlideA.getNextHighestDepth()

function loadVideo(url)
{
     this.attachMovie("VideoPlayer", "my_vp", this.getNextHighestDepth(), {x:0, y:0});
     my_vp.load(url);
}

Maybee the issue is

this.getNextHighestDepth() try getNextHighestDepth() or SlideA.getNextHighestDepth()

function loadVideo(url)
{
     this.attachMovie("VideoPlayer", "my_vp", this.getNextHighestDepth(), {x:0, y:0});
     my_vp.load(url);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文