diff --git a/src/app/content-details/content-details.page.html b/src/app/content-details/content-details.page.html index cc8a37d22e..0a08fc8064 100644 --- a/src/app/content-details/content-details.page.html +++ b/src/app/content-details/content-details.page.html @@ -61,14 +61,14 @@
+ *ngIf="!contentDownloadPlay">

{{'PLAY' | translate}}

+ *ngIf="contentDownloadPlay"> diff --git a/src/app/content-details/content-details.page.ts b/src/app/content-details/content-details.page.ts index 788f20a5af..e431bcabbb 100644 --- a/src/app/content-details/content-details.page.ts +++ b/src/app/content-details/content-details.page.ts @@ -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, @@ -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(() => { @@ -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; } @@ -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); @@ -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 + } + }) + } } diff --git a/src/app/qrcoderesult/qrcoderesult.page.html b/src/app/qrcoderesult/qrcoderesult.page.html index 5388cf064e..52f3c78ca8 100644 --- a/src/app/qrcoderesult/qrcoderesult.page.html +++ b/src/app/qrcoderesult/qrcoderesult.page.html @@ -87,7 +87,7 @@
{{content?.contentData?.name}}
+ *ngIf="content.contentData?.streamingUrl && !(content.mimeType === 'application/vnd.ekstep.h5p-archive' || content.mimeType === 'application/vnd.ekstep.ecml-archive')">