0

尝试使用oiplayer
时,调用此回退函数时出现错误:

$(document).ready(
    function(){
    // i tried adding this: header("content-type:application/json");

    $('div.player').oiplayer(
    server: 'http://www.openimages.eu', 
    jar: '/oiplayer/plugins/cortado-ovt-stripped-0.6.0.jar',
    flash: '/oiplayer/plugins/flowplayer-3.2.7.swf', 
    controls: 'top'
    );
});

Firefox 说:SyntaxError: missing ) after argument list
Chrome 说:Uncaught SyntaxError: Unexpected token :
Safari 说:Unexpected token ) 并指向第一个有:

<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="plugins/flowplayer-3.2.6.min.js" type="text/javascript"><!-- help ie --></script>
<script src="js/jquery.oiplayer.js" type="text/javascript"><!-- help ie --></script>
</head>
<body>
<script src="build/oiplayergo.js">
</script>

        <div id="container" style ="position:absolute; left:20%;top:25%;">
        <!--img class="preview video" width="788" height="288" title="click to play" alt="click to play" src="http://www.openimages.eu/images/599192/WEEKNUMMER364-HRE0000D9C6.png" 
        style = "position:absolute; left:0;right:0;"></img-->
        <div class="player" style = "position:absolute; left:0;right:0;>
        <video width="788" height="288">
          <source type="video/ogg; codecs=theora" src="http://www.openimages.eu/files/09/9734.9730.WEEKNUMMER364-HRE0000D9C6.ogv"  />
          <source type="video/webm; codecs=vp8" src="http://www.openbeelden.nl/files/09/88068.9730.WEEKNUMMER364-HRE0000D9C6.webm" />
          <source type="video/mp4; codecs=avc1.42E01E,mp4a.40.2" src="http://www.openimages.eu/files/09/9740.9730.WEEKNUMMER364-HRE0000D9C6.mp4" />
        </video>
        </div>
        </div>
</body>
</html>

4

1 回答 1

0

似乎选项应该是一个对象,反正你的语法不正确。

$(document).ready(
    function(){
    $('div.player').oiplayer({ //<-- Here
    server: 'http://www.openimages.eu', 
    jar: '/oiplayer/plugins/cortado-ovt-stripped-0.6.0.jar',
    flash: '/oiplayer/plugins/flowplayer-3.2.7.swf', 
    controls: 'top'
    });//<-- Here
});

似乎提供的链接中的文档也有类似的用法,这是不正确的,设置应该是一个对象,所以试试上面的。

这是根据来源默认的:

jQuery.fn.oiplayer = function(settings) {
    var config = {
        server : 'http://www.openimages.eu',
        jar : '/oiplayer/plugins/cortado-ovt-stripped-0.6.0.jar',
        flash : '/oiplayer/plugins/flowplayer-3.2.7.swf',
        controls : true,
        log: 'error'
    };
    if (settings) $.extend(config, settings);
于 2013-10-06T00:31:09.767 回答