As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 480376 - Video should indicate when there's no audio track available
: Video should indicate when there's no audio track available
: dev-doc-complete
Product: Core
Classification: Components
Component: Audio/Video (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla15
Assigned To: Paul Adenot (:padenot)
: Maire Reavy [:mreavy] Please needinfo me
Depends on: 762191
Blocks: 749520
  Show dependency treegraph
Reported: 2009-02-26 12:17 PST by Justin Dolske [:Dolske]
Modified: 2013-05-22 07:14 PDT (History)
11 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Screenshot of BBC media player (184.24 KB, image/png)
2009-02-26 12:17 PST, Justin Dolske [:Dolske]
no flags Details
v0 - implements mozHasAudio and adds a test. (13.80 KB, patch)
2012-04-26 18:06 PDT, Paul Adenot (:padenot)
cpearce: review+
Details | Diff | Splinter Review

Description User image Justin Dolske [:Dolske] 2009-02-26 12:17:14 PST
Created attachment 364363 [details]
Screenshot of BBC media player

It's not too uncommon for videos to have no audio track. It would be really nice if the video controls could indicate this, so that users know why there's no sound ("is something broken? is my volume too low? wtf?").

Unfortunately this info isn't available through the media element API, so this would need to be added to the HTML5 spec. The simplest way to expose this would be as |readonly boolean hasAudio|. Is the media backend capable of determining this this?
Comment 1 User image cajbir (:cajbir) 2009-02-26 13:58:50 PST
Yes we can determine if it has no audio track at the beginning. If we eventually support chained oggs then it may be possible for a track to appear as we download so some event to indicate the change of state may be needed.
Comment 2 User image Paul Adenot (:padenot) 2012-04-26 18:06:57 PDT
Created attachment 618878 [details] [diff] [review]
v0 - implements mozHasAudio and adds a test.

Here is a possible patch and its test.

If we play chained medias at some point, I suppose we will have to read metadata again (to prevent failure in case of number of channel or playback rate change), and therefore post new a |nsAudioMetadataEventRunner| to the main thread. That should update the |mozHasAudio| property.
Comment 3 User image Chris Pearce (:cpearce) 2012-04-26 20:32:37 PDT
Comment on attachment 618878 [details] [diff] [review]
v0 - implements mozHasAudio and adds a test.

Review of attachment 618878 [details] [diff] [review]:

Nice. This seems a reasonable and way to expose this information until we implement AudioTrackList.
Comment 4 User image Chris Pearce (:cpearce) 2012-04-26 20:34:25 PDT
Jared: see Paul's attached patch, which will be enable them to detect when a video has no audio so they can hide the volume controls etc.
Comment 5 User image Ryan VanderMeulen [:RyanVM] 2012-04-28 08:20:39 PDT

Also, to make life easier for those checking in patches on your behalf, please follow the directions below for future patches you submit. Thanks!
Comment 6 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2012-04-28 18:42:43 PDT
Can't the HTML5 track API be used to check if there's an audio track? Assuming we implemented that of course...
Comment 7 User image Chris Pearce (:cpearce) 2012-04-28 21:07:52 PDT
Yes, as I mentioned in comment 3. It seems we can get a result sooner by taking this now than waiting for AudioTrackList to be implemented.
Comment 8 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2012-04-28 22:46:39 PDT
It wouldn't be that hard to implement enough of AudioTrackList to be useful here.
Comment 9 User image Ryan VanderMeulen [:RyanVM] 2012-04-29 15:44:04 PDT
Comment 10 User image Alfred Kayser 2012-06-14 11:42:45 PDT
Even better would be to set disabled (instead of noAudio), so that the button is no longer clickable (as muting no sound doesn't work ;-)

Note You need to log in before you can comment on or make changes to this bug.