Cordova plugin that provides TV Specific functionalities.
This plugin defines a global toast
object, which provides an API for TV specific functionalities that is based on Cordova project.
Although the object provides the global scoped toast
object, it is not available until after the deviceready
event which is provided by Cordova.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(toast);
}
If you want more details, please refer belows.
- Guide
- wiki.
- Youtube
- Youtube link for 2016 SDC tech session : Write Once and Run Everywhere with TOAST for Smart TV.
- TOAST introduce video
- TOAST video contains introduce for TOAST briefly. It would help you understand easily.
./
|-cordova-test-runner/ ... TestRunner/TestSuite Cordova application
|-docs/ .................. Documents which are including API Specification
|-sample/ ................ Sample applications using TOAST API
|-src/ ................... Platform dependent modules for the plugin TOAST
| |-browser/ ............ Plugin implementation for the platform `browser`
| |-sectv-orsay/ ........ Plugin implementation for the platform `sectv-orsay`
| |-sectv-tizen/ ........ Plugin implementation for the platform `sectv-tizen`
| `-tv-webos/ ........... Plugin implementation for the platform `tv-webos`
|-tasks/ ................. custom grunt tasks to build the toast.js
|-www/ ................... Platform independent modules for the plugin TOAST
|-Gruntfile.js ........... Gruntfile to build the toast.js
'-plugin.xml ............. Cordova Plugin configuration for TOAST
- cordova-sectv-orsay is an application library that allows for Cordova-based projects to be built for the Legacy Samsung Smart TV Platform.(A.K.A Orsay)
- cordova-sectv-tizen is an application library that allows for Cordova-based projects to be built for the Samsung Tizen TV Platform.
- cordova-tv-webos is an application library that allows for Cordova-based projects to be built for the LG WebOS TV Platform.
- grunt-cordova-sectv is a grunt task to prepare and build package from a cordova project for
sectv-orsay
andsectv-tizen
andtv-webos
platforms.
- browser
- Legacy Samsung Smart TV (sectv-orsay)
- Tizen Samsung Smart TV (sectv-tizen)
- WebOS LG Smart TV (tv-webos)
Feature Name | Browser | Legacy Samsung Smart TV | Tizen Samsung Smart TV | WebOS LG Smart TV | |||||
2012 | 2013 | 2014 | 2015 | 2016 | 2014 | 2015 | 2016 | ||
toast.Media | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
toast.MediaPlugin | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
toast.drminfo | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No |
toast.application | Partly | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
toast.inputdevice | Partly | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
toast.tvaudiocontrol | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
toast.tvwindow | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No |
toast.tvchannel | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No |
IME | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
- Prepare to start contains contents such as precondition, configuration or compile before using TOAST.
First, TOAST needs the followings. Please install these.
-
Samsung Tizen SDK (It is only for Tizen packaging, please refer to grunt-cordova-sectv, Build and package
-
npm modules: cordova, grunt
$ npm install -g cordova $ npm install -g grunt-cli
-
For copying repositories, please
mkdir
a root directory.$ mkdir <root directory>
-
In the root directory, please
git clone
the following repositories.$ git clone https://github.com/apache/cordova-js.git $ git clone https://github.com/apache/cordova-browser.git $ git clone https://github.com/Samsung/cordova-plugin-toast.git $ git clone https://github.com/Samsung/cordova-sectv-orsay.git $ git clone https://github.com/Samsung/cordova-sectv-tizen.git $ git clone https://github.com/Samsung/cordova-tv-webos.git $ git clone https://github.com/Samsung/grunt-cordova-sectv.git
-
Please
npm install
to install dependencies incordova-js
,cordova-plugin-toast
,cordova-sectv-orsay
,cordova-sectv-tizen
,cordova-tv-webos
,grunt-cordova-sectv
.$ npm install
-
In
cordova-js/Gruntfile.js
, please add compile tasks.module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), compile: { ... "sectv-orsay": {}, "sectv-tizen": {}, "tv-webos": {} },
-
In
cordova-js/package.json
, please add the platforms tocordova-platforms
like below."cordova-platforms" : { ... "cordova-sectv-orsay" : "../cordova-sectv-orsay", "cordova-sectv-tizen" : "../cordova-sectv-tizen", "cordova-tv-webos" : "../cordova-tv-webos" }
-
In
cordova-js
, pleasegrunt compile
for packaging.$ grunt compile:sectv-orsay compile:sectv-tizen compile:tv-webos
-
In
cordova-plugin-toast
, pleasegrunt compile
for packaging.$ grunt compile:sectv-orsay compile:sectv-tizen compile:tv-webos
- Create Project contains how to create TOAST Project step by step.
-
recommended workspace
./ |-cordova-js/ ............ |-cordova-browser/ ....... |-cordova-plugin-toast/ .. |-cordova-sectv-orsay/ ... |-cordova-sectv-tizen/ ... |-cordova-tv-webos/ ...... `-grunt-cordova-sectv/ ...
-
create empty project
# Create cordova project $ cordova create TestApp $ cd TestApp # Beware of hidden file $ cp -rf ../grunt-cordova-sectv/sample/. ./ $ npm install ../grunt-cordova-sectv # Grunt task for build and package # Install dependency modules $ npm install # For toast browser simulator $ cordova platform add browser # Mandatory plugins for using browser simulator (not for other platforms) $ cordova plugin add cordova-plugin-device $ cordova plugin add cordova-plugin-network-information $ cordova plugin add cordova-plugin-globalization # Add toast plugin $ cordova plugin add ../cordova-plugin-toast
-
www/index.html
<body>
...
<script type="text/javascript" src="cordova.js"></script>
<!-- Add toast.js to use toast api -->
<script type="text/javascript" src="toast.js"></script>
...
</body>
```
- Prepare and Build contains how to prepare and build TOAST project for each platforms. "Prepare" task could help to compose necessary components of TOAST project for each platforms. "Build" task could help to package TOAST project as format for each platforms.
-
browser
$ cordova build browser
-
sectv-orsay
$ grunt sectv-prepare:sectv-orsay
-
sectv-tizen
$ grunt sectv-prepare:sectv-tizen
-
tv-webos
$ grunt sectv-prepare:tv-webos
-
browser
# Test on browser platform $ cordova emulate browser
-
sectv-orsay
# Test on sectv-orsay platform $ grunt sectv-build:sectv-orsay # Run the application on target by using SDK
-
sectv-tizen
# Test on sectv-tizen platform $ grunt sectv-build:sectv-tizen # Run the application on target by using SDK
-
tv-webos
# Test on tv-webos platform $ grunt sectv-build:tv-webos # Run the application on target by using SDK
-
For more details, please refer the tizen package
-
You can test on each platforms with Test Runner cordova application which is located at 'cordova-test-runner' directory of this project.
-
Please refer to below for running the tests: (Assuming that the grunt-cordova-sectv project is cloned at the same level with this project)
# Create cordova project $ cordova create TestRunner --template=cordova-plugin-toast/cordova-test-runner $ cd TestRunner # Beware of hidden file $ cp -rf ../grunt-cordova-sectv/sample/. ./ $ npm install ../grunt-cordova-sectv # Grunt task for build and package # Install dependency modules $ npm install # For toast browser simulator $ cordova platform add browser # Mandatory plugins for using browser simulator (not for other platforms) $ cordova plugin add cordova-plugin-device $ cordova plugin add cordova-plugin-network-information $ cordova plugin add cordova-plugin-globalization # Add toast plugin $ cordova plugin add ../cordova-plugin-toast
- Converting Tizen to Toast contains how to convert application which is made with Tizen to TOAST.
- Converting Orsay to Toast contains how to convert application which is made with Orsay to TOAST.
- toast.Media
- toast.MediaPlugin
- toast.drminfo
- toast.application
- toast.inputdevice
- toast.tvaudiocontrol
- toast.tvwindow
- toast.tvchannel
- Contribution Guideline contains several tips to participate in contribution.
Not yet