开发者

XSLT issues with playing Flash in IE and FireFox

开发者 https://www.devze.com 2023-03-21 11:48 出处:网络
Alright, I am trying to play a flash video in a YUI panel.I was having trouble getting it to work in IE.Fixed it, but then that caused it not to work in FireFox.I have spent HOURS debugging and this i

Alright, I am trying to play a flash video in a YUI panel. I was having trouble getting it to work in IE. Fixed it, but then that caused it not to work in FireFox. I have spent HOURS debugging and this is what I found: My XSLT doc is causing the problem! Here it is:

<div id="mediaDisplay">
  <xsl:if test="//video/videoFile">
    <div class="flash" id="flashVid">
      <noscript>
        <object type="application/x-shockwave-flash" data="flash/playerVar1.2.swf" width="525" height="425" id="MediaEmbedObject" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
          <param name="movie" value="flash/playerVar1.2.swf"/>
          <param name="salign" value="lt"/>
          <param name="loop" value="false"/>
          <param name="menu" value="false"/>
          <param name="allowFullScreen" value="true"/>
          <param name="AutoPlay" value="true"/>
          <param name="FlashVars" 开发者_开发技巧value="movieSrc={$videouri}"/>
          <embed AutoPlay="true" src="flash/playerVar1.2.swf" quality="high" name="videogalleryObject" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="525" height="425" id="videogalleryObject" FlashVars="{$videouri}" allowFullScreen="true">
          </embed>
        </object>
      </noscript>
      <form action="" name="flashForm">
        <fieldset>
          <input type="hidden" name="flashDivId" value="flashVid"/>
          <input type="hidden" name="flashWidth" value="525"/>
          <input type="hidden" name="flashHeight" value="425"/>
          <input type="hidden" name="flashUrl" value="flash/playerVar1.2.swf"/>
          <input id="playingFlash" type="hidden" name="FlashVars" value="{$videouri}"/>
          <input type="hidden" name="flashName" value="Flash"/>
          <input type="hidden" name="flashAltText" value="{//video/altText}"/>
          <input type="hidden" name="allowScriptAccess" value="always"/>
          <input type="hidden" name="allowFullScreen" value="true"/>
        </fieldset>
      </form>
    </div>
  </xsl:if>
</div>

Now, the way it is written here it works in FireFox. To make it work in IE the only thing that actually did the trick was removing the data="flash/playerVar1.2.swf" attribute from the <object> tag and and changing it to value="flash/playerVar1.2.swf". Doing this gets me full functionality in IE, but nothing in FireFox. I'd give you a link to see for yourself but it is still in QA. Does anyone have a way of making this work on across all platforms. Is there a way to run browser detection inline in my XSLT and then give it conditionals? Any and all ideas would be appreciated. Thanks!


I'm fairly sure that <embed> inside <object> is not valid markup. Even if it is, you should really look at Which browsers support the <embed> and <object> tags? since <embed> is only valid in HTML5.


I ended up writing in browser detection and ran different code for IE than the rest where value="flash/playerVar1.2.swf" instead of data="flash/playerVar1.2.swf". Easiest way to satisfy the beast of IE in my opinion. Oh, this works fine in its original iteration in IE9.

0

精彩评论

暂无评论...
验证码 换一张
取 消