无法访问 flowplayer api

发布于 2024-11-29 23:26:53 字数 1576 浏览 0 评论 0原文

我无法访问 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 技术交流群。

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

发布评论

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

评论(1

横笛休吹塞上声 2024-12-06 23:26:53

显然,在 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.

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