This post is going to detail work I've done over the past two weeks.
Here's a list of all the Firefox bugs I've been active on:
- Bug 495040 - Implement playbackRate and related bits
- Bug 665598 - pref to completely disable html5 video/audio elements/objects
- Bug 665395 - there should be a pref to completely disable media including disable Audio API extension (window.Audio object)
- Bug 736400 - media.[ogg,webm,wave].enabled cannot toggle off media playback
- Bug 726904 - nsVideoFrame::GetVideoIntrinsicSize setting wrong size
Implement playbackRate and related bitsI started this bug after Dave challenged us to implement something new in Firefox, rather than only go about fixing bugs. To be honest when I took it, I knew I was getting in over my head. Despite this, I felt that I should challenge myself. I began this bug by merging in a 2 year old patch into the current code base. Once I fixed all of the conflicts, I had the playbackRate and defaultPlaybackRate attibutes present on HTML5 media elements. I spent several days examining and getting familiar with the process of displaying video frames, but to be honest, the scope of what needed to be done was far beyond my understanding. After discussions with Chris Pearce, I determined it to be the right choice to post what I had, and leave the implementation of changing playback speed to someone with more experience in that code. I wouldn't say it was for nothing, not at all. I now have a better understanding of the inner working of media elements, which is no doubt going to be useful in the future.
pref to completely disable html5 video/audio elements/objectsI was pointed to this bug by Chris Pearce, after discussing the above mentioned bug. This bug wants to add a browser wide pref to disable all media types. Currently, there are prefs to disable the individual media types ( ogg, webm, wave, raw ), but no way to disable all of them at once. This one was pretty easy to find my bearings in. I added the pref "media.enabled" and added logic to disable media if the pref were enabled.When testing, I noticed that if I had played a video already, and then disabled the media type, The video would still be able to play. I filed 736400 based on this.
Speaking with Chris Pearce today, we agreed that this pref isn't needed. So The bug will probably be closed. On the bright side, I did file a new bug :D
I've got an experimental patch in the works, but recent talks with Chris Pearce have shown me I need to change the direction I've been moving in. I will likely have a patch ready to go sometime this weekend.
media.[ogg,webm,wave].enabled cannot toggle off media playbackI filed this one when I noticed that under specific circumstances, the user prefs to disable media types would not actually disable media. Searching for instances in the code where the pref was checked, I noticed that it was done before instantiating a decoder type. The code there appeared to be solid, and worked if a decoder had not existed previously. I realized there might be a different code path being taken if a decoder previously was instantiated. This proved true, and the problem revealed itself in the clone method of each type of decoder.
The first time a media element is created, the MIME type of its source is used to check if that type is enabled. When it is cloned however, The check is not performed. I zeroed in on the method used to clone a decoder, and found that by the time the clone method was called, the MIME type of a media was no longer available, thus making it impossible to do the same check. I determined it was then necessary to add the check for each decoder in the clone method of each decoder type. This worked perfectly. you can check out my patch here: https://bugzilla.mozilla.org/attachment.cgi?id=607031&action=diff