Commit cdc4cd16 authored by Mario Botsch's avatar Mario Botsch
Browse files

Mario kann kein Haskell

parent 674dcb07
......@@ -214,6 +214,11 @@ run = do
putNormal $ "# copy (for " <> out <> ")"
copyFile' src out
--
publicDir <//> "*-recording.vtt" %> \out -> do
let src = makeRelative publicDir out
putNormal $ "# copy (for " <> out <> ")"
copyFile' src out
--
publicDir <//> "*.css" %> \out -> do
let src = makeRelative publicDir out
putNormal $ "# copy (for " <> out <> ")"
......
......@@ -1382,7 +1382,6 @@ let ExplainPlugin = (function () {
}
async function setupPlayer() {
// const config = Reveal.getConfig().explain;
const config = Decker.meta.explain;
explainVideoUrl = config && config.video ? config.video : deckVideoUrl();
explainTimesUrl = config && config.times ? config.times : deckTimesUrl();
......@@ -1394,6 +1393,18 @@ let ExplainPlugin = (function () {
if (videoExists && timesExists) {
explainTimes = await fetchResourceJSON(explainTimesUrl);
player.src({ type: "video/mp4", src: explainVideoUrl });
let captionsUrl = explainVideoUrl.replace(".mp4", ".vtt");
let captionsExist = await resourceExists(captionsUrl);
if (captionsExist) {
let captionsOptions = {
kind: "captions",
srclang: document.documentElement.lang,
src: captionsUrl,
};
player.addRemoteTextTrack(captionsOptions);
}
return true;
} else {
return false;
......
......@@ -77,6 +77,7 @@ data Targets = Targets
_questions :: [FilePath],
_annotations :: [FilePath],
_times :: [FilePath],
_captions :: [FilePath],
_recordings :: [FilePath],
_css :: [FilePath]
}
......@@ -195,6 +196,8 @@ recordingSuffix2 = "-recording.mp4"
recordingTargetSuffix = "-recording.mp4"
captionsSuffix = "-recording.vtt"
sourceRegexes :: [String] =
[ "-deck.md\\'",
"-page.md\\'",
......@@ -202,6 +205,7 @@ sourceRegexes :: [String] =
"-quest.yaml\\'",
"-recording.webm\\'",
"-recording.mp4\\'",
"-recording.vtt\\'",
"-times.json\\'",
"-annot.json\\'",
"\\`(^_).*\\.scss\\'"
......@@ -253,6 +257,7 @@ scanTargets meta = do
_questions = sort $ calcTargets questSuffix questHTMLSuffix srcs,
_annotations = sort $ calcTargets annotationSuffix annotationSuffix srcs,
_times = sort $ calcTargets timesSuffix timesSuffix srcs,
_captions = sort $ calcTargets captionsSuffix captionsSuffix srcs,
_recordings =
List.nub $ sort $
calcTargets recordingSuffix1 recordingTargetSuffix srcs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment