页面加载时在 Flowplayer 中查找

发布于 2024-10-18 10:58:44 字数 528 浏览 6 评论 0原文

我想在页面加载时寻找一个流播放器。

我尝试过:

$(document).ready(function() {
  $f(0).seek(5);
});

and

$(document).ready(function() {
  while(!$f(0).isLoaded()) {
    $f(0).seek(5);
  }
});

and

$(document).ready(function() {
  $f(0).onLoad(function() {
    $f(0).seek(5);
  });
});

and 这个给出了结果,有一段时间

$f(0).onLoad(function() {
  $f(0).seek(5);
});

最后一个将指针移动到 5 秒,然后又回到开始处。 我想让它站在那里。

有什么建议吗?

I want to seek a flowplayer at the page load.

I have tried:

$(document).ready(function() {
  $f(0).seek(5);
});

and

$(document).ready(function() {
  while(!$f(0).isLoaded()) {
    $f(0).seek(5);
  }
});

and

$(document).ready(function() {
  $f(0).onLoad(function() {
    $f(0).seek(5);
  });
});

and this one gave result, for a while

$f(0).onLoad(function() {
  $f(0).seek(5);
});

The last one moved the pointer to 5 seconds, and back to the start right after.
I want it to stand there.

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

春风十里 2024-10-25 10:58:44

官方答复:
http://flowplayer.org/forum/3/101287#post-101528


看起来我只是因为放了一个链接而被否决了,这是可以理解的,因为 flowplayer 已经更改了他们的论坛 URL!

https://web.archive.org/web/20120629142246/http://flowplayer.org/forum/3/101287

这是操作

Found this old question on stack overflow...
http://stackoverflow.com/questions/5034858/seek-in-flowplayer-on-page-load 

Wondering what the official answer is? How do you seek on load?

和响应

The onLoad event (of the player) is to early an event to seek a clip. 
So you cannot seek onLoad.

You can seek once a clip is loaded and in play or pause state. 
Move the seek in the onStart event of the clip - always assuming that you deploy via a streaming server.

official answer:
http://flowplayer.org/forum/3/101287#post-101528


looks like I was downvoted for just putting a link, and that is understandable as flowplayer has changed their forum URLS!

https://web.archive.org/web/20120629142246/http://flowplayer.org/forum/3/101287

Here is the OP

Found this old question on stack overflow...
http://stackoverflow.com/questions/5034858/seek-in-flowplayer-on-page-load 

Wondering what the official answer is? How do you seek on load?

and the response

The onLoad event (of the player) is to early an event to seek a clip. 
So you cannot seek onLoad.

You can seek once a clip is loaded and in play or pause state. 
Move the seek in the onStart event of the clip - always assuming that you deploy via a streaming server.
酷到爆炸 2024-10-25 10:58:44

我认为在某些情况下,暂停玩家、跳到首选位置并重新开始会有所帮助。当您将 Flowplayer 配置为自动缓冲时,它将开始播放并在第一帧暂停。这也许可以解释您所看到的行为(寻求 5,跳转到 0,然后再次跳转到 5。但我认为您使用加载事件的修复很好地解决了这个问题,我使用了类似的技巧来等待持续时间变为可用的。

I think in some cases it would help to pause the player, jump to the prefered position and the start again. When you have Flowplayer configured to auto buffer it will start playing and pause at the first frame. That could maybe explain the behavior you are seeing (seek to 5, jump to 0 and jump to 5 again. But I think your fix using the load event pretty well solves it, I've used a similar trick to wait for duration to become available.

静赏你的温柔 2024-10-25 10:58:44

解决了!

使用

$f(0).onLoad(function() {
    $f(0).seek(5);
    setTimeout('$f(0).seek(5)',1000);
}

然后它寻找 5,由于某种原因跳回到 0,并再次寻找 5。

Solved it!

Used

$f(0).onLoad(function() {
    $f(0).seek(5);
    setTimeout('$f(0).seek(5)',1000);
}

Then it seeked to 5, jumped back to zero for some reason, and seeked to 5 again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文