Multi App
On some services OmniStream supports the ability to switch between apps using connection parameters.
Select App
You can select the app to connect to by entering the project name, app name and app ID. This is useful when you have multiple app each containing different content rather than a single app with the ability to load assets or switch configuration.
Connection Parameters
const cloudstreamSettings = {
//True when connecting to a specific machine you know the address of, false for normal usage
directConnection: false,
//Your account settings
cloudConnectionParameters: {
//Your project name
customer: "omnistream",
//Your rendering service (eg. stage or live)
renderService: "yourservicename",
},
//Container in hosting page to present stream in to
parent: "streamContainer",
//Optional: used to select the an app on the service, if not entered the service will automatically query the service and load the default app
appSelect: {
project: "omnistream",
app: "testproject",
id: "0000",
},
};
Query Apps
You can query what apps are available of a service by running the following code.
const libzl = new LibZL();
const cloudstreamSettings = {
directConnection: true,
cloudConnectionParameters: {
customer: "omnistream",
renderService: "yourservicename",
},
directConnectionParameters: {
ipAddress: "localhost",
},
streamingMode: "video",
parent: "streamContainer",
};
libzl.cloudstream("OmniStreamMultiApp").then(function (api) {
cloudstream = window.cloudstream = api;
cloudstream.queryAppsOnService(cloudstreamSettings, function (error, data) {
//List of apps
apps = data;
//Get details from first app in the list
const appDetails = apps[0].split(" ");
const project = appDetails[0];
const app = appDetails[1];
const id = appDetails[2];
});
});