尝试使用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:缺少)
Chrome说:Uncaught SyntaxError:意外的令牌:
Safari说:意外的令牌)并指向首先有的行
<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>
<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>
答案 0 :(得分: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);