Class: WebRTC::RTCConfiguration
- Inherits:
-
Object
- Object
- WebRTC::RTCConfiguration
- Defined in:
- lib/webrtc/configuration.rb
Constant Summary collapse
- ICE_TRANSPORT_POLICIES =
%i[all relay].freeze
- BUNDLE_POLICIES =
%i[balanced max_compat max_bundle].freeze
- RTCP_MUX_POLICIES =
%i[require].freeze
Instance Attribute Summary collapse
-
#bundle_policy ⇒ Object
Returns the value of attribute bundle_policy.
-
#certificates ⇒ Object
Returns the value of attribute certificates.
-
#ice_candidate_pool_size ⇒ Object
Returns the value of attribute ice_candidate_pool_size.
-
#ice_servers ⇒ Object
Returns the value of attribute ice_servers.
-
#ice_transport_policy ⇒ Object
Returns the value of attribute ice_transport_policy.
-
#rtcp_mux_policy ⇒ Object
Returns the value of attribute rtcp_mux_policy.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RTCConfiguration
constructor
A new instance of RTCConfiguration.
- #to_h ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ RTCConfiguration
Returns a new instance of RTCConfiguration.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/webrtc/configuration.rb', line 12 def initialize( = {}) @ice_servers = normalize_ice_servers([:ice_servers] || [:iceServers] || []) @ice_transport_policy = [:ice_transport_policy] || [:iceTransportPolicy] || :all @bundle_policy = [:bundle_policy] || [:bundlePolicy] || :balanced @rtcp_mux_policy = [:rtcp_mux_policy] || [:rtcpMuxPolicy] || :require @certificates = [:certificates] || [] @ice_candidate_pool_size = [:ice_candidate_pool_size] || [:iceCandidatePoolSize] || 0 validate! end |
Instance Attribute Details
#bundle_policy ⇒ Object
Returns the value of attribute bundle_policy.
9 10 11 |
# File 'lib/webrtc/configuration.rb', line 9 def bundle_policy @bundle_policy end |
#certificates ⇒ Object
Returns the value of attribute certificates.
9 10 11 |
# File 'lib/webrtc/configuration.rb', line 9 def certificates @certificates end |
#ice_candidate_pool_size ⇒ Object
Returns the value of attribute ice_candidate_pool_size.
9 10 11 |
# File 'lib/webrtc/configuration.rb', line 9 def ice_candidate_pool_size @ice_candidate_pool_size end |
#ice_servers ⇒ Object
Returns the value of attribute ice_servers.
9 10 11 |
# File 'lib/webrtc/configuration.rb', line 9 def ice_servers @ice_servers end |
#ice_transport_policy ⇒ Object
Returns the value of attribute ice_transport_policy.
9 10 11 |
# File 'lib/webrtc/configuration.rb', line 9 def ice_transport_policy @ice_transport_policy end |
#rtcp_mux_policy ⇒ Object
Returns the value of attribute rtcp_mux_policy.
9 10 11 |
# File 'lib/webrtc/configuration.rb', line 9 def rtcp_mux_policy @rtcp_mux_policy end |
Instance Method Details
#to_h ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/webrtc/configuration.rb', line 23 def to_h { iceServers: @ice_servers.map(&:to_h), iceTransportPolicy: @ice_transport_policy, bundlePolicy: @bundle_policy, rtcpMuxPolicy: @rtcp_mux_policy, iceCandidatePoolSize: @ice_candidate_pool_size } end |