snowflake/proxy/shims.coffee
Arlo Breault d567e2312f Feature detect with Modernizr
* A start on #34
2016-04-05 10:30:45 -07:00

20 lines
587 B
CoffeeScript

###
WebrTC shims for multiple browsers.
###
if typeof module isnt 'undefined' and module.exports
window = {}
else
window = this
prop = Modernizr.prefixed 'RTCPeerConnection', window, false
if not prop
console.log 'webrtc feature not detected. shutting down'
return;
PeerConnection = window[prop]
### FIXME: push these upstream ###
IceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate
SessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription
location = if window.location then window.location.search.substr(1) else ""