Question

I've got a .swf file embedded on my page that looks something like this:

<embed src="/db/xxxx/stream.swf" />

It works fine, but I'm wondering how I can display some text like:

Your browser does not support the embed tag.

if, well, the browser doesn't support the embed tag.

With <video> tags, I just do this:

<video src="/db/xxxx/stream.m4v">
    Your browser does not support the video tag.
</video>

That works fine, but the <embed /> tag is self-closing, so it doesn't work the same way.

How can I display "not supported" text in the <embed /> tag if the browser does not support the tag?

Was it helpful?

Solution

The <embed> tag is supported in all the major browsers. So the embed tag itself is supported, it's the content that the embed tag attempts to display that isn't supported.

You mention a swf file in your question. A lot of times a Javascript solution like SWFObject is used to figure out if Flash is available, and replace an element on the page with the Flash movie if flash is available. And if Flash isn't available, your alternate, or "Not supported" content would display instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top