Skip to content

Commit

Permalink
Merge pull request #224 from rdkcentral/integratedPlayerChanges
Browse files Browse the repository at this point in the history
integrated player changes
  • Loading branch information
anjalimukundan authored Oct 14, 2024
2 parents 98fab11 + 4bbbc5d commit 55fd1fe
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,4 @@ To activate Mock Firebolt, there are specific start-up scripts that exist inside

For pinChallenge and acknowledgeChallenge UI prompts , a timeout of 15s is added so that, if no action is taken when the prompts displays on the screen (i.e; neither yes/no/back button ), the prompts will be automatically dismissed with "null" value as the response.
The prompt is displayed when the user needs to grant/deny a particular api, or the user has to enter a pin in-case of pinChallenge.
If user wants to grant an api, yes button is pressed, for deniel - no button, and incase if the user wants to dismiss the prompt without any action, back button is pressed.

If user wants to grant an api, yes button is pressed, for deniel - no button, and incase if the user wants to dismiss the prompt without any action, back button is pressed.
7 changes: 7 additions & 0 deletions src/FireboltExampleInvoker.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ export const MODULE_MAP = {
discovery: DISCOVERY_MODULE_MAP,
};

// importing additional invoker which has external sdk's being exported and adding those modules in the MODULE_MAP
try {
const additionalInvoker = require('../plugins/FireboltExtensionInvoker').default;
Object.assign(MODULE_MAP, additionalInvoker);
} catch (err) {
logger.error(`Unable to import additional invoker - ${err.message}`, 'MODULE_MAP');
}
let instance = null;

export default class FireboltExampleInvoker {
Expand Down
4 changes: 3 additions & 1 deletion src/ValidationView.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ export default class ValidationView extends lng.Component {
// Combine defaultSDKs and additionalSDKs into one array
const allSDKs = [...CONSTANTS.defaultSDKs, ...CONSTANTS.additionalSDKs];
// Find the SDK configuration for the specified sdk mode
const sdkConfig = allSDKs.find((sdk) => sdkMode.includes(sdk.name.toUpperCase()));
const sdkConfigs = allSDKs.filter((sdk) => sdkMode.toUpperCase().includes(sdk.name.toUpperCase()));
const exactMatch = sdkConfigs.find((sdk) => sdkMode.toUpperCase() === sdk.name.toUpperCase());
const sdkConfig = exactMatch || (sdkConfigs.length === 1 && sdkConfigs[0]) || sdkConfigs;
// If SDK config found and validation method exists
if (sdkConfig && sdkConfig.validation) {
if (!sdkConfig.validation()) {
Expand Down
12 changes: 12 additions & 0 deletions src/pubsub/handlers/setApiResponseHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export default class SetApiResponseHandler extends BaseHandler {
return this.setResponseAckChallenge(message);
case 'userinterest':
return this.setResponseUserInterestChallenge(message);
case 'external':
return this.setExternalResponse(message);
default:
const defaultIdString = JSON.stringify({
report: 'Selected module provider is not available',
Expand Down Expand Up @@ -102,4 +104,14 @@ export default class SetApiResponseHandler extends BaseHandler {
const reportIdString = JSON.stringify({ report: 'Received UserInterest apiResponse parameters' });
return reportIdString;
}

// importing external Api resonse function, which can set the pre-requisite values to external modules
setExternalResponse(message) {
try {
const externalFunction = require('../../../plugins/setExternalApiResponse');
return externalFunction.setExternalApiResponse(message);
} catch (err) {
return JSON.stringify({ report: 'Unable to import and set the data for external module' });
}
}
}

0 comments on commit 55fd1fe

Please sign in to comment.