diff --git a/src/addon/mod/lesson/pages/player/player.html b/src/addon/mod/lesson/pages/player/player.html index 8ec2f5d79..a6a2c73c6 100644 --- a/src/addon/mod/lesson/pages/player/player.html +++ b/src/addon/mod/lesson/pages/player/player.html @@ -37,7 +37,8 @@ -
+ + diff --git a/src/directives/format-text.ts b/src/directives/format-text.ts index 7efa99f04..368029d6f 100644 --- a/src/directives/format-text.ts +++ b/src/directives/format-text.ts @@ -547,10 +547,12 @@ export class CoreFormatTextDirective implements OnChanges { // Do the iframe responsive. if (iframe.parentElement.classList.contains('embed-responsive')) { iframe.addEventListener('load', () => { - const css = document.createElement('style'); - css.setAttribute('type', 'text/css'); - css.innerHTML = 'iframe {width: 100%;height: 100%;}'; - iframe.contentDocument.head.appendChild(css); + if (iframe.contentDocument) { + const css = document.createElement('style'); + css.setAttribute('type', 'text/css'); + css.innerHTML = 'iframe {width: 100%;height: 100%;}'; + iframe.contentDocument.head.appendChild(css); + } }); } }