@24i/smartapps-bigscreen-rnv-build-engine 0.17.25 → 0.17.26-alpha-2756-test

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProductionZipFileRelativePath = exports.resolveZippedPlatformBuildsRelativeFilePath = exports.resolvePackageVersions = exports.resolveBuildFileExtension = exports.resolveUsedFlavours = exports.resolveSupportedFlavoursForPlatform = exports.resolveSupportedPlatforms = exports.getBaseConfig = exports.resolveBuildFileName = exports.resolveBuildFileBaseName = exports.resolveHbbtvDeployConfig = exports.resolveHbbtvDeployUrl = exports.resolveHbbtvRemoteBuildDirRelativePath = exports.resolveDeployLocations = exports.resolveBuildVersionOffset = exports.resolveBuildVersion = exports.resolveBuildEnvName = exports.resolveS3BucketAppPath = exports.resolveProductionPackagesBaseUrl = exports.resolveBaseUrl = void 0;
3
+ exports.getZippedDirRelativePath = exports.getProductionZipFileRelativePath = exports.resolveZippedPlatformBuildsRelativeFilePath = exports.resolvePackageVersions = exports.resolveBuildFileExtension = exports.resolveUsedFlavours = exports.resolveSupportedFlavoursForPlatform = exports.resolveSupportedPlatforms = exports.getBaseConfig = exports.resolveBuildFileName = exports.resolveBuildFileBaseName = exports.resolveHbbtvDeployConfig = exports.resolveHbbtvDeployUrl = exports.resolveHbbtvRemoteBuildDirRelativePath = exports.resolveDeployLocations = exports.resolveBuildVersionOffset = exports.resolveBuildVersion = exports.resolveBuildEnvName = exports.resolveS3BucketAppPath = exports.resolveProductionPackagesBaseUrl = exports.resolveBaseUrl = void 0;
4
4
  var resolveBaseUrl_1 = require("./resolveBaseUrl");
5
5
  Object.defineProperty(exports, "resolveBaseUrl", { enumerable: true, get: function () { return resolveBaseUrl_1.resolveBaseUrl; } });
6
6
  Object.defineProperty(exports, "resolveProductionPackagesBaseUrl", { enumerable: true, get: function () { return resolveBaseUrl_1.resolveProductionPackagesBaseUrl; } });
@@ -40,3 +40,5 @@ var resolveZippedPlatformBuildsRelativeFilePath_1 = require("./resolveZippedPlat
40
40
  Object.defineProperty(exports, "resolveZippedPlatformBuildsRelativeFilePath", { enumerable: true, get: function () { return resolveZippedPlatformBuildsRelativeFilePath_1.resolveZippedPlatformBuildsRelativeFilePath; } });
41
41
  var resolveProductionZipFileRelativePath_1 = require("./resolveProductionZipFileRelativePath");
42
42
  Object.defineProperty(exports, "getProductionZipFileRelativePath", { enumerable: true, get: function () { return resolveProductionZipFileRelativePath_1.getProductionZipFileRelativePath; } });
43
+ var resolveZippedDirRelativePath_1 = require("./resolveZippedDirRelativePath");
44
+ Object.defineProperty(exports, "getZippedDirRelativePath", { enumerable: true, get: function () { return resolveZippedDirRelativePath_1.getZippedDirRelativePath; } });
@@ -0,0 +1,32 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.getZippedDirRelativePath = void 0;
27
+ const path = __importStar(require("path"));
28
+ const getZippedDirRelativePath = (c) => {
29
+ const { platformBuildsDir } = c.buildConfig.paths;
30
+ return path.join(platformBuildsDir, 'zipped_production_packages');
31
+ };
32
+ exports.getZippedDirRelativePath = getZippedDirRelativePath;
@@ -30,6 +30,11 @@ const fse = __importStar(require("fs-extra"));
30
30
  const getSafeSchemeString_1 = require("../utils/getSafeSchemeString");
31
31
  const resolvers_1 = require("../resolvers");
32
32
  const getArgs_1 = require("./utils/getArgs");
33
+ const convertToArray = (value) => {
34
+ if (!Array.isArray(value))
35
+ return [value];
36
+ return value || [];
37
+ };
33
38
  const getProgressMessage = ({ schemes, schemeIndex, platforms, platformIndex, flavours, flavourIndex, }) => {
34
39
  let string = '\nProcessing';
35
40
  string += ` "${platforms[platformIndex]}" platform`;
@@ -69,12 +74,12 @@ const buildAllWithSchemes = () => {
69
74
  if (include || exclude) {
70
75
  supportedPlatforms = supportedPlatforms.filter((platform) => {
71
76
  if (include)
72
- return include.includes(platform);
73
- return !exclude.includes(platform);
77
+ return convertToArray(include).includes(platform);
78
+ return !convertToArray(exclude).includes(platform);
74
79
  });
75
80
  }
76
81
  supportedPlatforms.forEach((platform, platformIndex, platforms) => {
77
- buildSchemes.forEach((scheme, schemeIndex, schemes) => {
82
+ convertToArray(buildSchemes).forEach((scheme, schemeIndex, schemes) => {
78
83
  c.runtime.scheme = scheme;
79
84
  const supportedFlavours = (0, resolvers_1.resolveSupportedFlavoursForPlatform)(c, platform);
80
85
  supportedFlavours.forEach((flavour, flavourIndex, flavours) => {
@@ -32,10 +32,6 @@ const constants_1 = require("../constants");
32
32
  const buildProductionPackages_1 = require("../constants/buildProductionPackages");
33
33
  const resolvers_1 = require("../resolvers");
34
34
  const getArgs_1 = require("./utils/getArgs");
35
- const getZippedDirRelativePath = (c) => {
36
- const { platformBuildsDir } = c.buildConfig.paths;
37
- return path.join(platformBuildsDir, 'zipped_production_packages');
38
- };
39
35
  const buildProductionTask = (options, c) => {
40
36
  const { scheme, platform, flavour } = options;
41
37
  const { platformBuildsDir } = c.buildConfig.paths;
@@ -45,20 +41,20 @@ const buildProductionTask = (options, c) => {
45
41
  fs.rmSync(buildDirPath, { recursive: true, force: true });
46
42
  const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci --mono --productionPackagesHostedUrl`;
47
43
  (0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
48
- const zippedDir = path.join(getZippedDirRelativePath(c), platform);
44
+ const zippedDir = path.join((0, resolvers_1.getZippedDirRelativePath)(c), platform);
49
45
  fse.copySync(buildOutputDirPath, zippedDir);
50
46
  };
51
47
  const buildProductionPackagesAll = () => {
52
48
  console.log('buildProductionPackagesAll');
53
- const { schemes, include, exclude } = (0, getArgs_1.getArgs)();
54
- if (!schemes.length) {
49
+ const { scheme, include, exclude } = (0, getArgs_1.getArgs)();
50
+ if (!scheme) {
55
51
  throw new Error('Missing scheme parameter');
56
52
  }
57
- if (schemes[0] !== constants_1.BuildSchemes.RELEASE_PROD_DIST) {
53
+ if (scheme !== constants_1.BuildSchemes.RELEASE_PROD_DIST) {
58
54
  throw new Error(`Supported only "${constants_1.BuildSchemes.RELEASE_PROD_DIST}" scheme`);
59
55
  }
60
56
  const c = (0, resolvers_1.getBaseConfig)();
61
- c.runtime.scheme = schemes[0];
57
+ c.runtime.scheme = scheme;
62
58
  const platforms = (0, resolvers_1.resolveSupportedPlatforms)(c);
63
59
  const skipPlatforms = platforms.filter((platform) => {
64
60
  if (!buildProductionPackages_1.SUPPORTED_PACKAGE_PLATFORMS.includes(platform)) {
@@ -72,11 +68,6 @@ const buildProductionPackagesAll = () => {
72
68
  return false;
73
69
  });
74
70
  (0, forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour)(c, (options) => buildProductionTask(options, c), { ignoredPlatforms: skipPlatforms });
75
- const zippedDirPath = path.resolve(getZippedDirRelativePath(c));
76
- const zipFilePath = path.resolve((0, resolvers_1.getProductionZipFileRelativePath)(c));
77
- fs.rmSync(zipFilePath, { force: true });
78
- (0, child_process_1.execSync)(`zip -r ${zipFilePath} *`, { cwd: `${zippedDirPath}` });
79
- fs.rmSync(zippedDirPath, { recursive: true, force: true });
80
71
  return true;
81
72
  };
82
73
  const startTimestamp = Date.now();
@@ -0,0 +1,49 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.deployProductionPackages = void 0;
27
+ const path = __importStar(require("path"));
28
+ const fs = __importStar(require("fs"));
29
+ const resolvers_1 = require("../../resolvers");
30
+ const aws = __importStar(require("../../tasks/deploy/aswS3/aws"));
31
+ const formatDateTime = (date) => {
32
+ const year = date.getFullYear();
33
+ const month = String(date.getMonth() + 1).padStart(2, '0');
34
+ const day = String(date.getDate()).padStart(2, '0');
35
+ const h = String(date.getHours()).padStart(2, '0');
36
+ const m = String(date.getMinutes()).padStart(2, '0');
37
+ const s = String(date.getSeconds()).padStart(2, '0');
38
+ return `${year}-${month}-${day}T${h}-${m}-${s}`;
39
+ };
40
+ const deployProductionPackages = (c) => {
41
+ const originalZipPath = (0, resolvers_1.getProductionZipFileRelativePath)(c);
42
+ const { dir, name: fileName } = path.parse(originalZipPath);
43
+ const zipPath = path.join(dir, `${fileName}_${formatDateTime(new Date())}.zip`);
44
+ fs.renameSync(originalZipPath, zipPath);
45
+ const bucketName = c.buildConfig?.common.deploy?.aws3?.bucketName || '';
46
+ const destinationPath = `${bucketName}/production_builds`;
47
+ aws.cpRemote(zipPath, destinationPath);
48
+ };
49
+ exports.deployProductionPackages = deployProductionPackages;
@@ -5,7 +5,6 @@ const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlat
5
5
  const resolvers_1 = require("../resolvers");
6
6
  const zipStagingProdBuildsByPlatforms_1 = require("../utils/zipStagingProdBuildsByPlatforms");
7
7
  const deleteSourceMaps_1 = require("./release/deleteSourceMaps");
8
- const deployToAppCenter_1 = require("./release/appCenter/deployToAppCenter");
9
8
  const githubRelease_1 = require("./release/githubRelease");
10
9
  const notifySlack_1 = require("./release/notifySlack/notifySlack");
11
10
  const sentryRelease_1 = require("./release/sentryRelease");
@@ -62,11 +61,10 @@ const doDistributionRelease = (c, schemes) => {
62
61
  if (prodScheme) {
63
62
  c.runtime.scheme = prodScheme.type;
64
63
  (0, zipStagingProdBuildsByPlatforms_1.zipStagingProdBuildsByPlatforms)(c, [stagingScheme?.type, prodScheme.type]);
65
- deployBuilds(c);
66
64
  (0, sentryRelease_1.sentryRelease)(c);
67
65
  (0, deleteSourceMaps_1.deleteSourceMaps)(c);
66
+ deployBuilds(c);
68
67
  (0, githubRelease_1.githubRelease)(c);
69
- (0, deployToAppCenter_1.deployToAppCenter)(c);
70
68
  }
71
69
  const schemeArr = schemes.map((scheme) => scheme?.type).filter(Boolean);
72
70
  (0, notifySlack_1.notifySlack)(c, schemeArr);
@@ -1,10 +1,41 @@
1
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
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_1 = require("../resolvers/index");
4
- const deployProductionPackagesToAppCenter_1 = require("./release/appCenter/deployProductionPackagesToAppCenter");
26
+ const child_process_1 = require("child_process");
27
+ const fs = __importStar(require("fs"));
28
+ const path = __importStar(require("path"));
29
+ const deployProductionPackages_1 = require("./release/deployProductionPackages");
30
+ const resolvers_1 = require("../resolvers");
5
31
  const releaseProductionPackagesAll = () => {
6
- const c = (0, index_1.getBaseConfig)();
7
- (0, deployProductionPackagesToAppCenter_1.deployProductionPackagesToAppCenter)(c);
32
+ const c = (0, resolvers_1.getBaseConfig)();
33
+ const zippedDirPath = path.resolve((0, resolvers_1.getZippedDirRelativePath)(c));
34
+ const zipFilePath = path.resolve((0, resolvers_1.getProductionZipFileRelativePath)(c));
35
+ fs.rmSync(zipFilePath, { force: true });
36
+ (0, child_process_1.execSync)(`zip -r ${zipFilePath} *`, { cwd: `${zippedDirPath}` });
37
+ fs.rmSync(zippedDirPath, { recursive: true, force: true });
38
+ (0, deployProductionPackages_1.deployProductionPackages)(c);
8
39
  };
9
40
  const startTimestamp = Date.now();
10
41
  releaseProductionPackagesAll();
@@ -142,8 +142,10 @@ function generateConfig(config) {
142
142
  },
143
143
  }),
144
144
  webpack: new webpack_1.default.DefinePlugin({
145
+ WEBPACK_INJECTION_APP_ID: JSON.stringify(buildConfig.platforms[PLATFORM].id || buildConfig.common.id || ''),
145
146
  WEBPACK_INJECTION_APP_NAME: JSON.stringify(buildConfig.common.appName || ''),
146
147
  WEBPACK_INJECTION_APP_TITLE: JSON.stringify(buildConfig.common.title || ''),
148
+ WEBPACK_INJECTION_APP_STORE_URL: JSON.stringify(buildConfig.platforms[PLATFORM].storeUrl || ''),
147
149
  WEBPACK_INJECTION_APP_CONFIG_ID: JSON.stringify(config.appConfigId || ''),
148
150
  WEBPACK_INJECTION_APP_CREATED: JSON.stringify(new Date().toISOString()),
149
151
  WEBPACK_INJECTION_APP_SCHEME: JSON.stringify(config.scheme || ''),
@@ -237,7 +239,7 @@ function generateConfig(config) {
237
239
  output: {
238
240
  environment: outputEnvironment,
239
241
  filename: 'content/js/[name].js',
240
- publicPath: isBuildHosted ? `${baseUrl}/public` : '',
242
+ publicPath: isBuildHosted ? `${baseUrl}/public/` : '',
241
243
  path: appBuildEngineProjectPublicDir,
242
244
  },
243
245
  Plugins: plugins,
@@ -104,13 +104,13 @@ dependencies {
104
104
  implementation "com.squareup.okhttp3:logging-interceptor:4.9.2"
105
105
  implementation "com.squareup.okhttp3:okhttp:4.9.2"
106
106
  if (useTheoPlayer) {
107
- compileOnly "com.twentyfouri.player:exoplayer:0.7.1-alpha.1"
108
- implementation "com.twentyfouri.player:theoplayer:0.7.1-alpha.1"
109
- implementation "com.theoplayer.theoplayer-sdk-android:core:7.8.0"
107
+ compileOnly "com.twentyfouri.player:exoplayer:0.8.0-alpha.8"
108
+ implementation "com.twentyfouri.player:theoplayer:0.8.0-alpha.8"
109
+ implementation "com.theoplayer.theoplayer-sdk-android:core:8.2.0"
110
110
  } else {
111
- implementation "com.twentyfouri.player:exoplayer:0.7.1-alpha.1"
112
- compileOnly "com.twentyfouri.player:theoplayer:0.7.1-alpha.1"
113
- compileOnly "com.theoplayer.theoplayer-sdk-android:core:7.8.0"
111
+ implementation "com.twentyfouri.player:exoplayer:0.8.0-alpha.8"
112
+ compileOnly "com.twentyfouri.player:theoplayer:0.8.0-alpha.8"
113
+ compileOnly "com.theoplayer.theoplayer-sdk-android:core:8.2.0"
114
114
  }
115
115
 
116
116
  if (useNpawPlugin) {
@@ -300,13 +300,18 @@ class BridgeFromJavaScript(
300
300
  }
301
301
 
302
302
  /***
303
- * Bridget JS 2 Android to get the device information
303
+ * Bridge JS 2 Android to get the device information
304
304
  */
305
305
  @JavascriptInterface
306
306
  fun bridgeJavaScriptToAndroid_GetDeviceInfo(): String? = runBlocking("bridgeJavaScriptToAndroid_GetDeviceInfo") {
307
307
  viewModel.detectDeviceInfo().toString()
308
308
  }
309
309
 
310
+ @JavascriptInterface
311
+ fun bridgeJavaScriptToAndroid_GetMediaInfo(): String? = runBlocking("bridgeJavaScriptToAndroid_GetMediaInfo") {
312
+ viewModel.detectMediaInfo()?.toString()
313
+ }
314
+
310
315
  @JavascriptInterface
311
316
  fun bridgeJavaScriptToAndroid_SetPlaybackInfo(playbackInfo: String) = launch {
312
317
  Log.d(LOG_TAG, "bridgeJavaScriptToAndroid_SetPlaybackInfo($playbackInfo)")
@@ -8,7 +8,7 @@ import com.google.android.exoplayer2.drm.DrmSessionManager
8
8
  import com.google.android.exoplayer2.drm.FrameworkMediaDrm
9
9
  import com.google.android.exoplayer2.drm.MediaDrmCallback
10
10
  import com.google.android.exoplayer2.upstream.HttpDataSource
11
- import com.google.android.exoplayer2.util.Util
11
+ import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy
12
12
  import com.twentyfouri.player.base.DrmPlayready
13
13
  import com.twentyfouri.player.base.DrmWidevine
14
14
  import com.twentyfouri.player.base.Source
@@ -29,7 +29,9 @@ class PlayerFactoryExoPlayerCustomized(
29
29
 
30
30
  private inner class CustomizedSharedComponents(context: Context) : DefaultSharedComponents(context) {
31
31
 
32
- override val drmProvider: DrmSessionManagerProvider by lazy { CustomizedDrmSessionManagerProvider() }
32
+ override val drmProvider: DrmSessionManagerProvider by lazy {
33
+ CustomizedDrmSessionManagerProvider(loadErrorHandlingPolicy)
34
+ }
33
35
 
34
36
  override val applicationName: String
35
37
  get() = config.playerAppName ?: super.applicationName
@@ -50,7 +52,9 @@ class PlayerFactoryExoPlayerCustomized(
50
52
  get() = false
51
53
  }
52
54
 
53
- private class CustomizedDrmSessionManagerProvider : DefaultDrmSessionManagerProvider() {
55
+ private class CustomizedDrmSessionManagerProvider(
56
+ loadErrorHandlingPolicy: LoadErrorHandlingPolicy
57
+ ) : DefaultDrmSessionManagerProvider(loadErrorHandlingPolicy) {
54
58
  override fun buildDrmSessionManager(
55
59
  dataSourceFactory: AuthorizedDataSourceProvider,
56
60
  source: Source,
@@ -85,6 +89,7 @@ class PlayerFactoryExoPlayerCustomized(
85
89
  return DefaultDrmSessionManager.Builder()
86
90
  .setUuidAndExoMediaDrmProvider(drmUuid, FrameworkMediaDrm.DEFAULT_PROVIDER)
87
91
  .setMultiSession(false)
92
+ .setLoadErrorHandlingPolicy(loadErrorHandlingPolicy)
88
93
  .build(drmCallback)
89
94
  }
90
95
 
@@ -36,6 +36,7 @@ import com.google.android.exoplayer2.ui.AdViewProvider
36
36
  import com.google.android.exoplayer2.ui.AspectRatioFrameLayout
37
37
  import com.google.android.exoplayer2.ui.SubtitleView
38
38
  import com.google.android.exoplayer2.upstream.HttpDataSource
39
+ import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy
39
40
  import com.google.android.exoplayer2.upstream.cache.CacheDataSource
40
41
  import com.google.android.exoplayer2.video.VideoSize
41
42
  import com.npaw.NpawPlugin
@@ -127,7 +128,9 @@ class PlayerFactoryExoPlayerNpaw(
127
128
  npawPlugin.destroy()
128
129
  }
129
130
 
130
- override val drmProvider: DrmSessionManagerProvider by lazy { CustomizedDrmSessionManagerProvider() }
131
+ override val drmProvider: DrmSessionManagerProvider by lazy {
132
+ CustomizedDrmSessionManagerProvider(loadErrorHandlingPolicy)
133
+ }
131
134
 
132
135
  override val applicationName: String
133
136
  get() = config.playerAppName ?: super.applicationName
@@ -162,7 +165,9 @@ class PlayerFactoryExoPlayerNpaw(
162
165
  get() = false
163
166
  }
164
167
 
165
- private class CustomizedDrmSessionManagerProvider : DefaultDrmSessionManagerProvider() {
168
+ private class CustomizedDrmSessionManagerProvider(
169
+ loadErrorHandlingPolicy: LoadErrorHandlingPolicy
170
+ ) : DefaultDrmSessionManagerProvider(loadErrorHandlingPolicy) {
166
171
  override fun buildDrmSessionManager(
167
172
  dataSourceFactory: AuthorizedDataSourceProvider,
168
173
  source: Source,
@@ -197,6 +202,7 @@ class PlayerFactoryExoPlayerNpaw(
197
202
  return DefaultDrmSessionManager.Builder()
198
203
  .setUuidAndExoMediaDrmProvider(drmUuid, FrameworkMediaDrm.DEFAULT_PROVIDER)
199
204
  .setMultiSession(false)
205
+ .setLoadErrorHandlingPolicy(loadErrorHandlingPolicy)
200
206
  .build(drmCallback)
201
207
  }
202
208
 
@@ -228,6 +234,7 @@ class PlayerFactoryExoPlayerNpaw(
228
234
  "app.name" -> target.appName = jsonAnalytics.getString(key, null)
229
235
  "app.releaseVersion" -> target.appReleaseVersion = jsonAnalytics.getString(key, null)
230
236
  "device.id" -> target.deviceId = jsonAnalytics.getString(key, null)
237
+ "username" -> target.username = jsonAnalytics.getString(key, null)
231
238
  }
232
239
  }
233
240
  }
@@ -15,6 +15,7 @@ import android.webkit.WebView
15
15
  import com.google.gson.JsonArray
16
16
  import com.google.gson.JsonObject
17
17
  import com.twentyfouri.player.base.*
18
+ import com.twentyfouri.player.theoplayer.PlayerTheoPlayer
18
19
  import com.twentyfouri.tvbridge.BuildConfig
19
20
  import com.twentyfouri.tvbridge.Flavor
20
21
  import com.twentyfouri.tvbridge.bridge.BridgeFromJavaScript
@@ -22,6 +23,7 @@ import com.twentyfouri.tvbridge.bridge.BridgeToJavaScript
22
23
  import com.twentyfouri.tvbridge.common.*
23
24
  import com.twentyfouri.tvbridge.configuration.BridgeConfig
24
25
  import com.twentyfouri.tvbridge.global.utils.LocalStorage
26
+ import com.twentyfouri.tvbridge.global.utils.PlayerFactoryTheoPlayerCustomized
25
27
  import com.twentyfouri.tvbridge.global.utils.PlayerFactoryVersion
26
28
  import com.twentyfouri.tvbridge.global.utils.SourceDrmOverridden
27
29
  import com.twentyfouri.tvbridge.webview.client.BridgeWebView
@@ -494,6 +496,57 @@ class WebViewModel @Inject constructor(
494
496
  return deviceInfo
495
497
  }
496
498
 
499
+ fun detectMediaInfo(): JSONObject? {
500
+ val player = this.player ?: return null
501
+ val mediaInfo = JSONObject()
502
+ try {
503
+ mediaInfo.put("resolution", "${player.videoWidth}x${player.videoHeight}")
504
+ player.selectedVideoTrack?.also { track ->
505
+ mediaInfo.put("videoCodec", track.codec)
506
+ mediaInfo.put("bitrate", track.bitrate)
507
+ mediaInfo.put("framerate", track.frameRate)
508
+ }
509
+ player.selectedAudioTrack?.also { track ->
510
+ mediaInfo.put("audioCodec", track.codec)
511
+ }
512
+ player.metrics.also { metrics ->
513
+ mediaInfo.put("estimatedBandwidth", metrics.bandwidthEstimate)
514
+ mediaInfo.put("totalDataLoaded", metrics.totalDownloadedBytes)
515
+ if (player.live) {
516
+ mediaInfo.put("liveLatency", metrics.liveLatency)
517
+ }
518
+ }
519
+ if (config.theoLicense.isNotEmpty()) {
520
+ detectMediaInfoTheo(mediaInfo, player)
521
+ }
522
+
523
+ } catch (e: JSONException) {
524
+ mediaInfo.put("errorType", e.javaClass.simpleName)
525
+ mediaInfo.put("errorMessage", e.message)
526
+ }
527
+ return mediaInfo
528
+ }
529
+
530
+ private fun detectMediaInfoTheo(mediaInfo: JSONObject, player: PlayerBase) {
531
+ try {
532
+ val theoPlayer = (player as? PlayerTheoPlayer)?.theoPlayer ?: return
533
+ theoPlayer.player.buffered.also {
534
+ if (it.length() > 0) {
535
+ mediaInfo.put("bufferLevel", it.getEnd(it.length() - 1))
536
+ }
537
+ }
538
+ theoPlayer.player.metrics?.also { theoMetrics ->
539
+ mediaInfo.put("bufferedSegments", theoMetrics.bufferedSegments.amountOfBufferedVideoSegments)
540
+ mediaInfo.put("droppedVideoFrames", theoMetrics.droppedVideoFrames)
541
+ mediaInfo.put("corruptedVideoFrames", theoMetrics.corruptedVideoFrames)
542
+ mediaInfo.put("estimatedBandwidth", theoMetrics.currentBandwidthEstimate)
543
+ mediaInfo.put("totalDataLoaded", theoMetrics.totalBytesLoaded)
544
+
545
+ }
546
+ } catch (e: NoClassDefFoundError) {
547
+ // ignore
548
+ }
549
+ }
497
550
 
498
551
  private inner class InnerIapCallback : IapCallback {
499
552
  override fun checkNewPurchasesFinished(result: List<IapPurchase>) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/smartapps-bigscreen-rnv-build-engine",
3
- "version": "0.17.25",
3
+ "version": "0.17.26-alpha-2756-test",
4
4
  "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {