问题
Check out this flash file loaded here: http://www.gameprehacks.com/ad.html
or view code below
<object type="application/x-shockwave-flash" width="336" height="280"
data="http://buxle.com/buxle-starsbanner.swf" >
<param name="play" value="true" />
<param name="movie" value="http://buxle.com/buxle-starsbanner.swf" />
<param name="wmode" value="direct" />
<param name="pluginspage" value="http://www.adobe.com/go/getflashplayer" />
<embed type="application/x-shockwave-flash" src="http://buxle.com/buxle-starsbanner.swf" width="336" height="280" wmode="direct" play="true" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
It works in Internet Explorer as it should, but in Chrome, the file has a play button. I need this to autoplay in Chrome. How can I achieve this?
Any help is greatly appreciated.
Thank you
回答1:
Chrome does not auto-play Flash-based adverts. It has been like this for a long time.
See this article from 2015 announcing the plan for Google's browser.
Anyway to avoid the "Play" icon :
- Have both the SWF file and also the HTML file together in same location.
- or... Set a high width and height to avoid appearing like a banner/advert.
Also try to use (secure) https://
links whenever possible if your site is also on HTTPS server.
Try this version of your code using increased width/height and also HTTPS-based URL. This worked for me (but you can try with HTTP links) :
<object type="application/x-shockwave-flash" width="480" height="400"
data="https://buxle.com/buxle-starsbanner.swf" >
<param name="play" value="true" />
<param name="movie" value="https://buxle.com/buxle-starsbanner.swf" />
<param name="wmode" value="direct" />
<param name="pluginspage" value="https://www.adobe.com/go/getflashplayer" />
<embed type="application/x-shockwave-flash" src="https://buxle.com/buxle-starsbanner.swf" width="336" height="280" wmode="direct" play="true" pluginspage="https://www.adobe.com/go/getflashplayer" />
</object>
来源:https://stackoverflow.com/questions/44751192/how-do-i-make-this-flash-file-autplay