ServerSession
-
class
cee.vs.ServerSession() A ServerSession object is the first object that needs to be initialized when working with the
StreamModel. It manages the communication with the Visualization Streamer (VizStreamer) service.The
getAvailableStreams_asyncmethod is used to get the information about all available streams. These streams can be subsequently used to createStreamModelinstance(s) with the methodcreateStreamModel.- Example:
- Create a ServerSession and a StreamModel from the first available stream.
// Connect to the server session at the given url. const serverSession = await cee.vs.ServerSession.createInstance_async("http://localhost:8080"); // Get the available streams const streams = await serverSession.getAvailableStreams_async(); if (streams[0]) { const streamName = streams[0].streamName; const streamModel = serverSession.createStreamModel(streamName); // Add the model to the cee.View this.view.addModel(streamModel); // Start the streaming if not already started. if (!streamModel.isStreamingActive()) { streamModel.startStreaming(); } }
Methods
createStreamModel
-
ServerSession.createStreamModel(streamName) Arguments: - streamName (
string) – None
Creates a new
StreamModelfrom the given stream name. The streaming is started immediately upon creation.Return type: StreamModel - streamName (