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:

  1. In the Kanzi Studio main menu, select Edit > User Preferences.

../_images/edit-user-preferences.png
  1. In the Advanced tab, enable the Update Preview when Kanzi Studio is not focused setting.

../_images/update-preview-when-kanzi-studio-is-not-focused.png

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:

  1. In Kanzi Studio, create a project with content that you want to stream in a virtual environment.

  2. 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.

    ../_images/import-kanzi-engine-plugin.png
  3. For content that you want to stream to a virtual environment:

    1. In Node Components create a Streaming Component for the root node of the part that you want to stream.

      ../_images/new_streaming_component.png
    2. Set the StreamId property of the Streaming Component.

  4. 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.

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.

See also

Starting stream-enabled virtual environments