Class: WebRTC::RTCRtpTransceiver
- Inherits:
-
Object
- Object
- WebRTC::RTCRtpTransceiver
- Defined in:
- lib/webrtc/rtp_transceiver.rb
Constant Summary collapse
- DIRECTIONS =
%i[sendrecv sendonly recvonly inactive stopped].freeze
Instance Attribute Summary collapse
-
#current_direction ⇒ Object
readonly
Returns the value of attribute current_direction.
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#mid ⇒ Object
readonly
Returns the value of attribute mid.
-
#native_track_id ⇒ Object
readonly
Returns the value of attribute native_track_id.
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
-
#sender ⇒ Object
readonly
Returns the value of attribute sender.
-
#stopped ⇒ Object
readonly
Returns the value of attribute stopped.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RTCRtpTransceiver
constructor
A new instance of RTCRtpTransceiver.
- #set_codec_preferences(codecs) ⇒ Object
- #stop ⇒ Object
- #stopped? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ RTCRtpTransceiver
Returns a new instance of RTCRtpTransceiver.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/webrtc/rtp_transceiver.rb', line 10 def initialize( = {}) @mid = [:mid] @sender = [:sender] || RTCRtpSender.new @receiver = [:receiver] || RTCRtpReceiver.new @direction = [:direction] || :sendrecv @current_direction = nil @stopped = false @ptr = [:ptr] @native_track_id = [:native_track_id] end |
Instance Attribute Details
#current_direction ⇒ Object (readonly)
Returns the value of attribute current_direction.
7 8 9 |
# File 'lib/webrtc/rtp_transceiver.rb', line 7 def current_direction @current_direction end |
#direction ⇒ Object
Returns the value of attribute direction.
8 9 10 |
# File 'lib/webrtc/rtp_transceiver.rb', line 8 def direction @direction end |
#mid ⇒ Object (readonly)
Returns the value of attribute mid.
7 8 9 |
# File 'lib/webrtc/rtp_transceiver.rb', line 7 def mid @mid end |
#native_track_id ⇒ Object (readonly)
Returns the value of attribute native_track_id.
7 8 9 |
# File 'lib/webrtc/rtp_transceiver.rb', line 7 def native_track_id @native_track_id end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
7 8 9 |
# File 'lib/webrtc/rtp_transceiver.rb', line 7 def receiver @receiver end |
#sender ⇒ Object (readonly)
Returns the value of attribute sender.
7 8 9 |
# File 'lib/webrtc/rtp_transceiver.rb', line 7 def sender @sender end |
#stopped ⇒ Object (readonly)
Returns the value of attribute stopped.
7 8 9 |
# File 'lib/webrtc/rtp_transceiver.rb', line 7 def stopped @stopped end |
Instance Method Details
#set_codec_preferences(codecs) ⇒ Object
27 28 29 |
# File 'lib/webrtc/rtp_transceiver.rb', line 27 def set_codec_preferences(codecs) @codec_preferences = codecs end |
#stop ⇒ Object
21 22 23 24 25 |
# File 'lib/webrtc/rtp_transceiver.rb', line 21 def stop @stopped = true @direction = :stopped @sender&.replace_track(nil) end |
#stopped? ⇒ Boolean
31 32 33 |
# File 'lib/webrtc/rtp_transceiver.rb', line 31 def stopped? @stopped end |