1

我有这个功能

function onVideo(vchat, idUser){
        $('#videollamada').html('<div class="videollamada">'+
                                '<div align="right">'+
                                    '<a href="javascript:closevll(0,'+idUser+');">Cerrar</a></div>'+
                                '<div align="center">');
        if (AC_FL_RunContent == 0) {
                    alert("This page requires AC_RunActiveContent.js.");
                } else {
                    AC_FL_RunContent(
                                     'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
                                     'width', '350',
                                     'height', '240',
                                     'src', 'videochat',
                                     'quality', 'high',
                                     'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                                     'align', 'middle',
                                     'play', 'true',
                                     'loop', 'true',
                                     'scale', 'showall',
                                     'wmode', 'window',
                                     'devicefont', 'false',
                                     'id', 'videochat',
                                     'bgcolor', '#ffffff',
                                     'name', 'videochat',
                                     'menu', 'true',
                                     'allowFullScreen', 'true',
                                     'allowScriptAccess','sameDomain',
                                     'movie', '../../vChat/videochat?address=ec2-50-19-75-28.compute-1.amazonaws.com&from=0&to=1',
                                     'salign', ''
                                     ); //end AC code
                }
        $('#videollamada').append('</div></div>');

        usingvll= vchat;
        $('#vll_'+idUser).html('<img src="images/webcamUs.png" width="15" />&nbsp;<img src="images/phoneOut.png" width="15" />');
}

它应该使视频聊天的空间可见。它本身就可以工作,我可以加载任何 html 等等。当我尝试在 Flash 中添加一个小 rtmp 客户端时,问题就来了。它不会在页面中显示它,而是刷新页面并仅在浏览器中加载 swf。

任何人都知道如何正确加载 swf,而无需刷新浏览器?

编辑

这就是 AC_FL_RunContent 的样子

function AC_FL_RunContent(){
    var ret =
    AC_GetArgs
    ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
    , "application/x-shockwave-flash"
    );
    AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
} 
4

1 回答 1

1

就像@d1001001 所说,使用 swfobject 而不是 AC_FL_RunContent 就可以了,就像这样:

<script type="text/javascript" src="chat/js/swfobject.js"></script>
<script type="text/javascript>
function onVideo(vchat, idUser){

        $('#videollamada').html('<div class="videollamada">'+
                                '<div align="right">'+
                                    '<a href="javascript:closevll(0,'+idUser+');">Cerrar</a></div>'+
                                '<div id="swfclient" align="center"><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></div></div>');
        usingvll= vchat;
        $('#vll_'+idUser).html('<img src="images/webcamUs.png" width="15" />&nbsp;<img src="images/phoneOut.png" width="15" />');

        //SWFObject
        var flashvars = {};
        flashvars.address = "ec2-50-19-75-28.compute-1.amazonaws.com";
        flashvars.from = "from";
        flashvars.to = idUser;
        var params = {};
        params.quality = "high";
        params.bgcolor = "#cccccc";
        var attributes = {};
        attributes.align = "middle";
        swfobject.embedSWF("http://50.17.226.114/vChat/videochat.swf", "swfclient", "350", "240", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
}
</script>
于 2013-03-02T21:03:13.880 回答