{
diff --git a/src/classes/site.ts b/src/classes/site.ts
index 845a9496f..0193f7c4b 100644
--- a/src/classes/site.ts
+++ b/src/classes/site.ts
@@ -1905,7 +1905,7 @@ export class CoreSite {
* Get a certain cache expiration delay.
*
* @param updateFrequency The update frequency of the entry.
- * @return {number} Expiration delay.
+ * @return Expiration delay.
*/
getExpirationDelay(updateFrequency?: number): number {
let expirationDelay = this.UPDATE_FREQUENCIES[updateFrequency] || this.UPDATE_FREQUENCIES[CoreSite.FREQUENCY_USUALLY];
diff --git a/src/components/iframe/core-iframe.html b/src/components/iframe/core-iframe.html
index 7bdeac425..9e5f98ae6 100644
--- a/src/components/iframe/core-iframe.html
+++ b/src/components/iframe/core-iframe.html
@@ -1,5 +1,5 @@
-
+
diff --git a/src/components/iframe/iframe.ts b/src/components/iframe/iframe.ts
index f6517fde6..516012a8f 100644
--- a/src/components/iframe/iframe.ts
+++ b/src/components/iframe/iframe.ts
@@ -21,6 +21,7 @@ import { CoreLoggerProvider } from '@providers/logger';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreUrlUtilsProvider } from '@providers/utils/url';
import { CoreIframeUtilsProvider } from '@providers/utils/iframe';
+import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreSplitViewComponent } from '@components/split-view/split-view';
@Component({
@@ -33,6 +34,7 @@ export class CoreIframeComponent implements OnInit, OnChanges {
@Input() src: string;
@Input() iframeWidth: string;
@Input() iframeHeight: string;
+ @Input() allowFullscreen: boolean | string;
@Output() loaded?: EventEmitter = new EventEmitter();
loading: boolean;
safeUrl: SafeResourceUrl;
@@ -46,6 +48,7 @@ export class CoreIframeComponent implements OnInit, OnChanges {
protected sanitizer: DomSanitizer,
protected navCtrl: NavController,
protected urlUtils: CoreUrlUtilsProvider,
+ protected utils: CoreUtilsProvider,
@Optional() protected svComponent: CoreSplitViewComponent) {
this.logger = logger.getInstance('CoreIframe');
@@ -60,6 +63,7 @@ export class CoreIframeComponent implements OnInit, OnChanges {
this.iframeWidth = this.domUtils.formatPixelsSize(this.iframeWidth) || '100%';
this.iframeHeight = this.domUtils.formatPixelsSize(this.iframeHeight) || '100%';
+ this.allowFullscreen = this.utils.isTrueOrOne(this.allowFullscreen);
// Show loading only with external URLs.
this.loading = !this.src || !!this.src.match(/^https?:\/\//i);
diff --git a/src/core/course/providers/helper.ts b/src/core/course/providers/helper.ts
index 0501ba682..ffbc281b5 100644
--- a/src/core/course/providers/helper.ts
+++ b/src/core/course/providers/helper.ts
@@ -1127,7 +1127,7 @@ export class CoreCourseHelperProvider {
* @param courseId Course ID. If not defined we'll try to retrieve it from the site.
* @param sectionId Section the module belongs to. If not defined we'll try to retrieve it from the site.
* @param useModNameToGetModule If true, the app will retrieve all modules of this type with a single WS call. This reduces the
- * number of WS calls, but it isn't recommended for modules that can return a lot of contents.
+ * number of WS calls, but it isn't recommended for modules that can return a lot of contents.
* @param modParams Params to pass to the module
* @param navCtrl NavController for adding new pages to the current history. Optional for legacy support, but
* generates a warning if omitted.
diff --git a/src/core/filter/providers/default-filter.ts b/src/core/filter/providers/default-filter.ts
index f5f307500..aec2580e1 100644
--- a/src/core/filter/providers/default-filter.ts
+++ b/src/core/filter/providers/default-filter.ts
@@ -65,7 +65,7 @@ export class CoreFilterDefaultHandler implements CoreFilterHandler {
/**
* Whether or not the handler is enabled on a site level.
*
- * @return {boolean|Promise} Whether or not the handler is enabled on a site level.
+ * @return Whether or not the handler is enabled on a site level.
*/
isEnabled(): boolean | Promise {
return true;
diff --git a/src/core/filter/providers/delegate.ts b/src/core/filter/providers/delegate.ts
index 642a454ca..fef46c423 100644
--- a/src/core/filter/providers/delegate.ts
+++ b/src/core/filter/providers/delegate.ts
@@ -236,7 +236,7 @@ export class CoreFilterDelegate extends CoreDelegate {
* @param filter Filter to check.
* @param options Options passed to the filters.
* @param site Site. If not defined, current site.
- * @return {Promise} Promise resolved with true: whether the filter should be applied.
+ * @return Promise resolved with true: whether the filter should be applied.
*/
shouldBeApplied(filters: CoreFilterFilter[], options: CoreFilterFormatTextOptions, site?: CoreSite): Promise {
// Wait for filters to be initialized.
diff --git a/src/core/h5p/classes/content-validator.ts b/src/core/h5p/classes/content-validator.ts
index 18ae59dc3..3d4baac9f 100644
--- a/src/core/h5p/classes/content-validator.ts
+++ b/src/core/h5p/classes/content-validator.ts
@@ -681,8 +681,8 @@ export class CoreH5PContentValidator {
* Processes an HTML tag.
*
* @param m An array with various meaning depending on the value of store.
- * If store is TRUE then the array contains the allowed tags.
- * If store is FALSE then the array has one element, the HTML tag to process.
+ * If store is TRUE then the array contains the allowed tags.
+ * If store is FALSE then the array has one element, the HTML tag to process.
* @param store Whether to store m.
* @return string If the element isn't allowed, an empty string. Otherwise, the cleaned up version of the HTML element.
*/
diff --git a/src/core/h5p/components/h5p-player/core-h5p-player.html b/src/core/h5p/components/h5p-player/core-h5p-player.html
index 3cfd58ccb..22981316f 100644
--- a/src/core/h5p/components/h5p-player/core-h5p-player.html
+++ b/src/core/h5p/components/h5p-player/core-h5p-player.html
@@ -9,5 +9,5 @@
-
+
diff --git a/src/core/h5p/components/h5p-player/h5p-player.scss b/src/core/h5p/components/h5p-player/h5p-player.scss
index 8a4875ac9..e4ccc242d 100644
--- a/src/core/h5p/components/h5p-player/h5p-player.scss
+++ b/src/core/h5p/components/h5p-player/h5p-player.scss
@@ -10,7 +10,7 @@ ion-app.app-root core-h5p-player {
background: url('../assets/img/icons/h5p.svg') center top 25px / 100px auto no-repeat $core-h5p-placeholder-bg-color;
color: $core-h5p-placeholder-text-color;
- .icon {
+ .icon:not([color="success"]) {
color: $core-h5p-placeholder-text-color;
}
diff --git a/src/core/h5p/components/h5p-player/h5p-player.ts b/src/core/h5p/components/h5p-player/h5p-player.ts
index 1166c0136..359be26cc 100644
--- a/src/core/h5p/components/h5p-player/h5p-player.ts
+++ b/src/core/h5p/components/h5p-player/h5p-player.ts
@@ -106,8 +106,6 @@ export class CoreH5PPlayerComponent implements OnInit, OnChanges, OnDestroy {
let promise;
- this.addResizerScript();
-
if (this.canDownload && this.fileHelper.isStateDownloaded(this.state)) {
// Package is downloaded, use the local URL.
promise = this.h5pProvider.getContentIndexFileUrl(this.urlParams.url, this.urlParams, this.siteId).catch(() => {
@@ -145,6 +143,7 @@ export class CoreH5PPlayerComponent implements OnInit, OnChanges, OnDestroy {
});
}
}).finally(() => {
+ this.addResizerScript();
this.loading = false;
this.showPackage = true;
@@ -211,6 +210,11 @@ export class CoreH5PPlayerComponent implements OnInit, OnChanges, OnDestroy {
* Add the resizer script if it hasn't been added already.
*/
protected addResizerScript(): void {
+ if (document.head.querySelector('#core-h5p-resizer-script') != null) {
+ // Script already added, don't add it again.
+ return;
+ }
+
const script = document.createElement('script');
script.id = 'core-h5p-resizer-script';
script.type = 'text/javascript';
@@ -264,6 +268,20 @@ export class CoreH5PPlayerComponent implements OnInit, OnChanges, OnDestroy {
});
}
+ /**
+ * Send hello to the H5P iframe.
+ *
+ * @param iframe The iframe.
+ */
+ sendHello(iframe?: HTMLIFrameElement): void {
+ const ready = {
+ context: 'h5p',
+ action: 'ready'
+ };
+
+ iframe.contentWindow.postMessage(ready, '*');
+ }
+
/**
* Component destroyed.
*/
diff --git a/src/core/h5p/providers/pluginfile-handler.ts b/src/core/h5p/providers/pluginfile-handler.ts
index 13657fc2d..3a38e6381 100644
--- a/src/core/h5p/providers/pluginfile-handler.ts
+++ b/src/core/h5p/providers/pluginfile-handler.ts
@@ -66,7 +66,7 @@ export class CoreH5PPluginFileHandler implements CorePluginFileHandler {
* CoreFilepoolProvider.extractDownloadableFilesFromHtml.
*
* @param container Container where to get the URLs from.
- * @return {string[]} List of URLs.
+ * @return List of URLs.
*/
getDownloadableFilesFromHTML(container: HTMLElement): string[] {
const iframes = Array.from(container.querySelectorAll('iframe.h5p-iframe'));
diff --git a/src/providers/app.ts b/src/providers/app.ts
index 7aa6a6a70..f2071b076 100644
--- a/src/providers/app.ts
+++ b/src/providers/app.ts
@@ -164,7 +164,7 @@ export class CoreAppProvider {
/**
* Returns whether the user agent is controlled by automation. I.e. Behat testing.
*
- * @return {boolean} True if the user agent is controlled by automation, false otherwise.
+ * @return True if the user agent is controlled by automation, false otherwise.
*/
static isAutomated(): boolean {
return !!navigator.webdriver;
diff --git a/src/providers/plugin-file-delegate.ts b/src/providers/plugin-file-delegate.ts
index 17354d4b5..469518698 100644
--- a/src/providers/plugin-file-delegate.ts
+++ b/src/providers/plugin-file-delegate.ts
@@ -71,7 +71,7 @@ export interface CorePluginFileHandler extends CoreDelegateHandler {
* CoreFilepoolProvider.extractDownloadableFilesFromHtml.
*
* @param container Container where to get the URLs from.
- * @return {string[]} List of URLs.
+ * @return List of URLs.
*/
getDownloadableFilesFromHTML?(container: HTMLElement): string[];
diff --git a/src/providers/utils/text.ts b/src/providers/utils/text.ts
index 0a858127e..d4826c942 100644
--- a/src/providers/utils/text.ts
+++ b/src/providers/utils/text.ts
@@ -78,8 +78,8 @@ export class CoreTextUtilsProvider {
/**
* Add ending slash from a path or URL.
*
- * @param {string} text Text to treat.
- * @return {string} Treated text.
+ * @param text Text to treat.
+ * @return Treated text.
*/
addEndingSlash(text: string): string {
if (!text) {
@@ -742,7 +742,7 @@ export class CoreTextUtilsProvider {
* @param replace The value to put inside the string.
* @param start The index where to start putting the new string. If negative, it will count from the end of the string.
* @param length Length of the portion of string which is to be replaced. If negative, it represents the number of characters
- * from the end of string at which to stop replacing. If not provided, replace until the end of the string.
+ * from the end of string at which to stop replacing. If not provided, replace until the end of the string.
* @return Treated string.
*/
substrReplace(str: string, replace: string, start: number, length?: number): string {