-
Notifications
You must be signed in to change notification settings - Fork 5
/
example_media.html
77 lines (63 loc) · 3.18 KB
/
example_media.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>TheFragebogen: multimedia example</title>
<link rel="stylesheet" type="text/css" href="example.css">
<script src="../thefragebogen.js"></script>
<script>
var screens = [];
screens.push(
new ScreenUIElements(
new UIElementHTML(undefined, "<h1>TheFragebogen</h1>"),
new UIElementHTML(undefined, "Preloading finished."),
new UIElementHTML(undefined, "This demo shows how to use media elements (i.e., such as images, audio files, and video files)."),
new UIElementHTML(undefined, "When you are ready, please press 'Next'.")
)
);
screens.push(
new ScreenUIElements(
new UIElementHTML(undefined, "Showing an image."),
new QuestionnaireItemMediaImage(undefined, "The NASA TLX scale:", false, "../svg_scales/nasa_tlx_scale.svg")
)
);
screens.push(
new ScreenUIElements(
new UIElementHTML(undefined, "<h1>QuestionnaireItemMediaAudio</h1>"),
new UIElementHTML(undefined, "Presenting audio."),
new QuestionnaireItemMediaAudio(undefined, "The Big Buck Bunny trailer (audio-only):", false, "http://download.blender.org/peach/trailer/trailer_400p.ogg")
)
);
screens.push(
new ScreenUIElements(
new UIElementHTML(undefined, "<h1>QuestionnaireItemMediaVideoRepeatable</h1>"),
new UIElementHTML(undefined, "Presenting a (replayable) video."),
new QuestionnaireItemMediaVideoRepeatable(undefined, "The Big Buck Bunny trailer:", false, "http://download.blender.org/peach/trailer/trailer_480p.mov", true, "Restart playback")
)
);
screens.push(new ScreenWaitDataDownload(undefined, "The End<br>All data should now be downloaded.", "TheFragebogen-basic.csv", false));
var screenController = new ScreenController(screens);
</script>
<script>
//Having the start()-function in an extra script-tag makes sure that it will be executed even if there are errors in the script-tag configuring TheFragebogen.
function start() {
document.body.innerHTML += "TheFragebogen loaded.";
if (typeof(screenController) === "undefined") {
document.body.innerHTML += "<br><i>Something went wrong:</i> Please check that thefragebogen.js was loaded and that the configuration is ok.";
return;
}
screenController.init(document.body);
screenController.preload("<br><b>Preloading media files<br><progress></progress>");
}
</script>
</head>
<body onload="start()">
<h1>TheFragebogen</h1>
<p>
TheFragebogen will be shown here.<br> If something fails while starting, an error message will be shown here.
</p>
<p>
Please note that this demo uses preloading of all media files.<br> This questionnaire will only start if <i>all</i> media files finished loading or failed to load.
</p>
</body>
</html>