@24i/smartapps-bigscreen-rnv-build-engine 0.18.2-alpha.2840 → 0.18.2-alpha.2846

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +2 -0
  2. package/dist/src/__tests__/resolvers/resolveBuildFileExtension.spec.js +6 -2
  3. package/dist/src/constants/buildProductionPackages.js +1 -0
  4. package/dist/src/constants/delopyLivePlatforms.js +1 -0
  5. package/dist/src/constants/platforms.js +1 -0
  6. package/dist/src/engine.js +5 -0
  7. package/dist/src/resolvers/resolveBuildFileExtension.js +1 -0
  8. package/dist/src/scripts/release/urlsMarkdown.js +1 -0
  9. package/dist/src/sdks/index.js +5 -1
  10. package/dist/src/sdks/sdk-androidtv/sdkAndroidtv.js +5 -0
  11. package/dist/src/sdks/sdk-vegaos/index.js +17 -0
  12. package/dist/src/sdks/sdk-vegaos/sdkVegaOS.js +201 -0
  13. package/dist/src/tasks/task.rnv.build.js +3 -0
  14. package/dist/src/tasks/task.rnv.configure.js +3 -0
  15. package/dist/src/tasks/task.rnv.deploy.js +1 -0
  16. package/dist/src/tasks/task.rnv.start.js +1 -0
  17. package/dist/templates/platforms/androidtv/project/app/build.gradle +3 -1
  18. package/dist/templates/platforms/androidtv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/configuration/BridgeConfig.kt +1 -0
  19. package/dist/templates/platforms/androidtv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/global/utils/PlayerFactoryBitmovinCustomized.kt +3 -1
  20. package/dist/templates/platforms/androidtv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/model/MediaEventType.kt +1 -0
  21. package/dist/templates/platforms/androidtv/project/app/src/main/kotlin/com/twentyfouri/tvbridge/webview/viewmodel/WebViewModel.kt +11 -0
  22. package/dist/templates/platforms/vegaos/project/.eslintrc +11 -0
  23. package/dist/templates/platforms/vegaos/project/.prettierrc +7 -0
  24. package/dist/templates/platforms/vegaos/project/app.json +5 -0
  25. package/dist/templates/platforms/vegaos/project/assets/image/.keep +0 -0
  26. package/dist/templates/platforms/vegaos/project/babel.config.js +3 -0
  27. package/dist/templates/platforms/vegaos/project/index.js +9 -0
  28. package/dist/templates/platforms/vegaos/project/jest.config.json +36 -0
  29. package/dist/templates/platforms/vegaos/project/manifest.toml +69 -0
  30. package/dist/templates/platforms/vegaos/project/metro.config.js +17 -0
  31. package/dist/templates/platforms/vegaos/project/package-lock.json +22658 -0
  32. package/dist/templates/platforms/vegaos/project/package.json +60 -0
  33. package/dist/templates/platforms/vegaos/project/src/App.tsx +71 -0
  34. package/dist/templates/platforms/vegaos/project/src/deviceApi/adInfo.ts +16 -0
  35. package/dist/templates/platforms/vegaos/project/src/deviceApi/deviceInfo.ts +35 -0
  36. package/dist/templates/platforms/vegaos/project/src/deviceApi/index.ts +3 -0
  37. package/dist/templates/platforms/vegaos/project/src/deviceApi/purchase.ts +61 -0
  38. package/dist/templates/platforms/vegaos/project/src/inject.ts +28 -0
  39. package/dist/templates/platforms/vegaos/project/src/messageHandler.ts +27 -0
  40. package/package.json +3 -2
  41. package/renative.engine.json +1 -0
package/README.md CHANGED
@@ -47,6 +47,7 @@ it
47
47
  | **KreaTV** | Arris | `kreatv` | `.zip` | `*.kreatv.{js,jsx,ts,tsx,json}` | set-top boxes |
48
48
  | **Saphi** | Philips | `saphi` | `.zip` | `*.saphi.tv.{js,jsx,ts,tsx,json}` | |
49
49
  | **Tizen** | Samsung | `tizen` | `.wgt` | `*.tizen.tv.{js,jsx,ts,tsx,json}` | |
50
+ | **VegaOS** | VegaOS | `vegaos` | `.zip` | `*.vegaos.tv.{js,jsx,ts,tsx,json}` | |
50
51
  | **VIDAA** | Hisense | `vidaa` | `.zip` | `*.vidaa.tv.{js,jsx,ts,tsx,json}` | |
51
52
  | **SmartCast** | VIZIO | `smartcast` | `.zip` | `*.smartcast.tv.{js,jsx,ts,tsx,json}`| |
52
53
  | **webOS** | LG | `webos` | `.ipk` | `*.webos.tv.{js,jsx,ts,tsx,json}` | |
@@ -67,6 +68,7 @@ drivers/
67
68
  index.kreatv.ts
68
69
  index.saphi.tv.ts
69
70
  index.tizen.tv.ts
71
+ index.vegaos.tv.ts
70
72
  index.vidaa.tv.ts
71
73
  index.smartcast.tv.ts
72
74
  index.webos.tv.ts
@@ -11,8 +11,12 @@ describe('resolveBuildFileExtension', () => {
11
11
  const resolvedExtension = (0, resolveBuildFileExtension_1.resolveBuildFileExtension)(constants_1.Platforms.WEBOS);
12
12
  expect(resolvedExtension).toBe('ipk');
13
13
  });
14
- it('returns "zip" for all platforms except tizen and webos', () => {
15
- const excludedPlatforms = [constants_1.Platforms.TIZEN, constants_1.Platforms.WEBOS];
14
+ it('returns "vpkg" for vegaos platform', () => {
15
+ const resolvedExtension = (0, resolveBuildFileExtension_1.resolveBuildFileExtension)(constants_1.Platforms.VEGAOS);
16
+ expect(resolvedExtension).toBe('vpkg');
17
+ });
18
+ it('returns "zip" for all platforms except tizen, webos, and vegaos', () => {
19
+ const excludedPlatforms = [constants_1.Platforms.TIZEN, constants_1.Platforms.WEBOS, constants_1.Platforms.VEGAOS];
16
20
  Object.values(constants_1.Platforms).forEach((platform) => {
17
21
  const resolvedExtension = (0, resolveBuildFileExtension_1.resolveBuildFileExtension)(platform);
18
22
  if (excludedPlatforms.includes(platform)) {
@@ -6,5 +6,6 @@ exports.SUPPORTED_PACKAGE_PLATFORMS = [
6
6
  platforms_1.Platforms.ANDROIDTV,
7
7
  platforms_1.Platforms.FIRETV,
8
8
  platforms_1.Platforms.TIZEN,
9
+ platforms_1.Platforms.VEGAOS,
9
10
  platforms_1.Platforms.WEBOS,
10
11
  ];
@@ -9,6 +9,7 @@ exports.UNSUPPORTED_PLATFORMS = UNSUPPORTED_PLATFORMS;
9
9
  const NO_CONTENT_FOLDER_PLATFORMS = [
10
10
  platforms_1.Platforms.ANDROIDTV,
11
11
  platforms_1.Platforms.FIRETV,
12
+ platforms_1.Platforms.VEGAOS,
12
13
  platforms_1.Platforms.VIDAA,
13
14
  ];
14
15
  exports.NO_CONTENT_FOLDER_PLATFORMS = NO_CONTENT_FOLDER_PLATFORMS;
@@ -9,6 +9,7 @@ const Platforms = {
9
9
  KREATV: 'kreatv',
10
10
  SAPHI: 'saphi',
11
11
  TIZEN: 'tizen',
12
+ VEGAOS: 'vegaos',
12
13
  VIDAA: 'vidaa',
13
14
  SMARTCAST: 'smartcast',
14
15
  WEBOS: 'webos',
@@ -89,6 +89,11 @@ exports.default = {
89
89
  defaultPort: 8087,
90
90
  isWebHosted: true,
91
91
  },
92
+ [constants_1.Platforms.VEGAOS]: {
93
+ extensions: generateEngineExtensions(['vegaos.tv']),
94
+ defaultPort: 8111,
95
+ isWebHosted: true,
96
+ },
92
97
  [constants_1.Platforms.VIDAA]: {
93
98
  extensions: generateEngineExtensions(['vidaa.tv']),
94
99
  defaultPort: 8099,
@@ -6,6 +6,7 @@ const resolveBuildFileExtension = (platform) => {
6
6
  switch (platform) {
7
7
  case constants_1.Platforms.TIZEN: return 'wgt';
8
8
  case constants_1.Platforms.WEBOS: return 'ipk';
9
+ case constants_1.Platforms.VEGAOS: return 'vpkg';
9
10
  default: return 'zip';
10
11
  }
11
12
  };
@@ -29,6 +29,7 @@ const beautifyPlatformName = (platformName) => {
29
29
  case constants_1.Platforms.KREATV: return 'KreaTV';
30
30
  case constants_1.Platforms.SAPHI: return 'Saphi (Philips)';
31
31
  case constants_1.Platforms.TIZEN: return 'Tizen (Samsung)';
32
+ case constants_1.Platforms.VEGAOS: return 'VegaOS';
32
33
  case constants_1.Platforms.VIDAA: return 'VIDAA (Hisense)';
33
34
  case constants_1.Platforms.SMARTCAST: return 'SmartCast (VIZIO)';
34
35
  case constants_1.Platforms.WEBOS: return 'webOS (LG)';
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.handlePlatformSdk = exports.SDKXbox = exports.SDKWebpack = exports.SDKTizen = exports.SDKWebos = exports.SDKAndroidtv = void 0;
26
+ exports.handlePlatformSdk = exports.SDKXbox = exports.SDKWebpack = exports.SDKVegaOS = exports.SDKTizen = exports.SDKWebos = exports.SDKAndroidtv = void 0;
27
27
  const constants_1 = require("../constants");
28
28
  const SDKAndroidtv = __importStar(require("./sdk-androidtv"));
29
29
  exports.SDKAndroidtv = SDKAndroidtv;
@@ -31,6 +31,8 @@ const SDKWebos = __importStar(require("./sdk-webos"));
31
31
  exports.SDKWebos = SDKWebos;
32
32
  const SDKTizen = __importStar(require("./sdk-tizen"));
33
33
  exports.SDKTizen = SDKTizen;
34
+ const SDKVegaOS = __importStar(require("./sdk-vegaos"));
35
+ exports.SDKVegaOS = SDKVegaOS;
34
36
  const SDKWebpack = __importStar(require("./sdk-webpack"));
35
37
  exports.SDKWebpack = SDKWebpack;
36
38
  const SDKXbox = __importStar(require("./sdk-xbox"));
@@ -42,6 +44,8 @@ const handlePlatformSdk = async (c) => {
42
44
  return SDKAndroidtv.handleAndroidTVSdk(c);
43
45
  case constants_1.Platforms.TIZEN:
44
46
  return SDKTizen.handleTizenSdk(c);
47
+ case constants_1.Platforms.VEGAOS:
48
+ return SDKVegaOS.handleVegaOSSdk(c);
45
49
  case constants_1.Platforms.WEBOS:
46
50
  return SDKWebos.handleWebosSdk(c);
47
51
  default:
@@ -200,6 +200,8 @@ const configureEntryUrl = (c) => {
200
200
  const entryUrl = getHostedAppEntryUrl(c);
201
201
  const bitmovinLicense = process.env.BITMOVIN_LICENSE
202
202
  || rnv_1.Common.getConfigProp(c, c.platform, 'bitmovinLicense', '');
203
+ const bitmovinAnalytics = process.env.BITMOVIN_ANALYTICS
204
+ || rnv_1.Common.getConfigProp(c, c.platform, 'bitmovinAnalytics', '');
203
205
  const npawAccountCode = process.env.NPAW_ACCOUNT_CODE
204
206
  || rnv_1.Common.getConfigProp(c, c.platform, 'npawAccountCode', '');
205
207
  const enableImaSdk = !!rnv_1.Common.getConfigProp(c, c.platform, 'enableImaSdk', false);
@@ -209,6 +211,9 @@ const configureEntryUrl = (c) => {
209
211
  }, {
210
212
  pattern: '{{BITMOVIN_LICENSE}}',
211
213
  override: bitmovinLicense,
214
+ }, {
215
+ pattern: '{{BITMOVIN_ANALYTICS}}',
216
+ override: bitmovinAnalytics,
212
217
  }, {
213
218
  pattern: '{{NPAW_ACCOUNT_CODE}}',
214
219
  override: npawAccountCode,
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./sdkVegaOS"), exports);
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.handleVegaOSSdk = exports.configureVegaOSProject = exports.buildVegaOSProject = void 0;
30
+ const fs = __importStar(require("fs"));
31
+ const path = __importStar(require("path"));
32
+ const ip_1 = __importDefault(require("ip"));
33
+ const child_process_1 = require("child_process");
34
+ const rnv_1 = require("rnv");
35
+ const sdk_webpack_1 = require("@rnv/sdk-webpack");
36
+ const resolvers_1 = require("../../resolvers");
37
+ const copyEnvironmentFolder_1 = require("../../utils/copyEnvironmentFolder");
38
+ const resolveBuildEnvType_1 = require("../../resolvers/resolveBuildEnvType");
39
+ const constants_1 = require("../../constants");
40
+ const sdk_webpack_2 = require("../sdk-webpack");
41
+ const getHostedAppUrl = (c) => {
42
+ const { platform, runtime, program } = c;
43
+ let baseUrl = '';
44
+ if (program.productionPackagesHostedUrl) {
45
+ baseUrl = (0, resolvers_1.resolveProductionPackagesBaseUrl)(c);
46
+ }
47
+ else {
48
+ baseUrl = (0, resolvers_1.resolveBaseUrl)({
49
+ platform,
50
+ scheme: runtime.scheme || '',
51
+ flavour: runtime.appId,
52
+ });
53
+ }
54
+ if (baseUrl)
55
+ return `${baseUrl}/public/index.html`;
56
+ const localIp = program.debugIp ?? ip_1.default.address();
57
+ const localPort = runtime.port ?? 8100;
58
+ return `http://${localIp}:${localPort}/`;
59
+ };
60
+ const configureAppUrl = (c) => {
61
+ rnv_1.Logger.logTask('configureAppUrl');
62
+ const appTsxPath = path.join(rnv_1.Common.getPlatformProjectDir(c), 'src', 'App.tsx');
63
+ const appUrl = getHostedAppUrl(c);
64
+ let content = fs.readFileSync(appTsxPath, 'utf8');
65
+ content = content.replace(/const APP_URL\s*=\s*['"][^'"]*['"]/, `const APP_URL =\n '${appUrl}'`);
66
+ fs.writeFileSync(appTsxPath, content);
67
+ rnv_1.Logger.logInfo(`VegaOS APP_URL set to: ${appUrl}`);
68
+ };
69
+ const configureProject = (c) => {
70
+ rnv_1.Logger.logTask('configureProject');
71
+ const projectDir = rnv_1.Common.getPlatformProjectDir(c);
72
+ const appVersion = rnv_1.Common.getAppVersion(c, c.platform) || '0.0.1';
73
+ const versionCode = rnv_1.Common.getConfigProp(c, c.platform, 'versionCode', '1');
74
+ const injects = [{
75
+ pattern: '{{APP_VERSION}}',
76
+ override: appVersion,
77
+ }, {
78
+ pattern: '{{BUILD_NUMBER}}',
79
+ override: versionCode,
80
+ }];
81
+ rnv_1.Common.addSystemInjects(c, injects);
82
+ const configFiles = ['manifest.toml', 'app.json', 'package.json'];
83
+ configFiles.forEach((configFile) => {
84
+ const filePath = path.join(projectDir, configFile);
85
+ rnv_1.FileUtils.writeCleanFile(filePath, filePath, injects, null, c);
86
+ });
87
+ };
88
+ const copyAppIcon = (c) => {
89
+ rnv_1.Logger.logTask('copyAppIcon');
90
+ const projectDir = rnv_1.Common.getPlatformProjectDir(c);
91
+ const destIconPath = path.join(projectDir, 'assets', 'image', 'app_icon.png');
92
+ const destDir = path.dirname(destIconPath);
93
+ if (!fs.existsSync(destDir)) {
94
+ fs.mkdirSync(destDir, { recursive: true });
95
+ }
96
+ const envType = (0, resolveBuildEnvType_1.resolveBuildEnvType)(c.runtime.scheme);
97
+ const envHierarchy = ['dev', 'staging', 'prod'];
98
+ const envIndex = envHierarchy.indexOf(envType);
99
+ const srcIconPath = envHierarchy
100
+ .slice(envIndex)
101
+ .map((env) => path.join(destDir, `_${env}`, 'app_icon.png'))
102
+ .find((candidate) => fs.existsSync(candidate));
103
+ if (srcIconPath) {
104
+ fs.copyFileSync(srcIconPath, destIconPath);
105
+ rnv_1.Logger.logInfo(`App icon copied from: ${srcIconPath}`);
106
+ }
107
+ else {
108
+ rnv_1.Logger.logDebug(`No environment-specific app icon found, skipping copy.`);
109
+ }
110
+ };
111
+ const installDependencies = (c) => {
112
+ rnv_1.Logger.logTask('installDependencies');
113
+ const projectDir = rnv_1.Common.getPlatformProjectDir(c);
114
+ const nodeModulesPath = path.join(projectDir, 'node_modules');
115
+ if (!fs.existsSync(nodeModulesPath)) {
116
+ rnv_1.Logger.logInfo('Installing VegaOS project dependencies...');
117
+ (0, child_process_1.execSync)('npm install', { cwd: projectDir, stdio: 'inherit' });
118
+ }
119
+ else {
120
+ rnv_1.Logger.logDebug('node_modules already present, skipping install.');
121
+ }
122
+ };
123
+ const buildVegaOSProject = async (c) => {
124
+ rnv_1.Logger.logTask('buildVegaOSProject');
125
+ await (0, sdk_webpack_2.buildCoreWebpackProject)(c);
126
+ const projectDir = rnv_1.Common.getPlatformProjectDir(c);
127
+ const projectParentDir = path.join(projectDir, '..');
128
+ const outputDir = path.join(projectParentDir, 'output');
129
+ const buildType = c.runtime.scheme === constants_1.BuildSchemes.DEBUG ? 'Debug' : 'Release';
130
+ const appVersion = rnv_1.Common.getAppVersion(c, c.platform) || '0.0.1';
131
+ const versionCode = rnv_1.Common.getConfigProp(c, c.platform, 'versionCode', '1');
132
+ try {
133
+ const watchListOutput = (0, child_process_1.execSync)('watchman watch-list', { stdio: 'pipe' }).toString();
134
+ const watchList = JSON.parse(watchListOutput);
135
+ const parentWatches = (watchList.roots || []).filter((root) => projectDir.startsWith(root) && root !== projectDir);
136
+ for (const parentWatch of parentWatches) {
137
+ (0, child_process_1.execSync)(`watchman watch-del '${parentWatch}'`, { stdio: 'pipe' });
138
+ }
139
+ }
140
+ catch {
141
+ }
142
+ rnv_1.Logger.logInfo(`Building VegaOS project (${buildType})...`);
143
+ const buildCmd = `npx react-native build-vega --build-type ${buildType} --build-version ${appVersion} --build-number ${versionCode}`;
144
+ (0, child_process_1.execSync)(buildCmd, { cwd: projectDir, stdio: 'inherit' });
145
+ if (!fs.existsSync(outputDir)) {
146
+ fs.mkdirSync(outputDir, { recursive: true });
147
+ }
148
+ const buildDir = path.join(projectDir, 'build');
149
+ let armv7VpkgFile;
150
+ const findArmv7Vpkg = (dir) => {
151
+ if (!fs.existsSync(dir))
152
+ return;
153
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
154
+ for (const entry of entries) {
155
+ const fullPath = path.join(dir, entry.name);
156
+ if (entry.isDirectory()) {
157
+ findArmv7Vpkg(fullPath);
158
+ }
159
+ else if (entry.name.endsWith('.vpkg') && fullPath.includes('armv7')) {
160
+ armv7VpkgFile = fullPath;
161
+ }
162
+ }
163
+ };
164
+ findArmv7Vpkg(buildDir);
165
+ if (armv7VpkgFile) {
166
+ const destPath = path.join(outputDir, `${(0, resolvers_1.resolveBuildFileBaseName)(c)}.vpkg`);
167
+ fs.copyFileSync(armv7VpkgFile, destPath);
168
+ rnv_1.Logger.logSuccess(`Your VegaOS .vpkg package is located in ${rnv_1.Logger.chalk().cyan(outputDir)}.`);
169
+ }
170
+ else {
171
+ rnv_1.Logger.logWarning('No armv7 .vpkg file found in build output.');
172
+ }
173
+ };
174
+ exports.buildVegaOSProject = buildVegaOSProject;
175
+ const configureVegaOSProject = async (c) => {
176
+ rnv_1.Logger.logTask('configureVegaOSProject');
177
+ c.runtime.platformBuildsProjectPath = rnv_1.Common.getPlatformProjectDir(c);
178
+ const platform = constants_1.Platforms.VEGAOS;
179
+ await rnv_1.ProjectManager.copyAssetsFolder(c, platform, 'assets/image');
180
+ (0, copyEnvironmentFolder_1.copyEnvFolderInProject)(c);
181
+ copyAppIcon(c);
182
+ await (0, sdk_webpack_1.configureCoreWebProject)(c);
183
+ configureProject(c);
184
+ configureAppUrl(c);
185
+ await rnv_1.ProjectManager.copyBuildsFolder(c, platform);
186
+ (0, copyEnvironmentFolder_1.copyEnvFolderInPublicConfig)(c);
187
+ installDependencies(c);
188
+ };
189
+ exports.configureVegaOSProject = configureVegaOSProject;
190
+ const handleVegaOSSdk = async (_c) => {
191
+ rnv_1.Logger.logTask('handleVegaOSSdk');
192
+ try {
193
+ (0, child_process_1.execSync)('kepler --version', { stdio: 'pipe' });
194
+ rnv_1.Logger.logInfo('Kepler CLI is available.');
195
+ }
196
+ catch {
197
+ throw new Error('Kepler CLI not found. Please install the Kepler SDK before building VegaOS projects.\n'
198
+ + 'See: https://developer.amazon.com/docs/vega/0.21/install-vega-sdk.html');
199
+ }
200
+ };
201
+ exports.handleVegaOSSdk = handleVegaOSSdk;
@@ -96,6 +96,9 @@ const buildFn = async (c, parentTask, originTask) => {
96
96
  await sdks_1.SDKTizen.buildTizenProject(c);
97
97
  renameOutput(c);
98
98
  break;
99
+ case constants_1.Platforms.VEGAOS:
100
+ await sdks_1.SDKVegaOS.buildVegaOSProject(c);
101
+ break;
99
102
  case constants_1.Platforms.WEBOS:
100
103
  await sdks_1.SDKWebos.buildWebOSProject(c);
101
104
  renameOutput(c);
@@ -27,6 +27,9 @@ const configureFn = async (c, parentTask, originTask) => {
27
27
  case constants_1.Platforms.TIZEN:
28
28
  await sdks_1.SDKTizen.configureTizenProject(c);
29
29
  break;
30
+ case constants_1.Platforms.VEGAOS:
31
+ await sdks_1.SDKVegaOS.configureVegaOSProject(c);
32
+ break;
30
33
  case constants_1.Platforms.WEBOS:
31
34
  await sdks_1.SDKWebos.configureWebOSProject(c);
32
35
  break;
@@ -33,6 +33,7 @@ const deployFn = async (c, parentTask, originTask) => {
33
33
  case constants_1.Platforms.SAPHI:
34
34
  case constants_1.Platforms.SMARTCAST:
35
35
  case constants_1.Platforms.TIZEN:
36
+ case constants_1.Platforms.VEGAOS:
36
37
  case constants_1.Platforms.VIDAA:
37
38
  case constants_1.Platforms.WEBOS:
38
39
  case constants_1.Platforms.WEBTV:
@@ -24,6 +24,7 @@ const startFn = async (c, parentTask, originTask) => {
24
24
  case constants_1.Platforms.KREATV:
25
25
  case constants_1.Platforms.SAPHI:
26
26
  case constants_1.Platforms.TIZEN:
27
+ case constants_1.Platforms.VEGAOS:
27
28
  case constants_1.Platforms.VIDAA:
28
29
  case constants_1.Platforms.SMARTCAST:
29
30
  case constants_1.Platforms.WEBOS:
@@ -7,12 +7,13 @@ plugins {
7
7
  }
8
8
 
9
9
  def bitmovinLicense = '{{BITMOVIN_LICENSE}}'
10
+ def bitmovinAnalytics = '{{BITMOVIN_ANALYTICS}}'
10
11
  def useBitmovin = bitmovinLicense != ''
11
12
  def npawAccountCode = '{{NPAW_ACCOUNT_CODE}}'
12
13
  def useNpawPlugin = npawAccountCode != ''
13
14
  def useImaSdk = {{ENABLE_IMA_SDK}}
14
15
 
15
- def player_version = '0.8.0-alpha.41'
16
+ def player_version = '0.8.0-alpha.43'
16
17
 
17
18
  android {
18
19
  namespace = 'com.twentyfouri.tvbridge'
@@ -42,6 +43,7 @@ android {
42
43
 
43
44
  buildConfigField "String", "APP_URL", '"{{APP_URL}}"'
44
45
  buildConfigField "String", "BITMOVIN_LICENSE", "\"$bitmovinLicense\""
46
+ buildConfigField "String", "BITMOVIN_ANALYTICS", "\"$bitmovinAnalytics\""
45
47
  buildConfigField "String", "NPAW_ACCOUNT_CODE", "\"$npawAccountCode\""
46
48
  buildConfigField "Boolean", "startWithHighVideoQuality", "true"
47
49
  }
@@ -14,5 +14,6 @@ class BridgeConfig {
14
14
  var customizableUrl: Boolean = BuildConfig.DEBUG
15
15
  var startWithHighVideoQuality: Boolean = false
16
16
  var bitmovinLicense: String = BuildConfig.BITMOVIN_LICENSE
17
+ var bitmovinAnalytics: String = BuildConfig.BITMOVIN_ANALYTICS
17
18
  var npawAccount: String = BuildConfig.NPAW_ACCOUNT_CODE
18
19
  }
@@ -2,6 +2,7 @@ package com.twentyfouri.tvbridge.global.utils
2
2
 
3
3
  import android.app.Application
4
4
  import com.twentyfouri.player.bitmovin.NpawConfig
5
+ import com.twentyfouri.player.bitmovin.PlayerBitmovin
5
6
  import com.twentyfouri.player.bitmovin.PlayerFactoryBitmovin
6
7
  import com.twentyfouri.tvbridge.configuration.BridgeConfig
7
8
 
@@ -12,6 +13,7 @@ class PlayerFactoryBitmovinCustomized(config: BridgeConfig, application: Applica
12
13
  NpawConfig(config.npawAccount, application)
13
14
  } else {
14
15
  null
15
- }
16
+ },
17
+ config.bitmovinAnalytics.ifEmpty { PlayerBitmovin.ANALYTICS_LICENSE_DEFERRED }
16
18
  ),
17
19
  PlayerFactoryVersion
@@ -14,6 +14,7 @@ object MediaEventType {
14
14
  const val LOADEDMETADATA = "loadedmetadata"
15
15
  const val LOADEDDATA = "loadeddata"
16
16
  const val WAITING = "waiting"
17
+ const val DURATION_CHANGE = "durationchange"
17
18
  const val SEEKING = "seeking"
18
19
  const val SEEKED = "seeked"
19
20
  const val KEY_PRESS = "keypress"
@@ -29,6 +29,7 @@ import com.twentyfouri.player.base.AudioTrack
29
29
  import com.twentyfouri.player.base.CanPlayEvent
30
30
  import com.twentyfouri.player.base.ChangeAudioTrackEvent
31
31
  import com.twentyfouri.player.base.ChangeTextTrackEvent
32
+ import com.twentyfouri.player.base.DurationChangeEvent
32
33
  import com.twentyfouri.player.base.EndedEvent
33
34
  import com.twentyfouri.player.base.ErrorEvent
34
35
  import com.twentyfouri.player.base.Event
@@ -46,6 +47,7 @@ import com.twentyfouri.player.base.SeekingEvent
46
47
  import com.twentyfouri.player.base.Source
47
48
  import com.twentyfouri.player.base.SourceDrmPlayready
48
49
  import com.twentyfouri.player.base.SourceDrmWidevine
50
+ import com.twentyfouri.player.base.SourceImaAds
49
51
  import com.twentyfouri.player.base.TextTrack
50
52
  import com.twentyfouri.player.base.TimeUpdateEvent
51
53
  import com.twentyfouri.player.base.TrackKind
@@ -178,6 +180,11 @@ class WebViewModel @Inject constructor(
178
180
 
179
181
  private fun logSource(source: Source) {
180
182
  Log.i("BridgeVideo", "Url: ${source.url}")
183
+ when (val ads = source.ads) {
184
+ is SourceImaAds -> {
185
+ Log.i("BridgeVideo", "Ads: ${ads.url}")
186
+ }
187
+ }
181
188
  when (val drmModel = source.drm.firstOrNull()) {
182
189
  is SourceDrmWidevine -> {
183
190
  Log.i("BridgeVideo", "DRM: " + drmModel.packageName)
@@ -366,6 +373,10 @@ class WebViewModel @Inject constructor(
366
373
  jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.PLAYING)
367
374
  }
368
375
 
376
+ is DurationChangeEvent -> {
377
+ jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.DURATION_CHANGE)
378
+ }
379
+
369
380
  is SeekingEvent -> {
370
381
  jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.SEEKING)
371
382
  }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": [
3
+ "@react-native",
4
+ "eslint:recommended"
5
+ ],
6
+ "plugins": ["@typescript-eslint"],
7
+ "parserOptions": {
8
+ "project": "./tsconfig.json"
9
+ },
10
+ "parser": "@typescript-eslint/parser"
11
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "bracketSameLine": true,
3
+ "bracketSpacing": false,
4
+ "singleQuote": true,
5
+ "trailingComma": "all",
6
+ "tabWidth": 2
7
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "//": "The declared app name must follow this pattern to be KRL-compatible",
3
+ "name": "{{configProps.id}}.main",
4
+ "displayName": "{{configProps.appName}}"
5
+ }
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ presets: ['module:metro-react-native-babel-preset'],
3
+ };
@@ -0,0 +1,9 @@
1
+ import { AppRegistry, LogBox } from 'react-native';
2
+ import { App } from './src/App';
3
+ import { name as appName } from './app.json';
4
+
5
+ // Temporary workaround for problem with nested text
6
+ // not working currently.
7
+ LogBox.ignoreAllLogs();
8
+
9
+ AppRegistry.registerComponent(appName, () => App);
@@ -0,0 +1,36 @@
1
+ {
2
+ "preset": "react-native",
3
+ "transform": {
4
+ "^.+\\.tsx?$": "ts-jest"
5
+ },
6
+ "setupFiles": ["./node_modules/@amazon-devices/react-native-kepler/jest/setup.js"],
7
+ "testRegex": "/test/.*\\.(test|spec)\\.(ts|tsx|js)$",
8
+ "moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
9
+ "moduleNameMapper": {
10
+ "^~/(.*)$": "<rootDir>/src/$1"
11
+ },
12
+ "modulePaths": ["<rootDir>/src"],
13
+ "roots": [
14
+ "<rootDir>/src/",
15
+ "<rootDir>/test/",
16
+ "<rootDir>/node_modules/"
17
+ ],
18
+ "collectCoverage": false,
19
+ "coverageReporters": ["json", "json-summary", "lcov", "text"],
20
+ "collectCoverageFrom": [
21
+ "src/**/*",
22
+ "!**/index.{ts,js,tsx}",
23
+ "!**/types.ts",
24
+ "!src/**/*.d.ts"
25
+ ],
26
+ "transformIgnorePatterns": [
27
+ "node_modules/(?![\\w\\-_]+)/node_modules/(?!react-native|@react-native)/"
28
+ ],
29
+ "coverageDirectory": ".tmp/coverage",
30
+ "globals": {
31
+ "ts-jest": {
32
+ "babelConfig": true,
33
+ "diagnostics": true
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,69 @@
1
+ schema-version = 1
2
+
3
+ [package]
4
+ title = "{{configProps.appName}}"
5
+ version = "{{APP_VERSION}}"
6
+ buildNumber = "{{BUILD_NUMBER}}"
7
+ id = "{{configProps.id}}"
8
+ icon = "@image/app_icon.png"
9
+
10
+ [components]
11
+ [[components.interactive]]
12
+ id = "{{configProps.id}}.main"
13
+ runtime-module = "/com.amazon.kepler.keplerscript.runtime.loader_2@IKeplerScript_2_0"
14
+ launch-type = "singleton"
15
+ categories = ["com.amazon.category.main"]
16
+
17
+ [wants]
18
+
19
+ [[wants.service]]
20
+ id = "com.amazon.webview.renderer_service"
21
+
22
+ [[wants.service]]
23
+ id = "com.amazon.media.server"
24
+
25
+ [[wants.service]]
26
+ id = "com.amazon.audio.stream"
27
+
28
+ [[wants.service]]
29
+ id = "com.amazon.mediametrics.service"
30
+
31
+ [[wants.service]]
32
+ id = "com.amazon.gipc.uuid.*"
33
+
34
+ [[wants.service]]
35
+ id = "com.amazon.media.playersession.service"
36
+
37
+ [[wants.privilege]]
38
+ id = "com.amazon.devconf.privilege.accessibility"
39
+
40
+ [[wants.service]]
41
+ id = "com.amazon.mediabuffer.service"
42
+
43
+ [[wants.service]]
44
+ id = "com.amazon.mediatransform.service"
45
+
46
+ [[wants.service]]
47
+ id = "com.amazon.audio.control"
48
+
49
+ [[wants.service]]
50
+ id = "com.amazon.audio.system"
51
+
52
+ [[wants.service]]
53
+ id = "com.amazon.admanager.service.main"
54
+
55
+ [[wants.service]]
56
+ id = "com.amazon.iap.core.service"
57
+
58
+ [[wants.module]]
59
+ id = "/com.amazon.iap.core@IIAPCoreUI"
60
+
61
+ [needs]
62
+
63
+ [[needs.module]]
64
+ id = "/com.amazon.kepler.appstore.iap.purchase.core@IAppstoreIAPPurchaseCoreService"
65
+
66
+ [offers]
67
+
68
+ [[offers.service]]
69
+ id = "com.amazon.gipc.uuid.*"