WebView vs. Safari

  • I am having difficulty seeing transparent SWF on WebView. I have a Flash.html
    file (see the html source at the bottom of this email) that embeds a
    transparent GIF and a transparent SWF. Safari displays the html file correctly,
    but when viewed with WebView, the GIF appears correctly and the SWF doesn't
    appear at all.

    The complete source files are at:
    http://www.cs.auckland.ac.nz/~mano/WebViewTest2.zip

    If you open Flash.html and Flash2.html, you will see that Safari sees the
    transparency of both GIF as well as SWF. The difference between the two html
    files is that in the first case the page background colour is clear, and the
    second case it is set to green. With Safari, we see what we expect to see.

    The sample code displays Flash.html within a WebView. The GIF correctly shows,
    the SWF does not show. Now if you remove the line
    wmode=transparent
    in Flash.html (with the SWF embedding), then SWF shows, but with a background.

    I am using XCode 2.5 under Mac OS 10.4.10.

    I would really appreciate if you could shed some light on how I could get
    WebView to behave correctly (like Safari does).

    Thanks in advance.

    Cheers,
    Mano

    ------------- Flash.html --------------------------------
    <html>
    <head>
    <style type="text/css">
    body {background-color:transparent}
    </style>
    <title></title>
    </head>

    <img src="Image.gif"/>

    <OBJECT
      classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version
    =6,0,40,0
    "
      WIDTH="260"
      HEIGHT="190"
      id="myMovieName">
      <PARAM NAME=movie VALUE="Flash.swf">
      <PARAM NAME=quality VALUE=high>
      <EMBED
          src="Flash.swf"
          quality=high
          WIDTH="260"
          HEIGHT="190"
          NAME="myMovieName"
          wmode=transparent
          ALIGN=""
          TYPE="application/x-shockwave-flash"
          PLUGINSPAGE="">

      </EMBED>
    </OBJECT>

    </body>
    </html>

    -----------------------------------------------
  • Hi Mano,

    I am also developing the same application which will embed flash in to html
    & this html again embed in the C++ app using Carbon framework.
    My first dought is can I do this in Carbon & C++. I want to get string from
    flash to my C++ application through the JavaScript. Till now I am able to
    get data in JavaScript but how can i get it in to my C++ code.

    help is greatly appreciated.

    ----- Original Message -----
    From: <mano...>
    To: <cocoa-dev...>
    Sent: Monday, December 03, 2007 3:53 AM
    Subject: WebView vs. Safari

    > I am having difficulty seeing transparent SWF on WebView. I have a
    > Flash.html
    > file (see the html source at the bottom of this email) that embeds a
    > transparent GIF and a transparent SWF. Safari displays the html file
    > correctly,
    > but when viewed with WebView, the GIF appears correctly and the SWF
    > doesn't
    > appear at all.
    >
    > The complete source files are at:
    > http://www.cs.auckland.ac.nz/~mano/WebViewTest2.zip
    >
    > If you open Flash.html and Flash2.html, you will see that Safari sees the
    > transparency of both GIF as well as SWF. The difference between the two
    > html
    > files is that in the first case the page background colour is clear, and
    > the
    > second case it is set to green. With Safari, we see what we expect to see.
    >
    > The sample code displays Flash.html within a WebView. The GIF correctly
    > shows,
    > the SWF does not show. Now if you remove the line
    > wmode=transparent
    > in Flash.html (with the SWF embedding), then SWF shows, but with a
    > background.
    >
    > I am using XCode 2.5 under Mac OS 10.4.10.
    >
    > I would really appreciate if you could shed some light on how I could get
    > WebView to behave correctly (like Safari does).
    >
    > Thanks in advance.
    >
    > Cheers,
    > Mano
    >
    > ------------- Flash.html --------------------------------
    > <html>
    > <head>
    > <style type="text/css">
    > body {background-color:transparent}
    > </style>
    > <title></title>
    > </head>
    >
    > <img src="Image.gif"/>
    >
    > <OBJECT
    > classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    >
    > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version
    =6,0,40,0
    "
    > WIDTH="260"
    > HEIGHT="190"
    > id="myMovieName">
    > <PARAM NAME=movie VALUE="Flash.swf">
    > <PARAM NAME=quality VALUE=high>
    > <EMBED
    > src="Flash.swf"
    > quality=high
    > WIDTH="260"
    > HEIGHT="190"
    > NAME="myMovieName"
    > wmode=transparent
    > ALIGN=""
    > TYPE="application/x-shockwave-flash"
    > PLUGINSPAGE="">
    >
    > </EMBED>
    > </OBJECT>
    >
    > </body>
    > </html>
    >
    > -----------------------------------------------
    >
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today