W3C home > Mailing lists > Public > public-webrtc@w3.org > January 2012

Re: CHANGE: Remove numeric constants from WebRTC API

From: Dominique Hazael-Massieux <dom@w3.org>
Date: Fri, 13 Jan 2012 16:09:47 +0100
Message-ID: <1326467387.31169.48.camel@altostratustier>
To: Harald Alvestrand <harald@alvestrand.no>
Cc: "public-webrtc@w3.org" <public-webrtc@w3.org>
Le mardi 10 janvier 2012 à 10:10 +0100, Harald Alvestrand a écrit :
> we instead use strings (possibly in 
> the special form of WebIDL enumerations, which are mapped to JavaScript 
> strings by the language binding.
>
> I'm therefore calling for the WG's consensus to do this change.
> It affects at least the following:
> 
> - MediaStreamTrack: readyState (LIVE, MUTE and ENDED)
> - PeerConnection: readyState, iceState and sdpState

While I generally support moving away from numerical constants toward
string enumerations, I think consistency with existing APIs is an
important goal as well; XMLHttpRequest uses the same readyState
property, but uses numerical constants:
http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html

Likewise, readyState on media elements use numerical values:
http://dev.w3.org/html5/spec/video.html#dom-media-readystate

So, I am uncomfortable with using string values for readyState
properties; internal consistency would then also suggest against them
for iceState and sdpState.

That being said, it's probably worth coordinating with the HTML and
WebApps Working Group on the topic, to determine if they're thinking of
providing a string-based equivalent to these properties.

Dom
Received on Friday, 13 January 2012 15:14:20 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:26 UTC