好了,這是我的第一篇文章,所以我會盡量不發出聲音來這裏noobish .....麻煩IE,YUI和Flash
我工作的一個項目在我公司的網站和我有一些視頻問題。我通過AJAX調用來抓取一些視頻並將其放置到YUI面板中以創建我自己的視頻燈箱。在所有瀏覽器中,一切都運行良好,當然,IE除外(特別是因爲我們放棄了支持7)。我可以打開面板並顯示Flash播放器,但不會加載.flv或播放器控件。就像我說的,在所有其他瀏覽器中都很好。這裏是我一起工作的主腳本:
/**
* Function to lazy load, then show the video panel with the content of the link passed in inside the panel
*/
var showVideoPanel = function(e, linkEl){
Event.preventDefault(e);
if(!YAHOO.env.getVersion("videoPanel")) {
var successHandler = function() {
videoPanel = new COUNTRY.widget.VideoPanel("videoPanel", " ");
showVideoPanel(e, linkEl);
};
//this is not likely to go off (404 is not considered an error)
var failureHandler = function() {
window.location = linkEl.href;
return;
};
COUNTRY.loadComponent("videoPanel", successHandler, failureHandler);
}
else {
COUNTRY.util.Ajax.getRemoteContent('GET', linkEl.href, videoPanel.body, {
success: function(o){
var start, end, el;
el = Dom.get(videoPanel.body);
start = o.responseText.indexOf('<object');
end = o.responseText.indexOf('</object>', start);
el.innerHTML = o.responseText.substring(start, end);
},
failure: function(o){
el = Dom.get(videoPanel.body);
el.innerHTML = "The requested content is currently unavailable. Please try again later.";
}
});
var bod = Dom.get(videoPanel.body);
COUNTRY.util.Flash.flashControl(bod.getElementsByTagName("FORM")[0]);
videoPanel.show(linkEl);
}
};