Object and maplike - World Wide Web Consortium (W3C)
fixing getStats
object and maplike
1
Issue 1: Returning a base dictionary returns just that
webidl:
interface RTCStatsReport = { getter RTCStats (DOMString id); };
js:
pc.getStats().then(report => { Object.keys(report).forEach(key => { var stat = report[key]; if (stat.type != "candidatepair") continue;
console.log(stat.timestamp); // 1441898883269.8672 console.log(stat.priority); // undefined console.log(report[stat.localIceCandidateId].ipAddress); // error
} }
2
Issue 1: Solutions
webidl:
- interface RTCStatsReport = { getter RTCStats (DOMString id); }; + interface RTCStatsReport = { getter object (DOMString id); };
or
- interface RTCStatsReport = { getter RTCStats (DOMString id); }; + interface RTCStatsReport = { getter AllRTCStats (DOMString id); };
where AllRTCStats would use a new WebIDL feature requested for this *
typedef AllRTCStats = (RTCStats || RTCIceCandidateStats); // etc.
*)
3
Issue 2: getter is legacy tech. Use ES6 maplike:
webidl:
interface RTCStatsReport = { readonly maplike; };
js:
pc.getStats().then(report => { report.forEach(stat => { if (stat.type != "candidatepair") continue;
console.log(stat.timestamp); // 1441898883269.8672 console.log(stat.priority); // 7996986662803866000 console.log(report.get(stat.localIceCandidateId).ipAddress); //192.168.1.1
} }
4
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- object and maplike world wide web consortium w3c
- jsquery sternberg astronomical institute
- core javascript reference card jmu
- simplifying javascript the pragmatic programmer
- putting together html css with javascript columbia university
- c s e 1 5 4 w e b p r o g r a mmi n g n o d e j s e x p r e s s
- javascript objects and functions github pages
- security developer s guide oracle
- zoiper web api
- beginner s essential javascript cheat sheet websitesetup
Related searches
- world wide crime statistics
- identify object and subject complements
- python delete object and elements
- direct object and object complement
- indirect object and direct object
- direct object and direct object pronouns
- object and subject pronouns worksheet
- direct object and subject complement
- difference between object and class
- difference between object and class in java
- where object and or powershell
- where object and operator