Name: cordova-plugin-toast
Owner: Samsung
Description: Cordova plugin that provides TV Specific functionalities.
Created: 2015-10-26 01:08:48.0
Updated: 2018-01-11 14:55:28.0
Pushed: 2017-08-02 23:04:43.0
Homepage: null
Size: 48723
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
ment.addEventListener("deviceready", onDeviceReady, false);
tion onDeviceReady() {
console.log(toast);
If you want more details, please refer belows.
./
|-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
sectv-orsay
and sectv-tizen
and tv-webos
platforms.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 |
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
m install -g cordova
m install -g grunt-cli
For copying repositories, please mkdir
a root directory.
dir <root directory>
In the root directory, please git clone
the following repositories.
t clone https://github.com/apache/cordova-js.git
t clone https://github.com/apache/cordova-browser.git
t clone https://github.com/Samsung/cordova-plugin-toast.git
t clone https://github.com/Samsung/cordova-sectv-orsay.git
t clone https://github.com/Samsung/cordova-sectv-tizen.git
t clone https://github.com/Samsung/cordova-tv-webos.git
t clone https://github.com/Samsung/grunt-cordova-sectv.git
Please npm install
to install dependencies in cordova-js
, cordova-plugin-toast
, cordova-sectv-orsay
, cordova-sectv-tizen
, cordova-tv-webos
, grunt-cordova-sectv
.
m install
In cordova-js/Gruntfile.js
, please add compile tasks.
le.exports = function(grunt) {
t.initConfig({
pkg: grunt.file.readJSON('package.json'),
compile: {
...
"sectv-orsay": {},
"sectv-tizen": {},
"tv-webos": {}
},
In cordova-js/package.json
, please add the platforms to cordova-platforms
like below.
dova-platforms" : {
...
dova-sectv-orsay" : "../cordova-sectv-orsay",
dova-sectv-tizen" : "../cordova-sectv-tizen",
dova-tv-webos" : "../cordova-tv-webos"
In cordova-js
, please grunt compile
for packaging.
unt compile:sectv-orsay compile:sectv-tizen compile:tv-webos
In cordova-plugin-toast
, please grunt compile
for packaging.
unt compile:sectv-orsay compile:sectv-tizen compile:tv-webos
recommended workspace
ordova-js/ ............
ordova-browser/ .......
ordova-plugin-toast/ ..
ordova-sectv-orsay/ ...
ordova-sectv-tizen/ ...
ordova-tv-webos/ ......
runt-cordova-sectv/ ...
create empty project
eate cordova project
rdova create TestApp
TestApp
ware of hidden file
-rf ../grunt-cordova-sectv/sample/. ./
m install ../grunt-cordova-sectv
unt task for build and package
stall dependency modules
m install
r toast browser simulator
rdova platform add browser
ndatory plugins for using browser simulator (not for other platforms)
rdova plugin add cordova-plugin-device
rdova plugin add cordova-plugin-network-information
rdova plugin add cordova-plugin-globalization
d toast plugin
rdova plugin add ../cordova-plugin-toast
www/index.html
REMOVE meta tag for setting CSP(Content-Security-Policy)
a http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
<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>
```
browser
rdova build browser
sectv-orsay
unt sectv-prepare:sectv-orsay
sectv-tizen
unt sectv-prepare:sectv-tizen
tv-webos
unt sectv-prepare:tv-webos
browser
st on browser platform
rdova emulate browser
sectv-orsay
st on sectv-orsay platform
unt sectv-build:sectv-orsay
n the application on target by using SDK
sectv-tizen
st on sectv-tizen platform
unt sectv-build:sectv-tizen
n the application on target by using SDK
tv-webos
st on tv-webos platform
unt sectv-build:tv-webos
n 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)
eate cordova project
rdova create TestRunner --template=cordova-plugin-toast/cordova-test-runner
TestRunner
ware of hidden file
-rf ../grunt-cordova-sectv/sample/. ./
m install ../grunt-cordova-sectv
unt task for build and package
stall dependency modules
m install
r toast browser simulator
rdova platform add browser
ndatory plugins for using browser simulator (not for other platforms)
rdova plugin add cordova-plugin-device
rdova plugin add cordova-plugin-network-information
rdova plugin add cordova-plugin-globalization
d toast plugin
rdova plugin add ../cordova-plugin-toast
Not yet