Web design: disable auto fallback for OBJECT in Firefox?

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Post Reply
Tomcat1976
Posts: 25
Joined: November 23rd, 2012, 12:11 pm

Web design: disable auto fallback for OBJECT in Firefox?

Post by Tomcat1976 »

I have stumbled upon a serious problem with media playback in Firefox with some of my websites, which I didn't notice right away because I'm using an older version of Firefox (25, with modded UA string for YouTube) on my computer.

To embed an mp3 file, I use a custom flash player via the object tag and a nested quicktime player via the object and embed tags:

OBJECT (Flash)
--- OBJECT (Quicktime ActiveX and Plugin combined)
------ EMBED (Quicktime)

This used to work fine, but a new problem arose in recent versions of Firefox when the Quicktime plugin is not available/installed. In that case, recent versions of Firefox will automatically insert a VIDEO tag, nested inside the Quicktime OBJECT tag, which I never coded or requested Firefox to do. In addition to this, Firefox will autoplay that self-inserted VIDEO tag, even when the parent Flash element is supported! You can imagine the problem when someone visiting the site is confronted with music that is automatically playing, but cannot stop it because only the controls of the parent Flash object are shown! Embed five MP3 files like this and you'll get five MP3 files playing simultaneously that can't be stopped.

I thought I could prevent this from happening by inserting an AUDIO tag in between the Quicktime OBJECT and the Quicktime EMBED, but Firefox still inserted the VIDEO tag, and deleted my AUDIO tag.

For testing purposes, I've even tried something like:
video, audio { display: none !important }
but that only works for VIDEO and AUDIO tags I coded myself, not the ones automatically inserted by Firefox.

At this point, I have somewhat circumvented the problem by turning the combined Quicktime ActiveX/plugin OBJECT into an ActiveX-only OBJECT. Firefox doesn't seem to auto-insert anything into an ActiveX OBJECT, and it will leave an EMBED tag alone too.

What I'd like to know:

1) Why does Firefox auto-insert fallback code?
2) Assuming it's OK to do so, why is Firefox inserting a VIDEO tag for an MP3 file?
3) What can I do to stop this from happening while still having a Quicktime plugin OBJECT in the mix?

Thanks for any input on this.
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by trolly »

How do you see that Firefox is inserting a "video" tag?
Do you have an example site or can you post the exact code you use?
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
Tomcat1976
Posts: 25
Joined: November 23rd, 2012, 12:11 pm

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by Tomcat1976 »

Thanks for the reply.

trolly wrote:How do you see that Firefox is inserting a "video" tag?


Tools > Web Developer > Inspector

trolly wrote:Do you have an example site or can you post the exact code you use?


Code: Select all

<object class="qt" width="89px" height="17px" type="video/quicktime" data="file.mp3">
<param name="src" value="file.mp3"/>
<param name="kioskmode" value="true"/>
<param name="autoplay" value="false"/>
<param name="volume" value="50"/>
<param name="pluginspage" value="http://www.apple.com/quicktime/download/"/>
</object>


When you don't have the Quicktime plugin installed, Firefox will insert a VIDEO tag which you can see, but the controls bar will be cut off at the dimensions provided for the OBJECT tag (ie, you won't see the complete controls bar). It will also autoplay.

As for the Flash MP3 player, I use the version found here.

With everything together:

Code: Select all

<object type="application/x-shockwave-flash" data="player_mp3_maxi.swf" width="89px" height="17px">
<param name="movie" value="player_mp3_maxi.swf"/>
<param name="wmode" value="transparent"/>
<param name="pluginspage" value="http://www.adobe.com/go/getflashplayer"/>
<param name="flashvars" value="mp3=file.mp3&amp;width=89&amp;height=17&amp;volume=50&amp;showstop=0&amp;showinfo=0&amp;showvolume=0&amp;showslider=1&amp;bgcolor=FFFFFF&amp;bgcolor1=DDDDDD&amp;bgcolor2=F0F3FB&amp;buttoncolor=FFFFFF&amp;buttonovercolor=666666&amp;slidercolor1=FFFFFF&amp;slidercolor2=CCCCCC&amp;sliderovercolor=FFFFFF&amp;loadingcolor=A6A6A6&amp;buttonwidth=17&amp;sliderwidth=13&amp;sliderheight=11&amp;autoplay=0">
<object class="qt" width="89px" height="17px" type="video/quicktime" data="file.mp3">
<param name="src" value="file.mp3"/>
<param name="kioskmode" value="true"/>
<param name="autoplay" value="false"/>
<param name="volume" value="50"/>
<param name="pluginspage" value="http://www.apple.com/quicktime/download/"/>
<embed class="qt" width="89px" height="17px" type="video/quicktime" src="file.mp3"
kioskmode="true" autostart="0" volume="50" pluginspage="http://www.apple.com/quicktime/download/"/>
</object>
</object>


If you have support for Flash but not Quicktime, this code will cause Firefox to insert a VIDEO tag inside the Quicktime object, which will autoplay. In addition, you can't stop the audio because you see the controls of the Flash MP3 player.
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by trolly »

That's too high for me.
Just curious: Why can't you use "audio/mpeg3" and let the browser chose a matching player?

And what happens when you have neither quicktime nor flash available (like me)?
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
Tomcat1976
Posts: 25
Joined: November 23rd, 2012, 12:11 pm

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by Tomcat1976 »

I'm still working on perfecting that code.

My main problem (I guess) is that I want to support as many browsers and platforms as possible while still maintaining some level of control over how the media controls are displayed. The AUDIO tag is only supported by some of the latest browsers, and it can't be controlled as well as I'd like to. I normally provide a textual link as a last fallback, but the EMBED tag kinda gets in the way of that in this case.

Even so, if I add an AUDIO tag to the mix of nested objects I'd still want the Quicktime plugin OBJECT tag in there for people who use (slightly) older browsers that don't support the AUDIO tag, but Firefox kills that option as I explained in my posts above. Personally, I consider this a bug which is why I originally posted it in the Bugs subforum.

Using the audio/mpeg mime type (or a variant of it) for the OBJECT tag has NEVER worked for me, no matter which browser. I don't know why. Tons of sites give examples of this but it just never worked.
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by jscher2000 »

The complexity may explain why many sites use JavaScript to test HTML5 video support and plugin availability instead of relying on nested fallback tags. You might be able to find a library that works for your needs.
Tomcat1976
Posts: 25
Joined: November 23rd, 2012, 12:11 pm

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by Tomcat1976 »

Thanks for the advice, jscher2000.

It took me some time to gather the ActiveX and plugin detection codes for Flash and Quicktime (I've never done this before), and it's working great. I've even got textual links to the MP3 files as a fallback. The only nesting is done for Quicktime (OBJECT + EMBED) which should not cause any problems. I could even get rid of the CSS code for IE6 which removed nested OBJECTS because of an IE6 nesting bug. :mrgreen:

I'd still like to hear some personal thoughts on the behavior of newer versions of Firefox concerning its auto-fallback VIDEO tag when the Quicktime plugin is requested through an OBJECT tag but is not installed.

This is what I'd expect Firefox to do (in order of preference) when Quicktime is not installed or disabled:

1) Do nothing
2) Fallback, but use info from original OBJECT to construct the new element (VIDEO tag for video, AUDIO tag for audio, autoplay only when OBJECT is set to autoplay, and scale the fallback player to fit the dimensions of the OBJECT; currently, Firefox uses the same dimensions but doesn't scale the new player to fit inside the box)

However, the fact that a nested OBJECT is executed together with a parent OBJECT is IMHO simply a bug. Internet Explorer used to have it, but MS fixed this in Internet Explorer 7.

EDIT: I have filed a bug on the simultaneous execution of nested elements: https://bugzilla.mozilla.org/show_bug.cgi?id=1210645
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by Frenzie »

The expected behavior is described in the spec: http://www.w3.org/TR/html5/embedded-con ... ct-element (it doesn't make the easiest reading material)

I see you already submitted a bug report, but for future reference you should

- test with the latest version
- test in safe mode or better yet with a clean profile
- preferably also provide the minimal testcase available in such a way that it doesn't require any effort to check it out
Intelligent alien life does exist, otherwise they would have contacted us.
Tomcat1976
Posts: 25
Joined: November 23rd, 2012, 12:11 pm

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by Tomcat1976 »

Thanks, Frenzie.

My UA string seems to be the source of some confusion. :-)

I observed the problem on two other computers, both running the latest version of Firefox. Everything was fine on my PC because I have Quicktime installed.

I didn't remember my UA string would be posted automatically when filing a bug report; I would've mentioned something about it if I did. That's been rectified now.

Just wondering... Aren't plugins disabled when you run FF in safe mode? That would obviously break the test.
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by Frenzie »

Safe mode shouldn't disable plugins unless they changed the behavior over the past year or so. It'd be pretty easy to find out. ;) The point is just to make sure it isn't accidentally one of your own settings affecting behavior.
Intelligent alien life does exist, otherwise they would have contacted us.
Tomcat1976
Posts: 25
Joined: November 23rd, 2012, 12:11 pm

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by Tomcat1976 »

It's easy to find out... after you manage to get the five-year-old kid away from that computer :-)

Safe mode (addons disabled) -- problem remains

New profile (actually created new Windows account) -- problem remains

So it's always reproducible.
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Web design: disable auto fallback for OBJECT in Firefox?

Post by Frenzie »

Okay, great! (Well, not really. :) )
Intelligent alien life does exist, otherwise they would have contacted us.
Post Reply