开发者

JWplayer Javascript interaction not working

开发者 https://www.devze.com 2023-03-15 12:25 出处:网络
this problem is going to make me bald. Save my hair plz. i have been trying every possible way to stop and pause and play the JWplayer latest version using its JavaScript API and nothing works.

this problem is going to make me bald. Save my hair plz.

i have been trying every possible way to stop and pause and play the JWplayer latest version using its JavaScript API and nothing works.

here is the code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>JW Player 5 playlist</title>
    <script src="jquery-1.3.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="jwplayer.js"></script>
    <script type="text/javascript" src="swfobject.js"></script>



</head>
<body>

<!-- START OF THE PL开发者_JAVA技巧AYER EMBEDDING TO COPY-PASTE -->
<div id="mediaplayer">JW Player goes here</div>


<script type="text/javascript">
    jwplayer("mediaplayer").setup({
        flashplayer: "player.swf",
        file: "lounge warmup.3gp",
        skin: "simple/simple.zip",
        image: "http://content.bitsontherun.com/thumbs/nPripu9l-480.jpg",
        controlbar: "bottom",
        width: "400",
        height: "8"
    });
</script>
<!-- END OF THE PLAYER EMBEDDING -->
<br>

<a href="#" onclick="jwplayer().stop(); return false;">Stop playback</a>

</body>
</html>

why this is not working??


Your code works for me (after I adjusted the "file" to something I had locally). Some possibilities:

  1. Are you loading this with a "file://" URL, or are you loading it from an actual web server? (If from a file:// URL, there might be Flash security restrictions.)

  2. Do you intend to have a height of 8px as you've currently specified? I don't know what your custom skin looks like. In order to see things using default skin I had to specify a larger height.

  3. I'm not very familiar with JWPlayer, but is it possible the file parameter needs to be URL encoded? (If not sure, maybe trying removing the space from the file name and renaming it on the server as well.)

In any case, your code works for me using default skin and different media file. I can play and then click your "stop" link to stop playback. If ideas above don't help, then you'll need to specify exactly what is not working for you.

0

精彩评论

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

关注公众号