Skip to content

Commit

Permalink
Issue #ED-0000 merge: Merge pull request #3644 from vpPavithra/releas…
Browse files Browse the repository at this point in the history
…e-7.0.0

Issue #ED-0000 fix: ecml contents - downl0ad and play
  • Loading branch information
swayangjit authored Jun 24, 2024
2 parents 8b273bb + 414d503 commit fc4f42e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/content-details/content-details.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@

</div>
<div class="sb-common-player-group sb-play-title-group"
*ngIf="content.mimeType !== 'application/vnd.ekstep.h5p-archive'">
*ngIf="!contentDownloadPlay">
<button fill="clear" icon-only class="sb-common-title" aria-label="Play video" (click)="handleContentPlay(true)">
<img src="assets/imgs/play_circle.svg" role="button" alt="play" class="play-circle">
</button>
<p class="play-text"> {{'PLAY' | translate}} </p>
</div>
<div class="sb-common-player-group sb-download-title-group" (click)="openConfirmPopUp()"
*ngIf="content.mimeType === 'application/vnd.ekstep.h5p-archive'">
*ngIf="contentDownloadPlay">
<ion-button fill="clear" icon-only class="sb-common-title">
<ion-icon name="cloud-download" role="button" class="sb-common-white-icon"></ion-icon>
</ion-button>
Expand Down
14 changes: 14 additions & 0 deletions src/app/content-details/content-details.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ export class ContentDetailsPage implements OnInit, OnDestroy {
navigateBackFlag = false;
@ViewChild('video') video: ElementRef | undefined;
contentCategories = [];
contentDownloadPlay = false;
mimeTypesDownloadAndPlay = ['application/vnd.ekstep.h5p-archive', 'application/vnd.ekstep.ecml-archive']

constructor(
@Inject('PROFILE_SERVICE') private profileService: ProfileService,
Expand Down Expand Up @@ -348,6 +350,7 @@ export class ContentDetailsPage implements OnInit, OnDestroy {
this.events.subscribe(EventTopics.NEXT_CONTENT, async (data) => {
this.generateEndEvent();
this.content = data.content;
this.downloadAndPlayContents(this.content);
this.course = data.course;
await this.getNavParams();
setTimeout(() => {
Expand Down Expand Up @@ -563,6 +566,7 @@ export class ContentDetailsPage implements OnInit, OnDestroy {
}

this.content = data;
this.downloadAndPlayContents(this.content);
if (data.contentData.licenseDetails && Object.keys(data.contentData.licenseDetails).length) {
this.licenseDetails = data.contentData.licenseDetails;
}
Expand Down Expand Up @@ -1533,6 +1537,7 @@ export class ContentDetailsPage implements OnInit, OnDestroy {
content.contentData.status === ContentFilterConfig.CONTENT_STATUS_UNLISTED);
if (this.limitedShareContentFlag) {
this.content = content;
this.downloadAndPlayContents(this.content);
this.playingContent = content;
this.identifier = content.contentId || content.identifier;
this.telemetryObject = ContentUtil.getTelemetryObject(content);
Expand Down Expand Up @@ -1766,4 +1771,13 @@ export class ContentDetailsPage implements OnInit, OnDestroy {
});
}
}

downloadAndPlayContents(content: any) {
this.contentDownloadPlay = false
this.mimeTypesDownloadAndPlay.forEach(mimetype => {
if(mimetype === content.mimeType) {
this.contentDownloadPlay = true
}
})
}
}
2 changes: 1 addition & 1 deletion src/app/qrcoderesult/qrcoderesult.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h6 class="name font-size-20">{{content?.contentData?.name}}</h6>
</button>
</ion-col>
<ion-col class="ion-no-padding"
*ngIf="content.contentData?.streamingUrl && !(content.mimeType === 'application/vnd.ekstep.h5p-archive')">
*ngIf="content.contentData?.streamingUrl && !(content.mimeType === 'application/vnd.ekstep.h5p-archive' || content.mimeType === 'application/vnd.ekstep.ecml-archive')">
<button class="custom-btn play qr-result-btn ion-no-padding" expand="block" (click)="playContent(content, true)">
<ion-icon name="play" style="margin-left: -1rem;"></ion-icon>&nbsp;<span class="play-btn-info">{{'PLAY' | translate}}</span>
</button>
Expand Down

0 comments on commit fc4f42e

Please sign in to comment.