func (p *Publisher) OnEvent(event any) { p.IO.OnEvent(event) switch event.(type) { case SEclose, SEKick: p.AudioTrack = nil p.VideoTrack = nil } }
(codecID codec.AudioCodecID, stuff ...any)
| 58 | // } |
| 59 | |
| 60 | func (p *Publisher) CreateAudioTrack(codecID codec.AudioCodecID, stuff ...any) common.AudioTrack { |
| 61 | switch codecID { |
| 62 | case codec.CodecID_AAC: |
| 63 | p.AudioTrack = track.NewAAC(p, stuff...) |
| 64 | case codec.CodecID_PCMA: |
| 65 | p.AudioTrack = track.NewG711(p, true, stuff...) |
| 66 | case codec.CodecID_PCMU: |
| 67 | p.AudioTrack = track.NewG711(p, false, stuff...) |
| 68 | case codec.CodecID_OPUS: |
| 69 | p.AudioTrack = track.NewOpus(p, stuff...) |
| 70 | } |
| 71 | return p.AudioTrack |
| 72 | } |
| 73 | |
| 74 | func (p *Publisher) CreateVideoTrack(codecID codec.VideoCodecID, stuff ...any) common.VideoTrack { |
| 75 | switch codecID { |
no test coverage detected