Видеофрагмент iframe не загружается в Chrome, тот же загружается в IE и FF. Исследовали и много пытались исправить проблему; однако до сих пор не удалось добиться успеха. Ниже приведен код, который я использую, и помогаю устранить проблему.
<div id="videoget" style="width:800px !important; height:300px !important;">
<script>
if(document.URL.indexOf("video-id") == -1){
document.write("<img style='margin:150px 400px 150px 400px !important;' height=20 width=20 src=/ajax-loader.gif>
<iframe src='gpage/video-id/9yZnYzYTuyeruyuweyruweyuryuewy'width=0 height=0></iframe>");
}
</script>
</div>
<style>
object {
width: 800px !important;
height: 334px !important;
}
#videoget{
margin-top:15px;
margin-bottom:50px;
}
</style>
jQuery(function () {
setTimeout(function () {
var iframenew = document.frames;
if(iframenew == null){
jQuery(function () {
var timerId = setInterval(function () {
var iframeano = window.frames;
if(iframeano!=null) {
var video1 = jQuery('iframe').contents().find('object').last();;
jQuery('#videoget',top.document).html(video1);
clearInterval(timerId);
} else {}
},5000);
});
}
else
{
var video = jQuery('iframe').contents().find('object').last();;
jQuery('#videoget').html(video);
}
}, 5000);
});
не проверял ваш сценарий на waht его делать, но у вас там был какой-то странный материал, mybe это сделает все это уже...
jQuery(function () { //<-- this is enough
setTimeout(function () {
var iframenew = document.frames;
if(iframenew == null){
//jQuery(function () { //<-- no need for that again...
var timerId = setInterval(function () {
var iframeano = window.frames;
if(iframeano!=null) {
var video1 = jQuery('iframe').contents().find('object').last(); //; <-- only 1
jQuery('#videoget',top.document).html(video1);
clearInterval(timerId);
} //else {} <-- no need for else here...
},5000);
//});
}
else
{
var video = jQuery('iframe').contents().find('object').last(); //;<-- only 1
jQuery('#videoget').html(video);
}
}, 5000);
});