-
Notifications
You must be signed in to change notification settings - Fork 0
/
instructions.js
38 lines (34 loc) · 1.14 KB
/
instructions.js
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
var controlTypes = ["arrow", "drag", "target", "targetdrag", "panel"];
var transitionTypes = ["press/release", "click"];
// Because right now not all of the videos are finished
// some urls are repeated or placeholders are used just to test that everything is working
var videoIds = {
"arrow": {
"press/release": "8jFbHrpaptU",
"click": "ADlGCOGRjxc"
},
"drag": {
"press/release": "A-mzWlPjxDU",
"click": "W2uMjeDp4LI"
},
"target": {
"click": "-qUV753YINg"
},
"targetdrag": {
"press/release": "YEVwIV0PPDE",
"click": "VpbocBmKBLk"
},
"panel": {
"press/release": "B8QkeA3O_RY",
"click": "Y_t3GDRDD_s"
}
}
function loadVideo(interface_num) {
var currentControl = interface_nums[interface_num][0];
var currentTransitionType = interface_nums[interface_num][1];
var url = `https://www.youtube.com/embed/${videoIds[controlTypes[currentControl]][transitionTypes[currentTransitionType]]}?rel=0`;
$("#instruction-video").prop("src", url);
$("#next").click(function() {
startInterface(currentControl, currentTransitionType);
})
}