程序的功能如下:
我的问题:
我在chrome上运行的程序是正确的,但在IE10上运行失败。我认为问题是“player [x] .mute()”和“players [x] .setVolume(100)”,因为当我删除它们时,程序可以在IE10上运行。
请帮帮我〜
<!DOCTYPE HTML>
<html>
<head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
</head>
<body>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
<script type="text/javascript" src="http://www.pureexample.com/js/lib/jquery.ui.touch-punch.min.js"></script>
<script>
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var players = new Array();
function onYouTubePlayerAPIReady() {
players[0] = new YT.Player('player0', {
playerVars: { 'autoplay': 1, 'controls': 1,'rel': 0, 'enablejsapi': 1,
'iv_load_policy': 3 },
videoId: 'JW5meKfy3fY',
events: {
'onReady': onPlayerReady1
}
});
players[1] = new YT.Player('player1', {
playerVars: { 'autoplay': 1, 'controls': 1,'rel': 0, 'enablejsapi': 1,
'iv_load_policy': 3 },
videoId: 'kCWBIPFVbw0',
events: {
'onReady': onPlayerReady2
}
});
players[2] = new YT.Player('player2', {
playerVars: { 'autoplay': 1, 'controls': 1,'rel': 0, 'enablejsapi': 1,
'iv_load_policy': 3 },
videoId: '8uV1yoN7kHI',
events: {
'onReady': onPlayerReady2
}
});
}
function onPlayerReady1(event) {
event.target.unmute();
}
function onPlayerReady2(event) {
event.target.mute();
}
var x=0;
$(function(){
$("#vedio1").hide();
$("#vedio2").hide();
});
$(function(){
$("#test").click(function(){
var now = "vedio"+x.toString();
$("#"+now).hide();
players[x].mute();
x = (x+1)%3;
var chanVed = "vedio"+x.toString();
$("#"+chanVed).show();
players[x].setVolume(100);
});
});
</script>
<table>
<tr>
<td>
<input id="test" type="button" value="turn"/>
</td>
</tr>
<tr id="vedio0">
<td>
<div id="player0"></div>
</td>
</tr>
<tr id="vedio1">
<td>
<div id="player1"></div>
</td>
</tr>
<tr id="vedio2">
<td>
<div id="player2"></div>
</td>
</tr>
</table>