无法访问 flowplayer api
我无法访问 flowplayer API。函数 flowplayer.isLoaded () 返回 false,但播放器工作正常并播放所需的视频。我做错了什么? 例子: <代码>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- A minimal Flowplayer setup to get you started -->
<!--
include flowplayer JavaScript file that does
Flash embedding and provides the Flowplayer API.
-->
<script type="text/javascript" src="flowplayer-3.2.6.min.js"></script>
<!-- some minimal styling, can be removed -->
<link rel="stylesheet" type="text/css" href="style.css">
<!-- page title -->
<title>Minimal Flowplayer setup</title>
</head><body>
<a
href="http://localhost:8084/PlayerTest/content/some_video.flv"
style="display:block;width:520px;height:330px"
id="player">
</a>
<!-- this will install flowplayer inside previous A- tag. -->
<script type="text/javascript">
flowplayer("player", "../flowplayer-3.2.7.swf");
</script>
<script type="text/javascript">
function gett(){
var text=flowplayer("player").getStatus();
document.getElementById("state").innerHTML="bstart: "+text.bufferStart+" bend: "+text.bufferEnd+" time: "+flowplayer().isLoaded();
}
</script>
<div id="state">state</div>
<input type="button" value="get" onclick="gett();" />
</body>
<代码>
I can not get access to flowplayer API. Function flowplayer.isLoaded ()
returns false, but the player works fine and plays the desired video. What am I doing wrong?
Example:
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- A minimal Flowplayer setup to get you started -->
<!--
include flowplayer JavaScript file that does
Flash embedding and provides the Flowplayer API.
-->
<script type="text/javascript" src="flowplayer-3.2.6.min.js"></script>
<!-- some minimal styling, can be removed -->
<link rel="stylesheet" type="text/css" href="style.css">
<!-- page title -->
<title>Minimal Flowplayer setup</title>
</head><body>
<a
href="http://localhost:8084/PlayerTest/content/some_video.flv"
style="display:block;width:520px;height:330px"
id="player">
</a>
<!-- this will install flowplayer inside previous A- tag. -->
<script type="text/javascript">
flowplayer("player", "../flowplayer-3.2.7.swf");
</script>
<script type="text/javascript">
function gett(){
var text=flowplayer("player").getStatus();
document.getElementById("state").innerHTML="bstart: "+text.bufferStart+" bend: "+text.bufferEnd+" time: "+flowplayer().isLoaded();
}
</script>
<div id="state">state</div>
<input type="button" value="get" onclick="gett();" />
</body>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,在 API 可用之前,播放器必须“加载”。您可以通过编程方式执行此操作。尽管由于自动播放,视频可能已经在播放。
Apparently the player must be 'loaded' before the API is available. You can do this programmatically. This is despite that the video may already be playing thanks to autoplay.