This section shows how to use Tizen WASM Player sample application.
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. The sample application's features are:
HTMLMediaElement
ElementaryMediaStreamSource
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
Click "Finish".
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:
EMSSSample/index.html
EMSSSample/main.js
EMSSSample/css/style.css
EMSSSampleModule/inc/empty.hpp
EMSSSampleModule/src/empty.cpp
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
-s EXPORT_NAME=EMSSSampleModule -s MODULARIZE=1
MODULARIZE
Build the project:
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
</small class="small" style="top: -24px;position: relative;">Table 1. Required Samsung Emscripten SDK Flags