(ctx context.Context, participant types.Participant)
| 165 | } |
| 166 | |
| 167 | func (s whipService) notifySession(ctx context.Context, participant types.Participant) error { |
| 168 | ticker := time.NewTicker(whipSessionNotifyInterval) |
| 169 | defer ticker.Stop() |
| 170 | |
| 171 | err := s.sendConnectionNotify(ctx, participant) |
| 172 | if err != nil { |
| 173 | if errors.Is(err, context.Canceled) { |
| 174 | return nil |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | for { |
| 179 | select { |
| 180 | case <-ticker.C: |
| 181 | err := s.sendConnectionNotify(ctx, participant) |
| 182 | if err != nil { |
| 183 | if errors.Is(err, context.Canceled) { |
| 184 | return nil |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | case <-ctx.Done(): |
| 189 | return nil |
| 190 | } |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | func (s whipService) sendConnectionNotify(ctx context.Context, participant types.Participant) error { |
| 195 | video, audio := getMediaStateForParticipant(participant) |
no test coverage detected