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);
}
./
|-cordova-test-runner/ ... TestRunner/TestSuite Cordova application
|-docs/ .................. Documents which is including API Specification.
|-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`
|-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 (A.K.A Orsay) Platform.
- cordova-sectv-tizen is an application library that allows for Cordova-based projects to be built for the 2015's Samsung Tizen TV Platform.
- grunt-cordova-sectv is a Grunt task to build and create package from a cordova project for
sectv-orsay
andsectv-tizen
platforms.
-
platform
browser
For the
browser
platform, you don't need to build TOAST and just add this plugin by usingcordova plugin add
command. Please see How to use section for details. -
platform
sectv-orsay
andsectv-tizen
Make sure you have all of the node dependencies installed by running the following command from the repository root
$ npm install
All of the build tasks can be run via the grunt node module. Install it globally first by running:
$ sudo npm install -g grunt-cli
Then from the repository root run:
$ grunt compile
It will creates the
toast.js
for each platforms in theplatform_www/<platform>
directories of the repository root.
You can develop your cordova TV application by using chrome browser with simulated Toast API.
$ cordova platform add browser
$ cordova plugin add {{Local or git path to this project}}
$ cordova build browser
$ cordova emulate browser
For the 2015's TV:
-
Copy the
platform_www/sectv-tizen/toast.js
to your cordovawww
directory root. -
Include the
toast.js
right after the includingcordova.js
in your application'sindex.html
.<script src="cordova.js"></script> <!-- existing --> <script src="toast.js"></script>
-
Package your
www
directory using Samsung Tizen TV SDK
For the 2014's TV:
-
Copy the
platform_www/sectv-orsay/toast.js
to your cordovawww
directory root. -
Include the
toast.js
right after the includingcordova.js
in your application'sindex.html
.<script src="cordova.js"></script> <!-- existing --> <script src="toast.js"></script>
-
Zip your
www
directory to create 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)
$ cordova create TestRunner --src=cordova-plugin-toast/cordova-test-runner $ cd TestRunner $ npm install grunt-cordova-sectv $ cp -rf ../grunt-cordova-sectv/sample/* ./ $ npm install $ cordova platform add browser $ cordova plugin add ../cordova-plugin-toast # Test on browser platform $ cordova build browser $ cordova emulate browser # Test on sectv-orsay platform $ grunt sectv-build:sectv-orsay sectv-package:sectv-orsay # Run the application on target by using SDK # Test on sectv-tizen platform $ grunt sectv-build:sectv-tizen sectv-package:sectv-tizen # Run the application on target by using SDK
Not yet