From: Vincent Vanwaelscappel Date: Fri, 28 Jan 2022 17:56:29 +0000 (+0100) Subject: wip #5045 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7860eb085006ff7b1c1aab5599ad432c19aa19af;p=fluidbook-toolbox.git wip #5045 @0.5 --- diff --git a/resources/elearningmedia/js/app.js b/resources/elearningmedia/js/app.js index 62f615ce5..fdd7ed497 100644 --- a/resources/elearningmedia/js/app.js +++ b/resources/elearningmedia/js/app.js @@ -1,9 +1,14 @@ require('./bootstrap'); -document.addEventListener("DOMContentLoaded", function() { - +document.addEventListener("DOMContentLoaded", function () { const player = new Plyr('#player'); SCORM.init(); - + var interval = setInterval(function () { + if (player.duration > 0 && currentTime > (player.duration * (progressComplete / 100))) { + SCORM.set('cmi.core.lesson_status', 'completed'); + SCORM.save(); + clearInterval(interval); + } + }, 1000); }); diff --git a/resources/elearningmedia/sass/app.sass b/resources/elearningmedia/sass/app.sass index 01ac7ba72..01d2dc146 100644 --- a/resources/elearningmedia/sass/app.sass +++ b/resources/elearningmedia/sass/app.sass @@ -1,2 +1,16 @@ -body - background-color: #f00 +@import "plyr/src/sass/plyr.scss" + +* + padding: 0 + margin: 0 + box-sizing: border-box + + +html,body + width: 100% + height: 100% + overflow: hidden + +video, audio + width: 100% + height: 100% diff --git a/resources/views/elearningmedia/index.blade.php b/resources/views/elearningmedia/index.blade.php index f6cdf2e8e..0b664d359 100644 --- a/resources/views/elearningmedia/index.blade.php +++ b/resources/views/elearningmedia/index.blade.php @@ -8,13 +8,14 @@ @if($type==='audio') @elseif($type==='video') @endif +