admin管理员组文章数量:1026423
My website will have a logo on the header that will play as a flash movie (animated flash movie .swf). I am looking for code / algorithm that will display an image with the same dimensions as the flash movie if Flash is not installed or enabled for the current user accessing the site. How do I do this?
My website will have a logo on the header that will play as a flash movie (animated flash movie .swf). I am looking for code / algorithm that will display an image with the same dimensions as the flash movie if Flash is not installed or enabled for the current user accessing the site. How do I do this?
Share Improve this question asked Jun 15, 2011 at 16:15 KevinKevin 3092 gold badges7 silver badges17 bronze badges2 Answers
Reset to default 2You can use general object fallback detection. The way this works is that anything the browser doesn't know how to render in the object tag, it will fall through to the content inside.
A clipped version of your code would look similar to this:
<object id="my-flash" src="movie.swf" width="800" height="600">
<img src="fallback_image.jpg" width="800" height="600" />
</object>
Of course, you would need to wrap your actual Flash embed HTML around the image, but that's the idea.
I suggest using SWFObject for this. It works great, it will work cross-browser, and you can specify which version of Flash you are looking for (this could be key since there are some major differences). Check this tutorial on providing alternative content, which is exactly what you want to do.
My website will have a logo on the header that will play as a flash movie (animated flash movie .swf). I am looking for code / algorithm that will display an image with the same dimensions as the flash movie if Flash is not installed or enabled for the current user accessing the site. How do I do this?
My website will have a logo on the header that will play as a flash movie (animated flash movie .swf). I am looking for code / algorithm that will display an image with the same dimensions as the flash movie if Flash is not installed or enabled for the current user accessing the site. How do I do this?
Share Improve this question asked Jun 15, 2011 at 16:15 KevinKevin 3092 gold badges7 silver badges17 bronze badges2 Answers
Reset to default 2You can use general object fallback detection. The way this works is that anything the browser doesn't know how to render in the object tag, it will fall through to the content inside.
A clipped version of your code would look similar to this:
<object id="my-flash" src="movie.swf" width="800" height="600">
<img src="fallback_image.jpg" width="800" height="600" />
</object>
Of course, you would need to wrap your actual Flash embed HTML around the image, but that's the idea.
I suggest using SWFObject for this. It works great, it will work cross-browser, and you can specify which version of Flash you are looking for (this could be key since there are some major differences). Check this tutorial on providing alternative content, which is exactly what you want to do.
版权声明:本文标题:javascript - Display Image in place of Flash .swf file when Flash is not installed or enabled - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745646286a2161046.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论