Skip to content

Commit

Permalink
Add static build for "generic" TV apps
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinber committed Jul 2, 2024
1 parent 7c83936 commit a613c54
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ tizen/index.html
tizen/js/*.js
WebOS/index.html
WebOS/js/*.js
generic-tv/index.html
generic-tv/js/*.js
13 changes: 13 additions & 0 deletions generic-tv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Bitmovin Player Yospace Integration Generic TV Sample

This folder contains a sample for how to use the Bitmovin Player Yospace Integration library on web-based TVs.

For Samsung Tizen or LG WebOS TVs, please refer to the specific respective examples, [../tizen/](../tizen/) and [../WebOS/](../WebOS/).

## Getting started

Run `npm run build-tv` (or `npm run build-tv:dev`) in the project root to build the library and copy all required files, including the sample web page and Javascript files, to the correct location in this folder.

Deploy the content of this folder, including subdirectories, to a web server and point your TV app to this. Exact details may vary depending on the TV platform.

Please note that changes in the `index.html` and `js/*` files will be overwritten by the build tooling, changes should be made in the [../web/\*](../web/) folder only.
21 changes: 21 additions & 0 deletions generic-tv/platformSpecificInit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var platformReadyForPlayerPromise = (function () {
return Promise.resolve();
})();

function updateWithPlatformSpecificConfig(config) {
config.tweaks = config.adaptation || {};
config.tweaks.maxStartupBitrate = '1.0mbps';
return config;
}

function updateWithPlatformSpecificSourceConfig(source) {
if (source.drm && source.drm.playready) {
source.drm.playready.utf8message = true;
source.drm.playready.plaintextChallenge = true;
source.drm.playready.headers = source.drm.playready.headers || {};
source.drm.playready.headers['Content-Type'] = 'text/xml';
}
return source;
}

var platformType = 'generic-tv';
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
"scripts": {
"prepublishOnly": "npm run clean; npm run lint && npm run build",
"build": "webpack --config webpack.prod.js",
"build-tv": "npm run build && npm run copyToTizen && npm run copyToWebOS",
"build-tv": "npm run build && npm run copyToTizen && npm run copyToWebOS && npm run copyToGenericTV",
"build:dev": "webpack --config webpack.dev.js",
"build-tv:dev": "npm run build:dev && npm run copyToTizen && npm run copyToWebOS",
"build-tv:dev": "npm run build:dev && npm run copyToTizen && npm run copyToWebOS && npm run copyToGenericTV",
"start": "webpack serve --open --config webpack.dev.js",
"copyToTizen": "mkdir -p ./tizen/js && cp ./dist/js/bitmovin-player-yospace.js ./tizen/js/ && cp ./web/index.html ./tizen && cp ./web/js/*.js ./tizen/js/",
"copyToWebOS": "mkdir -p ./WebOS/js && cp ./dist/js/bitmovin-player-yospace.js ./WebOS/js/ && cp ./web/index.html ./WebOS && cp ./web/js/*.js ./WebOS/js/ && npm run insertWebOSScript",
"copyToGenericTV": "mkdir -p ./generic-tv/js && cp ./dist/js/bitmovin-player-yospace.js ./generic-tv/js/ && cp ./web/index.html ./generic-tv && cp ./web/js/*.js ./generic-tv/js/",
"insertWebOSScript": "npx replace-in-file '<!-- <SCRIPT_PLACEHOLDER> -->' '<script type=\"text/javascript\" src=\"webOSTVjs-1.1.0/webOSTV.js\"></script><script type=\"text/javascript\" src=\"webOSTVjs-1.1.0/webOSTV-dev.js\"></script>' ./WebOS/index.html",
"lint": "eslint --quiet src/ && kacl lint",
"format": "prettier --write src/",
Expand All @@ -21,6 +22,7 @@
"clean-tv": "npm run clean-tv-tizen && npm run clean-tv-webos",
"clean-tv-tizen": "rm tizen/js/*.js && rm tizen/index.html",
"clean-tv-webos": "rm WebOS/js/* && rm WebOS/index.html",
"clean-tv-generic": "rm generic-tv/js/* && rm generic-tv/index.html",
"prepare": "husky install"
},
"lint-staged": {
Expand Down
2 changes: 1 addition & 1 deletion web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ This folder contains a sample for how to use the Bitmovin Player Yospace Integra

Run `npm run start` in the project root to build the library and open a local web server with this sample page.

Note that the content of this `web/` folder is also used in the [..tizen/](../tizen/) and [../WebOS](../WebOS/) sample apps.
Note that the content of this `web/` folder is also used in the [../tizen/](../tizen/), [../WebOS](../WebOS/), and [../generic-tv/](../generic-tv/) sample apps.

0 comments on commit a613c54

Please sign in to comment.