|
1 | 1 | use crate::notify::Notifier; |
2 | 2 | use reqwest::Client; |
3 | 3 | use async_trait::async_trait; |
4 | | -use crate::define::{PublisherInfo, StreamHubEventMessage, StreamHubEventSender, StreamHubEvent}; |
| 4 | +use crate::define::{StreamHubEventMessage, StreamHubEventSender, StreamHubEvent}; |
| 5 | +use config::HttpNotifierConfig; |
5 | 6 |
|
6 | 7 | macro_rules! serialize_event { |
7 | 8 | ($message:expr) => {{ |
@@ -29,21 +30,16 @@ pub struct HttpNotifier { |
29 | 30 |
|
30 | 31 | impl HttpNotifier { |
31 | 32 | pub fn new( |
32 | | - on_publish_url: Option<String>, |
33 | | - on_unpublish_url: Option<String>, |
34 | | - on_play_url: Option<String>, |
35 | | - on_stop_url: Option<String>, |
36 | | - on_hls_url: Option<String>, |
| 33 | + config: HttpNotifierConfig, |
37 | 34 | event_producer: StreamHubEventSender, |
38 | | - |
39 | 35 | ) -> Self { |
40 | 36 | Self { |
41 | 37 | request_client: reqwest::Client::new(), |
42 | | - on_publish_url, |
43 | | - on_unpublish_url, |
44 | | - on_play_url, |
45 | | - on_stop_url, |
46 | | - on_hls_url, |
| 38 | + on_publish_url: config.on_publish, |
| 39 | + on_unpublish_url: config.on_unpublish, |
| 40 | + on_play_url: config.on_play, |
| 41 | + on_stop_url: config.on_stop, |
| 42 | + on_hls_url: config.on_hls, |
47 | 43 | event_producer, |
48 | 44 | } |
49 | 45 | } |
|
0 commit comments