JWplayer JavaScript交互不工作 [英] JWplayer Javascript interaction not working

查看:262
本文介绍了JWplayer JavaScript交互不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题会让我秃顶。保存我的头发PLZ。

我一直在想尽一切办法停下来,使用JavaScript API播放JWplayer的最新版本,没什么效果。 b
$ b

这里是代码:

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

< title> JW Player 5播放列表< / title>
< script src =jquery-1.3.2.min.jstype =text / javascript>< / script>
< script type =text / javascriptsrc =jwplayer.js>< / script>
< script type =text / javascriptsrc =swfobject.js>< / script>



< / head>
< body>

<! - 启动播放器嵌入复制粘贴 - >
< div id =mediaplayer> JW Player go 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,
高度:8
});
< / script>
<! - 播放器嵌入结束 - >
< br>

< a href =#onclick =jwplayer()。stop(); return false;>停止播放< / a>

< / body>
< / html>

为什么这不起作用??

解决方案

你的代码适用于我(在我调整了文件我本地)之后。一些可能性:


  1. 你是用file://URL加载的,还是从实际加载网络服务器? (如果来自file:// URL,则可能存在Flash安全限制。)


  2. 您打算如现在那样拥有8px的高度指定?我不知道你的自定义皮肤是什么样子的。为了看到使用默认皮肤的东西,我必须指定一个更大的高度。

  3. 我不是很熟悉JWPlayer,但有可能是文件参数需要进行网址编码? (如果不确定,可能试图从文件名中删除空格并在服务器上重命名)。 >无论如何,你的代码使用默认的外观和不同的媒体文件。我可以玩,然后点击你的停止链接停止播放。如果上面的想法没有帮助,那么你需要指定什么是不适合你的。

    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 PLAYER 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.

    这篇关于JWplayer JavaScript交互不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆