繁体   English   中英

使用JW播放器闪存进行静音切换的链接,回退到HTML5视频无法正常工作

[英]Link for mute toggle using JW Player flash with fallback to HTML5 video not working

编辑:哇,首先在配置部分放置'文件'和'flashplayer'配置解决它。 我想这两个参数必须首先在配置部分。

所以这个工作(你不能像这样从longtailvideo.com加载文件,因为跨域的东西,只需使用你自己的本地文件来测试)

<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="jwplayer.js"></script>
</head>
<body>
<div id="vs" style="width:300px;height:250px;"></div>
<a href="javascript:void(0);" onclick="jwplayer().setMute();">Toggle the audio</a>
</body>
</html>

<script type="text/javascript">
jwplayer("vs").setup({
file: "http://content.longtailvideo.com/videos/flvplayer.flv",
flashplayer: "player.swf",
autostart:true,
controlbar: "none",
icons: "false",
repeat:"always",
stretching:"exactfit",
width:300,
height:250,
mute:"true"
});
</script>

无法进行静音切换工作。 根据Longtail的文档(http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/16022/controlling-the-player-using-javascript),我所要做的就是制作与onclick的链接。 不起作用。 我甚至尝试使用JQuery的.click无济于事。 使用MP4文件,使代码从闪存回落到HTML5视频。

这不适用于页面中包含的JQuery

<script type="text/javascript">
$(document).ready(function(){
$('#mutetoggle').click(function(){
jwplayer().setMute();
});
});
</script>

嵌入JW javascript的JW Player:

<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="jwplayer.js"></script>
</head>
<body>
<div id="vs" style="width:300px;height:250px;"></div>
<a href="#" id="mutetoggle" onclick="jwplayer().setMute();">Toggle the audio</a>
</body>
</html>

<script type="text/javascript">
jwplayer("vs").setup({
autostart:true,
controlbar: "none",
icons: "false",
repeat:"always",
stretching:"exactfit",
file: "http://content.longtailvideo.com/videos/flvplayer.flv",
flashplayer: "player.swf",
volume:50,
width:300,
height:250,
mute:"true"
});
</script>

似乎文件和flashplayer参数必须在配置部分中排在第一位。 去搞清楚。

<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="jwplayer.js"></script>
</head>
<body>
<div id="vs" style="width:300px;height:250px;"></div>
<a href="javascript:void(0);" onclick="jwplayer().setMute();">Toggle the audio</a>
</body>
</html>

<script type="text/javascript">
jwplayer("vs").setup({
file: "http://content.longtailvideo.com/videos/flvplayer.flv",
flashplayer: "player.swf",
autostart:true,
controlbar: "none",
icons: "false",
repeat:"always",
stretching:"exactfit",
width:300,
height:250,
mute:"true"
});
</script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM