Streams exist within a namespace. Use StreamManager to manage the lifecycle of a stream, including creation, deletion, and status control (enable/disable/stop). You can also retrieve stream URLs in either static or dynamic modes and query publishing/recording histories.
// Create a stream
Stream stream = new Stream("teststream004");
String namespaceId = "2akrarsj8zp0w";
streamManager.createStream(namespaceId, stream);
// Get stream URL (Static Mode)
StaticLiveRoute staticLiveRoute = new StaticLiveRoute("qvs-publish.qtest.com", "publishRtmp", 3600);
streamManager.staticPublishPlayURL(namespaceId, stream.getStreamID(), staticLiveRoute);
// Get stream URL (Dynamic Mode)
DynamicLiveRoute dynamicLiveRoute = new DynamicLiveRoute("127.0.0.1", "127.0.0.1", 0);
streamManager.dynamicPublishPlayURL(namespaceId, stream.getStreamID(), dynamicLiveRoute);
// Stream lifecycle and history
streamManager.queryStream(namespaceId, stream.getStreamID());
streamManager.stopStream(namespaceId, stream.getStreamID());
streamManager.queryStreamPubHistories(namespaceId, stream.getStreamID(), start, end, offset, line);