]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5045 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Jan 2022 17:56:29 +0000 (18:56 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Jan 2022 17:56:29 +0000 (18:56 +0100)
resources/elearningmedia/js/app.js
resources/elearningmedia/sass/app.sass
resources/views/elearningmedia/index.blade.php

index 62f615ce5c3f6d69a1cc3c694e5cdfb4f9832885..fdd7ed497055b8ecc5cbda6aa038b9cba94d755c 100644 (file)
@@ -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);
 });
index 01ac7ba72948726a5b1fcd264bfdde49dd5a4c3d..01d2dc14609a59e34eb33233cad2103a9f5afb77 100644 (file)
@@ -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%
index f6cdf2e8e03a9ce47ead8a67a2c1072e001b8f54..0b664d3593f3a2c4be6271ec100a62a630732e1f 100644 (file)
@@ -8,13 +8,14 @@
 <body>
 @if($type==='audio')
     <audio id="player" controls>
-        <source src="media.mp3" type="audio/mp3" />
+        <source src="media.mp3" type="audio/mp3"/>
     </audio>
 @elseif($type==='video')
     <video id="player" playsinline controls data-poster="poster.jpg">
-        <source src="media.mp4" type="video/mp4" />
+        <source src="media.mp4" type="video/mp4"/>
     </video>
 @endif
+<script>var progressComplete = {{$media->get('complete_pct')}};</script>
 <script src="js/app.js"></script>
 </body>
 </html>