Merge branch 'MDL-70806-master' of git://github.com/ferranrecio/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2021-02-15 22:29:31 +01:00
commit 260c6f3097
3 changed files with 13 additions and 8 deletions

View File

@ -87,6 +87,9 @@ if (empty($messages->error) && empty($messages->exception)) {
$PAGE->add_body_class('h5p-embed');
$PAGE->set_pagelayout('embedded');
// Load the embed.js to allow communication with the parent window.
$PAGE->requires->js(new moodle_url('/h5p/js/embed.js'));
echo $OUTPUT->header();
// Print all the errors.

View File

@ -35,10 +35,3 @@
allowfullscreen="allowfullscreen" class="h5p-player w-100 border-0"
style="height: 0px;" id="{{uniqid}}-h5player">
</iframe>
{{#js}}
window.onload=function(){
setTimeout(() => {
document.getElementById('{{uniqid}}-h5player').style.minHeight = '230px';
}, 1000);
};
{{/js}}

View File

@ -19,6 +19,8 @@
This template will render the embed code shown in the H5P content embed popup.
Note: this mustache is part of the H5P player and requires '/h5p/js/embed.js' already loaded.
Variables required for this template:
* h5picon - The icon
* message - The error messages to display.
@ -55,4 +57,11 @@
</div>
{{/error}}
</div>
</div>
</div>
{{#js}}
(function() {
H5PEmbedCommunicator.send('resize', {
scrollHeight: document.body.scrollHeight
});
})();
{{/js}}