Firefox OS WebFM API - LF or MF

128 views Asked by At

The WebFM API provides access to the device FM radio.

You can set the frequency with FMRadio.setFrequency().

Does the WebFM API for Firefox OS support LF and MF too, or does it only work with VHF?

 - LF   Low Frequency        30–300 kHz
 - MF   Medium Frequency     0,3–3  MHz
 - VHF  Very High Frequency  30–300 MHz

Unfortunately, the specification at MDN is not clear enough.

2

There are 2 answers

1
timdream On

It's depend on a Gecko pref, which is set by the hardware vendor, so, yes, it's device dependent.

http://dxr.mozilla.org/mozilla-central/source/dom/fmradio/FMRadioService.cpp#64-78

0
Pin Zhang On

All the attributes related to frequency (i.e. frequency, channelWidth, frequencyLowerBound, frequencyUpperBound) are in MHz, so technically MF should be supported, but LF won't.

The WebFM API is not a standard API yet (it's moz prefixed: navigator.mozFMRadio), it only works on Firefox OS and device dependent as @timdream said.

BTW, you could find the WebFM API discussion here:

https://groups.google.com/forum/?fromgroups#!topic/mozilla.dev.webapi/PraULCQntqA

https://bugzilla.mozilla.org/show_bug.cgi?id=779500