Skip to content

Commit

Permalink
Merge branch 'MDL-70634-master' of git://github.com/ferranrecio/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Feb 3, 2021
2 parents 7fde34a + bc8f411 commit e63081f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion h5p/templates/h5pembed.mustache
Expand Up @@ -18,6 +18,9 @@
@template core_h5p/h5pembed
This template will render the embed code shown in the H5P content embed popup.
H5P implements iframe autoheight but if the content is not available it does
not work and we need ensure a minimum height using javascript. Otherwise the user
will not see the error.
Variables required for this template:
* embedurl - The URL with the H5P file to embed
Expand All @@ -30,5 +33,12 @@
}}
<iframe src="{{embedurl}}" name="h5player" width=":w" height=":h"
allowfullscreen="allowfullscreen" class="h5p-player w-100 border-0"
style="min-height: 230px;">
style="height: 0px;" id="{{uniqid}}-h5player">
</iframe>
{{#js}}
window.onload=function(){
setTimeout(() => {
document.getElementById('{{uniqid}}-h5player').style.minHeight = '230px';
}, 1000);
};
{{/js}}

0 comments on commit e63081f

Please sign in to comment.