summaryrefslogtreecommitdiff
path: root/src/Http/Controllers/ScormPlayerController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Http/Controllers/ScormPlayerController.php')
-rw-r--r--src/Http/Controllers/ScormPlayerController.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Http/Controllers/ScormPlayerController.php b/src/Http/Controllers/ScormPlayerController.php
index 34a5967..7c801c9 100644
--- a/src/Http/Controllers/ScormPlayerController.php
+++ b/src/Http/Controllers/ScormPlayerController.php
@@ -21,6 +21,8 @@ use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
class ScormPlayerController extends Controller
{
+ private const JS_PATH = __DIR__ . '/../../../dist/js/scorm_player.js';
+
public function player(Request $request, Scorm $module)
{
$sco = $request->query('sco');
@@ -33,9 +35,14 @@ class ScormPlayerController extends Controller
],
];
+ $js_uri = route('scorm-player.javascript', [
+ 'version' => substr(md5(filemtime(self::JS_PATH)), 10, 8)
+ ]);
+
return view('scorm-player::player', compact(
'sco',
- 'scorm_api_data'
+ 'scorm_api_data',
+ 'js_uri'
));
}
@@ -101,4 +108,13 @@ class ScormPlayerController extends Controller
];
}
+ public function jsSource(Request $request)
+ {
+ return response()->file(self::JS_PATH, [
+ 'Content-Type' => 'application/javascript',
+ //'Cache-Control' => $cacheControl,
+ //'ETag' => $etag,
+ ]);
+ }
+
}