This section shows how to use Tizen WASM Player sample application.
Tizen WASM Player API Documentation
Getting Started with WebAssembly
Tizen WASM Player Sample (Normal Latency)
The Tizen WASM Player sample application shows how to use the Tizen WASM Player to play media on a Tizen device using HTMLMediaElement with ElementaryMediaStreamSource as a data source in a WebAssembly module.
HTMLMediaElement
ElementaryMediaStreamSource
The sample application's features are:
Packetized data is hardcoded in the application to maximize data access simplicity.
This section covers how to build the sample application in Tizen Studio, including prerequisites and a step by step guide to the build process.
To build the sample application, you need the following:
To build the sample application:
Launch Tizen Studio.
Create a new WebAssembly-enabled project in Tizen Studio:
EMSSSample
Note For details on Emscripten configuration in Tizen Studio, see Configuring the Samsung Emscripten SDK.
For details on Emscripten configuration in Tizen Studio, see Configuring the Samsung Emscripten SDK.
Add a new WebAssembly module to the project:
EMSSSampleModule
Replace the default HTML5 and C++ files generated by Tizen Studio with the files from the sample:
Remove the following HTML5 and C++ files:
EMSSSample/index.html
EMSSSample/main.js
EMSSSample/css/style.css
EMSSSampleModule/inc/empty.hpp
EMSSSampleModule/src/empty.cpp
Copy the sample widget's files to the project in Tizen Studio:
elementary_media_stream_source_sample/widget/*
EMSSSample/
elementary_media_stream_source_sample/src/*
EMSSSampleModule/
Add the necessary compiler and linker flags to the WebAssembly module:
-std=gnu++11
-std=gnu++14
-s ENVIRONMENT_MAY_BE_TIZEN -pthread -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1
Note These flags are explained below, in the Required Samsung Emscripten SDK Flags section.
These flags are explained below, in the Required Samsung Emscripten SDK Flags section.
-s EXPORT_NAME=EMSSSampleModule -s MODULARIZE=1
Note This step is required, because code loading for modularized and non-modularized WebAssembly modules differs slightly. The EMSS Sample application is prepared to load modules that do not use the MODULARIZE option.
This step is required, because code loading for modularized and non-modularized WebAssembly modules differs slightly. The EMSS Sample application is prepared to load modules that do not use the MODULARIZE option.
MODULARIZE
Build the project:
Create an application package:
The application is ready to use!
The table below explains the Emscripten-specific build flags required to build the sample application:
-s ENVIRONMENT_MAY_BE_TIZEN
-pthread -s USE_PTHREADS=1
-s PTHREAD_POOL_SIZE=1