(event any)
| 327 | } |
| 328 | |
| 329 | func (cfg *Engine) OnEvent(event any) { |
| 330 | switch v := event.(type) { |
| 331 | case []byte: |
| 332 | if cfg.reportStream != nil { |
| 333 | cfg.reportStream.Write(v) |
| 334 | cfg.reportStream.Write([]byte{0}) |
| 335 | } |
| 336 | case context.Context: |
| 337 | util.RTPReorderBufferLen = uint16(cfg.RTPReorderBufferLen) |
| 338 | if cfg.Secret != "" && cfg.Server != "" { |
| 339 | if strings.HasPrefix(cfg.Console.Server, "wss") { |
| 340 | go cfg.WsRemote() |
| 341 | } else { |
| 342 | go cfg.WtRemote(v) |
| 343 | } |
| 344 | } |
| 345 | } |
| 346 | } |