mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-16 21:15:57 +08:00
确保hls播放器持续播放 (#2896)
在hls注销后,hls cookie会继续存活60秒,在此期间,如果hls流重新注册,将导致无法继续播放; 通过此修改,在hls注销后每3秒查询一次MediaSource,可以在性能和功能间保持平衡。
This commit is contained in:
@@ -85,14 +85,14 @@ public:
|
||||
/**
|
||||
* 设置附加数据
|
||||
*/
|
||||
void setAttach(std::shared_ptr<void> attach);
|
||||
void setAttach(toolkit::Any attach);
|
||||
|
||||
/*
|
||||
* 获取附加数据
|
||||
*/
|
||||
template <class T>
|
||||
T& getAttach() {
|
||||
return *static_cast<T *>(_attach.get());
|
||||
return _attach.get<T>();
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -104,7 +104,7 @@ private:
|
||||
std::string _cookie_uuid;
|
||||
uint64_t _max_elapsed;
|
||||
toolkit::Ticker _ticker;
|
||||
std::shared_ptr<void> _attach;
|
||||
toolkit::Any _attach;
|
||||
std::weak_ptr<HttpCookieManager> _manager;
|
||||
};
|
||||
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
*/
|
||||
HttpServerCookie::Ptr addCookie(
|
||||
const std::string &cookie_name, const std::string &uid, uint64_t max_elapsed = COOKIE_DEFAULT_LIFE,
|
||||
std::shared_ptr<void> attach = nullptr,
|
||||
toolkit::Any = toolkit::Any{},
|
||||
int max_client = 1);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user