- {{ progressMessage | translate }}
- {{ 'core.percentagenumber' | translate:{$a: percentage} }}
+ {{ progressMessage | translate }}
+
diff --git a/src/addon/mod/h5pactivity/components/index/index.ts b/src/addon/mod/h5pactivity/components/index/index.ts
index 83d6469d5..8f452818b 100644
--- a/src/addon/mod/h5pactivity/components/index/index.ts
+++ b/src/addon/mod/h5pactivity/components/index/index.ts
@@ -116,6 +116,11 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv
if (!this.siteCanDownload || this.state == CoreConstants.DOWNLOADED) {
// Cannot download the file or already downloaded, play the package directly.
this.play();
+
+ } else if ((this.state == CoreConstants.NOT_DOWNLOADED || this.state == CoreConstants.OUTDATED) &&
+ CoreFilepool.instance.shouldDownload(this.deployedFile.filesize) && CoreApp.instance.isOnline()) {
+ // Package is small, download it automatically. Don't block this function for this.
+ this.downloadAutomatically();
}
} finally {
this.fillContextMenu(refresh);
@@ -244,6 +249,23 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv
}
}
+ /**
+ * Download the file automatically.
+ *
+ * @return Promise resolved when done.
+ */
+ protected async downloadAutomatically(): Promise