Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    2
    Member #
    20959
    Hi,

    I am trying to dynamically update DIV tag inner html. But the result works in Firefox but not in IE.

    Any help
    HTML Code:
     function LoadSelectedVideo(indexVal)
        {         
            var flashString = "flv=/videos/test/test.flv&startimage=start_frame.jpg&srturl=/videos/test/video.srt&title=Laughing&width=500&height=360&autoplay=0&autoload=0&buffer=5&buffermessage=Buffering...&buffercolor=ffffff&bufferbgcolor=000000&buffershowbg=0&titlesize=20&titlecolor=ffffff&margin=1&srt=1&srtcolor=ffffff&srtbgcolor=000000&srtsize=11&showstop=1&showvolume=1&showtime=1&showplayer=autohide&showloading=autohide&showfullscreen=1&showswitchsubtitles=0&showmouse=autohide&loop=0&playercolor=000000&loadingcolor=9b9a9a&bgcolor=000000&bgcolor1=000000&bgcolor2=000000&buttoncolor=ffffff&buttonovercolor=cfcece&slidercolor1=ffffff&slidercolor2=cfcece&sliderovercolor=cfcece&loadonstop=0&onclick=playpause&onclicktarget=_blank&ondoubleclick=fullscreen&ondoubleclicktarget=_blank&playertimeout=1500&videobgcolor=000000&volume=100&shortcut=1&playeralpha=100&top1=0&showiconplay=1&iconplaycolor=ffffff&iconplaybgcolor=dddddd&iconplaybgalpha=25&showtitleandstartimage=1";
            
    
            var movieHTML = '<object id="objectVideo" type="application/x-shockwave-flash" data="/add-on/Videos/video_player.swf" width="500" height="360"> ' +
                            ' <param name="movie" value="/add-on/Videos/video_player.swf" /> ' +
                            ' <param name="allowFullScreen" value="true" />' +
                            ' <param name="wmode" value="opaque" />' +
                            ' <param name="allowScriptAccess" value="sameDomain" />' +
                            ' <param name="quality" value="high" />' +
                            ' <param name="menu" value="true" />' +
                            ' <param name="autoplay" value="true" />' +
                            ' <param name="autoload" value="true" />' +
                            ' <param name="FlashVars" id="flashValue" value="' + flashString + '" /> ' +
                        ' </object>    ';
    
            document.getElementById("divPlayer").innerHTML = movieHTML ;
    In IE, all the flashVars gets updated, video label inside video player changes; but the video does not play. In Firefox, all cool.

  2.  

  3. #2
    Senior Member imagn's Avatar
    Join Date
    Jul 2007
    Location
    Los Angeles
    Posts
    156
    Member #
    15594
    Try concatenating the actual variable:
    Code:
    var movieHTML = '<object id="objectVideo" type="application/x-shockwave-flash" data="/add-on/Videos/video_player.swf" width="500" height="360">';
    movieHTML += '<param name="movie" value="/add-on/Videos/video_player.swf" />';
    movieHTML += '<param name="allowFullScreen" value="true" />';
     
    ect...

  4. #3
    Junior Member
    Join Date
    Jan 2010
    Posts
    2
    Member #
    20959
    what difference does it make...? Nothing.
    At the end, in my code if I use alert(movieHTML) it gives full HTML message.

    The problem I have is in IE, the flash movie player does not load the flashvars completely. But in Firefox and others it does.

    I tried other types of scripts too, like swobject. Same issue.

  5. #4
    Junior Member
    Join Date
    Jan 2010
    Posts
    4
    Member #
    21021
    you have to include the classid and codebase for IE, so you have to write two objects,
    I would do this:
    Code:
    function FlashGiver(elid, fw, fh, fdta, fid, fbgc, ieorno, fvars) {
    if (ieorno=="ie") {
    document.getElementById(elid).innerHTML=
    '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
    'codebase="http://download.macromedia.com/'+'pub/shockwave/cabs/flash/swflash.cab#'+
    'version=9,0,0,0" id="'+fid+'" width="'+fw+'" height="'+fh+'">\n'+
    '<param name="movie" value="'+fdta+'" />\n'+'<param name="bgcolor" value="'+fbgc+'" />\n'+
    '<param name="swliveconnect" value="true" />\n'+'<param name="quality" value="high" />\n'+
    '<param name="menu" value="false" />\n'+'<param name="allowscriptaccess" value="SameDomain" />\n'+
    '<param name="flashvars" value="'+ fvars +'" />\n'+
    '</object>\n';}else {
    document.getElementById(elid).innerHTML=
    '<object type="application/x-shockwave-flash"\n'+
    'data="'+fdta+'"\n'+'width="'+fw+'" height="'+fh+'" id="'+fid+'">\n'+
    '<param name="bgcolor" value="'+fbgc+'" />\n'+'<param name="swliveconnect" value="true" />\n'+
    '<param name="quality" value="high" />\n'+'<param name="menu" value="false" />\n'+
    '<param name="stanby" value="Flash Loading.." />\n'+'<param name="allowscriptaccess" value="Always" />\n'+
    '<param name="flashvars" value="'+ fvars +'" />\n'+
    '</object>\n';} }
    
    //so to initialize the swf:
    <script type="text/javascript">
      //<![CDATA[
      var nav=navigator.appName;
      if (nav.indexOf("Internet Explorer")==-1 && nav.indexOf("MSIE")==-1)
      {FlashGiver("divID", "500", "500", "your.swf", "swfID", "#FFFFFF", "no", flashString); }
      else {FlashGiver("divID", "500", "500", "your.swf", "swfID", "#FFFFFF", "ie", flashString);  }
      //]]>
      </script>
    but it is better to use swfObject 2.2 (it does work, like this)
    Code:
    <div id="idOfDiv">this div will become the object</div>
    <script type="text/javascript">
    //<![CDATA[
    
    var flashvars = {};
    var params = {};
    var attributes = {};
    
    params.menu = "true";
    params.wmode = "opaque";
    params.allowscriptaccess = "sameDomain";
    params.allowfullscreen = "true";
    params.flashvars = "flv=and so on";
    
    swfobject.embedSWF("your.swf", "idOfDiv", "100", "100", "8.0.0", false, flashvars, params, attributes);
    
    
    //]]>
    </script>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

javascript update object tag

Click on a term to search for related topics.
All times are GMT -6. The time now is 05:08 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com