This sample application shows how to use Tizen WASM Player to play media on a TizenTV device using HTMLMediaElement with ElementaryMediaStreamSource as a data source in a WebAssembly module.
The sample application's features are:
elementary media stream playback using HTMLMediaElement with an ElementaryMediaStreamSource data source (Normal Latency mode),
Emscripten SDK with Samsung extensions and Tizen Studio are required to build Sample WASM Player Application. Please follow the Downloading and Installing guide to learn more about their installation and setup.
Step-by-step guide
1. Launch Tizen Studio.
2. Create a new WebAssembly-enabled project in Tizen Studio:
File -> New -> Tizen Project,
select 'Template' and click 'Next',
select 'TV' and click 'Next',
select 'Web Application', check 'WebAssembly (C/C++)' box and click 'Next',
select 'Empty' application template and click 'Next',
name the project EMSSSample and click 'Next',
enter paths to the Emscripten configuration file and cache directory,
Flags are explained below, in Required Emscripten flags section.
remove -s EXPORT_NAME=EMSSSampleModule -s MODULARIZE=1 from 'Linker flags'.
Note :
This step is required, because code loading modularized and non-modularized WebAssembly modules differ slightly. This sample is prepared to load modules that doesn't use MODULARIZE option.
click 'Apply and Close'.
6. Build the project:
click right mouse button on the EMSSSample project in 'Project Explorer',
click 'Build Project' in context menu.
7. Create a widget package:
click right mouse button on the EMSSSample project in 'Project Explorer',
click 'Build Signed Package' in context menu.
8. The widget is ready to use!
Required Emscripten flags
The table below explains Emscripten-specific build flags required to build the EMSS Sample application:
Flag
Description
-s ENVIRONMENT_MAY_BE_TIZEN
Enables usage of Samsung Tizen Emscripten extensions available on Samsung Tizen TVs. This flag is necessary to use Elementary Media Stream Source.
-pthread -s USE_PTHREADS=1
Enables usage of threads in WebAssembly module.
-s PTHREAD_POOL_SIZE=1
WebAssembly module will be prepared to start indicated number of threads. It's important to set this parameter to a maximum number of threads that an application uses; otherwise star ting new threads may fail! See pthreads in Emscripten documentation for more information.
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.