peers/peerjs — pull request #115 by sblaurock (2013-11-30 04:59:15+00:00)
Title: Added accessor function to return value of 'bufferedAmount' attribute of...

... data channel to avoid having to reach directly into the object itself.

The 'bufferedAmount' readonly attribute is actually quite useful for messaging progress to users during long file transfers. My issue is that this attribute is not available in the 'DataConnection' object, but tucked away within '_dc' (the reference to the actual RTCDataChannel object).

I felt a bit "iffy" about reaching into a seemingly private object (_dc), so I created a simple accessor function in DataConnection to reach in and return this value.