From 7860eb085006ff7b1c1aab5599ad432c19aa19af Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 28 Jan 2022 18:56:29 +0100 Subject: [PATCH] wip #5045 @0.5 --- resources/elearningmedia/js/app.js | 11 ++++++++--- resources/elearningmedia/sass/app.sass | 18 ++++++++++++++++-- resources/views/elearningmedia/index.blade.php | 5 +++-- 3 files changed, 27 insertions(+), 7 deletions(-) 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 + -- 2.39.5