html部分:
<body>
<div class="livediv livebody" style="display:table-row;height:100%;">
<div id="divswf1" style="vertical-align: middle; display: table-cell; position: relative;">
<div id="objectFront1" class="objectFront"></div>
<object type="application/x-shockwave-flash" data="js/play.swf" id="play_137" style="width: 100%; height: 100%;"><param name="allowNetworking" value="all"><param name="allowScriptAccess" value="always"><param name="allowFullScreen" value="true"><param name="flashvars" value="autoplay=true&muted=true&rtmpConnection=rtmp://127.0.0.1/live&rtmpStream=10037"><param name="wmode" value="transparent"></object>
</div>
</div>
</body>
<script type="text/javascript">
document.ondblclick = function(e){
e = e || window.event;
var dom = e.srcElement|| e.target;
console.log("dblclick id: " + dom.id);
};
document.onclick = function(e){
e = e || window.event;
var dom = e.srcElement|| e.target;
console.log("click id: " + dom.id);
};
$(function(){
var obj = $("#divswf1 object");
obj.css("width","100%");
obj.css("height","100%");
//obj.css("pointer-events","none");
document.getElementById($("#objectFront1").attr("id")).onclick = function(e){
console.log("CLICK:" + obj.attr("id"));
document.getElementById(obj.attr("id")).click();
};
document.getElementById($("#objectFront1").attr("id")).ondblclick = function(e){
if ( $("#divswf1").find("object").length == 1 && !checkFullScreen()){ //非全屏状态下处理双击
switchFullScreen(1);
}
};
$("#playertable div.divparent").dblclick(function(){
if ($(this).find("object").length == 1 && !checkFullScreen()){ //非全屏状态下处理双击
var index = parseInt($(this).attr("data-index"));
switchFullScreen(index);
}
});
});
</script>
CSS部分:
#playertable div.livediv .objectFront{
display:inline;
height:100%;
width:100%;
top: 0;
left: 0;
position:absolute;
background-color:transparent;
z-index:1000;
}