Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
Fix rtc_stream.update event on stream stop (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
feymartynov committed Jun 15, 2020
1 parent 93f49d8 commit 7e68204
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/app/janus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ async fn handle_event_impl<C: Context>(
Ok(Box::new(stream::empty()))
}
}
IncomingEvent::Detached(ref inev) => {
IncomingEvent::HangUp(ref inev) => {
let rtc_stream_id = Uuid::from_str(inev.opaque_id())
.map_err(|err| format!("Failed to parse opaque id as uuid: {}", err))
.status(ResponseStatus::BAD_REQUEST)?;
Expand Down Expand Up @@ -1121,7 +1121,7 @@ async fn handle_event_impl<C: Context>(

Ok(Box::new(stream::empty()))
}
IncomingEvent::HangUp(_)
IncomingEvent::Detached(_)
| IncomingEvent::Media(_)
| IncomingEvent::Timeout(_)
| IncomingEvent::SlowLink(_) => {
Expand Down
12 changes: 6 additions & 6 deletions src/backend/janus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ pub(crate) struct HangUpEvent {
reason: String,
}

impl HangUpEvent {
pub(crate) fn opaque_id(&self) -> &str {
&self.opaque_id
}
}

////////////////////////////////////////////////////////////////////////////////

// Audio or video bytes being received by plugin handle
Expand Down Expand Up @@ -389,12 +395,6 @@ pub(crate) struct DetachedEvent {
opaque_id: String,
}

impl DetachedEvent {
pub(crate) fn opaque_id(&self) -> &str {
&self.opaque_id
}
}

////////////////////////////////////////////////////////////////////////////////

// Janus Gateway actual status
Expand Down

0 comments on commit 7e68204

Please sign in to comment.