2012-05-28 77 views
0

編輯:哇,解決它通過在配置部分首先放置'文件'和'Flashplayer'配置。我想這兩個參數必須先在配置部分。使用JW播放器靜音切換鏈接閃回與回退到HTML5視頻不起作用

所以此工程(您不能加載從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。無效。使用MP4文件,以便代碼從Flash閃回到HTML5視頻。

這不工作或者與jQuery包含在頁面

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

JW播放器與JW的JavaScript代碼中插入:

<!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> 
+0

jwplayer(「vs」)。setMute(); –

回答

2

看來文件和版本的Adobe Flash參數必須首先在配置部分。 去圖。

<!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>