Skip to content

Commit

Permalink
Version 2.0.0
Browse files Browse the repository at this point in the history
GitOrigin-RevId: de8101bda1ac4dcf3af07cd2573c40df128e3dfb
  • Loading branch information
Interfaced authored and l1bbcsg committed Jun 13, 2019
1 parent 607eda5 commit f64604a
Show file tree
Hide file tree
Showing 21 changed files with 5,571 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const {join, dirname} = require('path');
const nodeOverrides = require('eslint-config-interfaced/overrides/node');

function resolveModulePath(packageName) {
const packageInfoPath = require.resolve(`${packageName}/package.json`);

return join(dirname(packageInfoPath), require(packageInfoPath).module);
}

module.exports = {
extends: 'interfaced',
rules: {
'space-before-function-paren': ['error', {
named: 'never',
anonymous: 'always',
asyncArrow: 'always'
}]
},
overrides: [
{
...require('eslint-config-interfaced/overrides/esm'),
files: ['lib/**/*.js'],
settings: {
'import/resolver': {
alias: [
['zb', resolveModulePath('zombiebox')]
]
}
}
},
{
files: ['lib/**/*.js'],
rules: {
'import/no-unresolved': ['error', {ignore: ['^generated/']}]
}
},
{
...nodeOverrides,
files: ['index.js', 'cli/webos.js', 'tester/*.js'],
rules: {
...nodeOverrides.rules,
'node/no-unsupported-features/es-builtins': ["error", { "version": ">=8.9" }],
'node/no-unsupported-features/es-syntax': ["error", { "version": ">=8.9" }],
'node/no-unsupported-features/node-builtins': ["error", { "version": ">=8.9" }],
'node/no-deprecated-api': ['error', {
'ignoreModuleItems': [
'url.parse' // TODO: remove once node 8 support is dropped and the deprecation is handled
]
}]
}
}
]
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
\.idea
tester/dist
node_modules
119 changes: 119 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Changelog

## 2.0.0 (13.06.2019)

### Improvements
* Support ZombieBox 2.0

### Fixes
* Fix incorrect config reference

## 2.0.0-alpha.3 (23.05.2019)

### Improvements
* Support ZombieBox alpha.8 (implement `AbstractExtension`)
* Drop support for Node 8

## 2.0.0-alpha.2 (21.03.2019)

### Fixes
* zb-platform-test was updated to 2.0

## 2.0.0-alpha.1 (13.02.2019)

Platform code migrated to ECMAScript modules.

## 1.0.1 (04.02.2019)

### Fixes

* Fix GCC warnings in Video

## 1.0.0 (31.01.2019)

### Improvements
* **4342** Integrated platform testing suite
* **7404** Implemented `Device.getIP` method

## v0.6.0 (26.01.2018)

### Features

* **#6167** Throw error `zb.device.errors.UnsupportedFeature` for unsupported platform feature. **[BREAKING]**

## v0.5.2 (13.12.2017)

### Features

* **#6494** Added CLI command install, run to platform.

### Improvements

* **#6501** Updated eslint and fix errors.

## v0.5.1 (22.09.2017)

### Fixes

* **#6372** Fixed initialization fail on webOS 1.0

## v0.5.0 (16.08.2017)

### Features

* **#6289** Change getters for versions [BREAKING_BACK]

### Fixes

* **#6290** Removed default resolution

## v0.4.0 (24.05.2017)

### Features

* **#5907** Added getting duid.
* **#6085** Implemented getting locale. See `Info#locale`.
* **#6062** Implemented getter for launch parameters.

## v0.3.0 (09.03.2017)

### Features

* **#5625** Remove method `Device#processBackKey`. [BREAKING_BACK]

### Fixes

* **#5876** Fix playing video from position.
* **#6000** Fix aspect-ratio namespaces.

## v0.2.2 (24.01.2016)

### Features

* **#5845** Added getting ares-package paths from variable of user environment setted WebOS IDE.

## v0.2.1 (15.12.2016)

### Features

* **#5042** Added factory method `zb.device.platforms.webos.factory.createDevice` for create Device instances.
All global dependencies now located in factory method.
* **#5042** All *.es6 files renamed to *.js

### Fixes

* **#5612** Fixed exit with back button.

## v0.2.0 (27.07.2016)

### Features

* **#3999** Add ViewPort class which is responsible for managing display area sizes and aspect ratio
* **#4124** Add default and user icons adding
* **#4420** Rename abstract Video class (zb.device.Video) to AbstractVideo (zb.device.AbstractVideo)
* **#4493** Transpiled client-side files to ES6

### Improvements

* **#2233** Partial support of Aspect Ratio
* **#4107** Remove HTML5 prefix in *zb.device.platforms.webos.HTML5Video*
91 changes: 91 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
### Usage notes

* Before playing video stream you need set correct MIME type of source by calling `setMimeType(<string>)` method.
* If you'll not use second parameter of method `play` then just do nothing or call `setMimeType(null)`.

### Config options

Example configuration:

```javascript
/**
* @param {Object} config
* @return {Object}
*/
module.exports = function(config) {
return {
platforms: {
webos: {
toolsDir: '/opt/webOS_TV_SDK/CLI/bin/',
appinfo: {
id: 'com.myco.app.appname',
title: 'AppName',
main: 'index.html',
type: 'web',
vendor: 'My Company',
version: '1.0.0',
appDescription: 'This is an app tagline',
resolution: '1920x1080',
bgColor: 'red',
iconColor: 'red',
transparent: false
},
img: __dirname + '/webos/img'
}
}
};
};
```

**Note:** By default, `zb webos` commands will use cli tools path from your shell's environment variable `WEBOS_CLI_TV` (which is being added by LG's installer by default). If you are getting an error about cli tools not being found, check if it's present in `/etc/profile`. If it's not, add with something like:
```bash
echo 'export WEBOS_CLI_TV="/opt/webOS_TV_SDK/CLI/bin"' >> /etc/profile
```
Then logout from your shell, login back and try again. `/opt/webOS_TV_SDK/CLI/bin` is just an example. Use your SDK location path.

You may also set path to cli tools with `webos.toolsDir` in config file as per example, but it's recommended to use system environment variables to achieve better portability between different systems.

- `webos.toolsDir` (optional field) — path to SDK cli tools.
- `webos.appinfo` — should be filled according [webOS App Metadata structure](http://webostv.developer.lge.com/develop/app-developer-guide/app-metadata/).
- `webos.img` — full path (string) to folder with `icon.png`, `large-icon.png`, `bg-image.png` and `splash-background.png` or object with the following structure:

```javascript
img: {
[PlatformWebOS.ImageName.ICON]: '/full/path/to/icon.png',
[PlatformWebOS.ImageName.LARGE_ICON]: __dirname + '/relative/path/to/largeIcon.png',
[PlatformWebOS.ImageName.BACKGROUND_IMAGE]: __dirname + '/webos/img/1920.png',
[PlatformWebOS.ImageName.SPLASH_SCREEN_BACKGROUND]: __dirname + '/webos/design/photos/ocean.png'
}
```
`icon`, `largeIcon`, `bgImage`, `splashBackground` of appinfo section will be replaced with default values during build process.

Override `_backOnEmptyHistory`:

```javascript
class Application extends BaseApplication {
/**
* @override
*/
_backOnEmptyHistory() {
return this.isDeviceWebos() ? this.device.showAppsManager() : this.device.exit();
}
}
```

### Install Application
To install an .ipk file on the TV use `zb webos install`. Pass the device name as a parameter. Application with the same ID will be replaced by newer one.
```bash
zb webos install --device $deviceName
```

_Example:_ `zb webos install --device webOS_2014`

**Note:** If you didn't specify application ID in `webos.appinfo` section, then it will be generated with random postfix every time you run `build` command. When using static ID every new installation on a device will replace old application with newer one. In that situation if you want to persist old copies, consider adding `test` (or any other name you prefer) configuration to your project where you can generate custom ID for every application build and passing it to your `build` command .

### Launch Application
To launch an .ipk file on the TV use `zb webos launch`. Pass the device name as a parameter.
```bash
zb webos launch --device $deviceName
```

_Example:_ `zb webos launch --device webOS_2014`
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright © 2014-2019 Interfaced

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
15 changes: 15 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Migration from

## 0.2.x to 0.3.x

### Setting MIME type of video source

#### Only if you using `play` method with second parameter:

* Replace `webOSVideo.play(url, startTime);`
to `webOSVideo.setMimeType(mimeType); webOSVideo.play(url, startTime);`
* *Notes:* `mimeType` must be correct for playing stream.

### Removed `Device#processBackKey`

* Use `showAppsManager()` in `Application#_backOnEmptyHistory()`
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# zombiebox-platform-webos

[LG webOS](http://webostv.developer.lge.com/discover/discover-webos-tv) Smart TV support abstraction layer for [ZombieBox](http://zombiebox.tv) framework.

For LG NetCast platform see [`zombiebox-platform-lg`](https://www.npmjs.com/package/zombiebox-platform-lg).

## Installation

From zombiebox project root run:

```bash
npm i zombiebox-platform-webos
```
Loading

0 comments on commit f64604a

Please sign in to comment.