Flash in fullscreen mode works in <embed>, but not work within <a> tag

烂漫一生 提交于 2019-12-20 04:34:38

问题


I have this code

<div id="c01" class="hider">
< a href="flash.swf" class="bump">flash</a>
</div>

and it displays flash content within a bumpbox (lightbox alternative) window. It works perfectly, but there is a fullscreen button in the flash animation and it do not works. The other button (to stop the animation) works ok.

I find out, that with this

<embed src="flash.swf" width="100%" height="100%" allowFullScreen="true"> </embed>

fullscreen button works fine, but the flash animation runs since the page is loaded and I have about 50 of those animations, so I need to run only one of them at a time. I need to make it clickable (within ) and with working fullscreen button at the same time. Is it possible? Thank you!


回答1:


The issue you're having is actually coming from Mootools. Mootools has an Flash embed class called Swiff, which is what BumpBox uses when you pass an SWF in your link.

Unfortunately, I think you're either going to have to hack into BumpBox or Mootools to get full screen permission working.

If you look into the expanded version of BumpBox 2.0.1, you will see where Swiff is instantiated, around line 372:

var obj = new Swiff(content, {
    id: 'video',
    width: maxw-40,
    height: maxh-40,
    container: div
})

You may be able to pass in the additional parameter you require here, which would look something like this:

var obj = new Swiff(content, {
    id: 'video',
    width: maxw-40,
    height: maxh-40,
    container: div,
    params: {
        allowFullScreen: true
    },
})

If that fails you will have to make the adjustment to the Swiff class itself. Open up Mootools and search for Swiff=new Class. That will lead you to the code that creates the Flash object. Finding the params list should be easy from there, it looks like:

params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true}

and you would just need to add the fullscreen permission:

params:{allowFullScreen:true,quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true}



回答2:


Some browsers can't open a Flash file without Flash container (embed). The embed code in your post is fine, put it on a PHP page and replace:

src="flash.swf"

with

<?php echo $_GET['flashurl']; ?>

Then you can put as link: nameofphpscript.php?flashurl=flash.swf



来源:https://stackoverflow.com/questions/6927350/flash-in-fullscreen-mode-works-in-embed-but-not-work-within-a-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!