This topic describes how to embed an existing Native Client module in a Smart TV application.
Due to NaCl deprecation by the Chromium project, Tizen TV will continue its support for NaCl only until 2021-year products. Meanwhile, Tizen TV will start focusing on high-performance, cross-browser WebAssembly from 2020-year products.
The Native Client (NaCl) technology and the Tizen Studio allow you to embed an existing NaCl module in your application. A previously-compiled Native Client module can be needed in a project for various reasons, for example due to security requirements, when the module's source code is already compiled and cannot be modified.
To embed an existing NaCl module, you need the following files:
You also need information on the module's functionality and API.
The following steps use the Hello World in C++ tutorial module. When the module is successfully loaded, it waits for incoming messages and, when it receives one, sends back the text "Echo from NaCl:" along with the original message text.
You must build the project once before removing the empty project source files. The files are needed by the builder to generate the correct building targets and folders.
The manifest file name must be the same as the project name.
Implement communication with the NaCl module in the "project.js" file.
document.getElementById("nacl_module").postMessage("Hello World from JS");
var uses_logging = true;
logs.value += message;
logs.scrollTop = logs.scrollHeight;
Build and launch the package.