diff --git a/trunk/src/app/srs_app_rtc_conn.cpp b/trunk/src/app/srs_app_rtc_conn.cpp index ac11f6e09..174272e85 100644 --- a/trunk/src/app/srs_app_rtc_conn.cpp +++ b/trunk/src/app/srs_app_rtc_conn.cpp @@ -3126,6 +3126,12 @@ srs_error_t SrsRtcConnection::create_publisher(SrsRequest* req, SrsRtcStreamDesc } } + if (_srs_rtc_hijacker) { + if ((err = _srs_rtc_hijacker->on_before_publish(this, publisher, req)) != srs_success) { + return srs_error_wrap(err, "on before publish"); + } + } + // If DLTS done, start the publisher. Because maybe create some publishers after DTLS done. if(ESTABLISHED == state()) { if(srs_success != (err = publisher->start())) { diff --git a/trunk/src/app/srs_app_rtc_conn.hpp b/trunk/src/app/srs_app_rtc_conn.hpp index b1499810d..a358abd96 100644 --- a/trunk/src/app/srs_app_rtc_conn.hpp +++ b/trunk/src/app/srs_app_rtc_conn.hpp @@ -497,6 +497,8 @@ public: public: // Initialize the hijacker. virtual srs_error_t initialize() = 0; + // When create publisher. + virtual srs_error_t on_before_publish(SrsRtcConnection* session, SrsRtcPublishStream* publisher, SrsRequest* req) = 0; // When start publisher by RTC. virtual srs_error_t on_start_publish(SrsRtcConnection* session, SrsRtcPublishStream* publisher, SrsRequest* req) = 0; // When stop publish by RTC.