Enabling streaming¶
A streaming application is an application that streams its contents to virtual environments using Kanzi VR and the Streaming Plugin. A common use case for streaming applications is to enable streaming for already existing content that you want to see in a virtual environment.
Stream sources¶
Kanzi VR supports the following stream sources:
A kzb file run by the Streaming Kzb Player.
Use this streaming source when you have a Kanzi Studio project and a kzb file and no specific application is required for running the kzb file. This means that all the logic is contained in the Kanzi Studio project, plugins it refers to, or in code-behind modules.
A Kanzi application that loads a kzb file that uses the Streaming Plugin.
Use this streaming source when custom application code is needed for displaying the streamed content.
A Kanzi VR Android Streaming application.
Use this streaming source when you want to stream the contents of the whole screen of an Android device. This case is suitable when the streamed application relies on the Android platform or is partially or fully authored without Kanzi. A common example of this is an IVI screen created using native Android UI framework combined with Kanzi views for rich graphics.
To learn how to use Android streaming, see Android streaming.
Setting up the Kanzi Studio Preview¶
When you work with multiple streaming applications, to see the changes in the Preview:
In the Kanzi Studio main menu, select Edit > User Preferences.
In the Advanced tab, enable the Update Preview when Kanzi Studio is not focused setting.
Enabling streaming for a kzb file¶
To enable streaming for a kzb file use one of these approaches:
Run the unmodified kzb file with the Streaming Kzb Player.
Use this approach when you want to stream the full screen of existing content.
Streaming Kzb Player sets up full screen streaming for kzb files that do not refer to the Streaming Plugin and acts like the Kzb Player in other cases.
To learn how to use Streaming Kzb Player, see Starting all virtual environment processes.
Configure streaming using the Streaming Plugin in a Kanzi Studio project.
Use this approach when you want to see parts of the content of the kzb file on different screens in the virtual environment.
To learn how to create content using the Streaming Plugin in Kanzi Studio, see Enabling streaming using the Streaming Plugin in Kanzi Studio.
Enabling streaming using the Streaming Plugin in Kanzi Studio¶
To enable streaming using the Streaming Plugin in Kanzi Studio:
In Kanzi Studio, create a project with content that you want to stream in a virtual environment.
In the Library, right-click Kanzi Engine Plugins, select Import Kanzi Engine Plugin, and import the plugin from the
<KanziWorkspace>/Engine/plugins/kanzi-vr/plugins-streaming/lib/Win64
directory.For example, import
GL_vs2019_Release_DLL/KanziStreaming.dll
.The Streaming Plugin adds the Receiver Node nodes and the Streaming Component node component. A Streaming Component creates a stream of the content and a Receiver Node receives that content.
For content that you want to stream to a virtual environment:
In Node Components create a Streaming Component for the root node of the part that you want to stream.
Set the StreamId property of the Streaming Component.
Set Streaming Server Port to Screen.
When you use more than one stream in a Kanzi Studio project, all streams share the same port, but each uses a different Stream ID. See Configuring virtual environments.
To run kzb files created in this way, you can use the Kzb Player that comes with Kanzi. However, the Streaming Kzb Player is recommended because of its better interoperability with Configuring virtual environments.
To learn how to use the Streaming Kzb Player, see Starting all virtual environment processes.
To learn how to use the Kzb Player, see Starting a Kanzi VR application in the Kzb Player.
Enabling streaming in custom Kanzi applications¶
To enable streaming for custom Kanzi applications, see Enabling streaming using the Streaming Plugin in Kanzi Studio. Then load the modified kzb file to your Kanzi application.