Commit e68af22f by guoxuejian

feat: add endpoints for restarting and refreshing live streams with appropriate lifecycle events

parent 41a8230a
...@@ -100,6 +100,28 @@ public class LiveStreamController { ...@@ -100,6 +100,28 @@ public class LiveStreamController {
} }
/** /**
* Restart live stream: stop then start, and broadcast restart lifecycle events.
* @param liveParam restart parameters (workspace_id, video_id required).
* @return
*/
@PostMapping("/streams/restart")
public HttpResultResponse liveRestart(@RequestBody LiveTypeDTO liveParam) {
return liveStreamService.liveRestart(liveParam);
}
/**
* Refresh live stream: frontend-controlled refresh flow.
* Executes refreshStop (device stop without clearing sessions) + start + broadcast.
* Other clients reuse session_id and wait for MQTT push to auto-recover.
* @param liveParam refresh parameters (workspace_id, video_id, url_type required).
* @return
*/
@PostMapping("/streams/refresh")
public HttpResultResponse liveRefresh(@RequestBody LiveTypeDTO liveParam) {
return liveStreamService.liveRefresh(liveParam);
}
/**
* Session-aware stop: only removes the specified sessionId's viewer session. * Session-aware stop: only removes the specified sessionId's viewer session.
* Actual device stop is triggered only when all viewers have left. * Actual device stop is triggered only when all viewers have left.
* @param liveParam Live streaming parameters (must include session_id from liveStart response). * @param liveParam Live streaming parameters (must include session_id from liveStart response).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment