Basic sending application for IVI example¶
This example shows how to turn any kzb file into a sending application without modifications.
For the contents of this example, the Kanzi VR feature uses the kzb file from the “Create a simple IVI application” tutorial in the main Kanzi workspace for streaming the IVI:
<KanziWorkspace>\Tutorials\First\Completed\Application\bin\first_application.kzb
Add the path to this file to the IVI stream in the configuration file:
# The configuration supports environment variable expansion with ${ENVIRONMENT_VARIABLE}.
# start_virtual_environment.exe adds these definitions automatically:
# - ${KANZI_HOME} defines the Kanzi workspace. For example, "c:/KanziWorkspace_3_9_1_211".
# - ${KANZI_VR_HOME} defines the Kanzi VR installation directory. For example, "c:/KanziWorkspace_3_9_1_211/Engine/plugins/kanzi-vr".
# - ${BUILD_VARIANT} defines the build variant. For example, "Debug" or "Release".
# - ${LIB_VARIANT} defines the library directory for the configuration. For example, "GL_vs2017_Release_DLL".
# - ${PLATFORM_TARGET} defines the platform target. For example, "Win64".
# Defines the installation location of the resource files that are
# used when streaming to a web browser. The path can be absolute or relative to the
# configuration file.
# Optional.
webResourcePath: "${KANZI_VR_HOME}/plugins-streaming/streaming-web-resources"
# Introduces the virtual environment to be started.
# Required.
virtual_environment:
# Introduces the kzb file that contains the model of the virtual environment.
# Set as <project_name>.kzb.cfg that lists all the kzb files used in the project.
# If the project uses a single kzb file, you can point only to that kzb file.
# Required.
kzb: exampledashboard.kzb.cfg
# Introduces additional paths to be used for searching binary dependencies.
# Can contain either a single path or a list of paths that you want to add to
# the PATH environment variable for the executable to be started. For example, use this
# to load feature packs or plugins whose binaries are in a different directory.
# Optional.
# extraPath:
# - "path/to/plugin1/lib/${PLATFORM_TARGET}/${LIB_VARIANT}"
# - "path/to/plugin2/lib/${PLATFORM_TARGET}/${LIB_VARIANT}"
# Defines a list of streams configured by their individual properties.
# Required.
streams:
# Introduces the kzb file to be started for this stream.
# Required only if you are using start-virtual-environment.exe and want to
# start this kzb file in the Streaming Kzb Player on the local computer.
# Optional.
- kzb: ${KANZI_VR_HOME}/examples/StreamSenderExample/bin/streamsenderexample.kzb.cfg
# Introduces either a single path or a list of paths that you want to add to
# the PATH environment variable that is used for searching binary dependencies.
# Works the same way as in virtual_environment.
# Optional.
# extraPath: "path/to/plugin3/lib/${PLATFORM_TARGET}/${LIB_VARIANT}"
# Defines a single stream ID or a list of stream IDs for which the host and port
# are configured.
# Required.
streamId:
- Cluster
- HUD
# Defines the host for the streams.
# Required.
host: localhost
# Defines the port for the streams.
# Required.
port: 9072
- kzb: "${KANZI_HOME}/Tutorials/First/Completed/Application/bin/first_application.kzb.cfg"
streamId: IVI
host: localhost
port: 9073
To start the file, use the Kanzi VR Launcher and virtual_environment_configuration.yaml
. See Config and startup example and Starting stream-enabled virtual environments.
Modifying the configuration¶
To switch the IVI stream to a different kzb file:
Replace the value of the
kzb
key with the path to the kzb file that you want to use.For example,
${KANZI_HOME}/Tutorials/Pages/Completed/Application/bin/pages.kzb
Restart the local applications.
To switch the IVI stream to a stream from a different device, such as a screen from an Android device:
Remove the
kzb
key.Set the value of the
host
key to match the hostname or IP address of the device. The device must be reachable on the local network.Start a stream on that device.
Restart the local applications.