开发者

No access to flowplayer api

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("play开发者_如何学JAVAer", "../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>


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜