Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/app/player/player.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat
this.playerType = 'sunbird-quml-player';
this.playQumlContent();
} else {
const questionSetData = await this.contentService.getQuestionSetChildren(this.config['metadata']['identifier']);
this.config['metadata']['children'] = await this.contentService.getQuestionSetChildren(this.config['metadata']['identifier']);
let questionId: string[] = [];
questionSetData.forEach(item => {
this.config['metadata']['children'].forEach(item => {
if (item.children) {
item.children.forEach(child => {
if (child.identifier) {
Expand All @@ -155,10 +155,18 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat
}
});
this.contentService.getQuestionList(questionId).subscribe((response) => {
this.config['metadata']['children'] = response.questions;
const questions = response.questions;
this.config['metadata']['children'].forEach((childArray) => {
if (childArray.children) {
childArray.children.length = 0;
questions.forEach(question => {
childArray.children.push(question);
});
}
});
this.playerType = 'sunbird-quml-player';
this.playQumlContent();
});
});
}
} else if(["video/mp4", "video/webm"].includes(this.config['metadata']['mimeType']) && this.checkIsPlayerEnabled(this.playerConfig , 'videoPlayer').name === "videoPlayer"){
if(!this.platform.is('ios')){
Expand Down Expand Up @@ -762,7 +770,7 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat
config: this.config.config,
metadata: this.config.metadata
};

setTimeout(() => {
const qumlElement = document.createElement('sunbird-quml-player');
qumlElement.setAttribute('player-config', JSON.stringify(playerConfig));
Expand All @@ -786,4 +794,4 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat
console.error("Invalid player type or missing config.");
}
}
}
}