branch-video-player-sdk 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,33 @@
1
+ {
2
+ "script": {
3
+ "version": "3.0.0",
4
+ "id": "e2e-branch-video-landscape-image",
5
+ "metadata": { "title": "E2E Landscape Image" },
6
+ "assets": {
7
+ "videos": {},
8
+ "images": {
9
+ "landscape": {
10
+ "src": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23272962'/%3E%3C/svg%3E"
11
+ }
12
+ },
13
+ "audios": {},
14
+ "speeches": {}
15
+ },
16
+ "resources": { "variables": {} },
17
+ "playerConfig": { "security": { "defaultAllowedOrigins": ["*"] } },
18
+ "graph": {
19
+ "entryNodeId": "image-landscape",
20
+ "nodes": {
21
+ "image-landscape": {
22
+ "id": "image-landscape",
23
+ "type": "image",
24
+ "metadata": { "title": "横向图片" },
25
+ "config": { "slides": [{ "assetRef": "landscape", "duration": 999 }] },
26
+ "interactions": [],
27
+ "branches": []
28
+ }
29
+ }
30
+ }
31
+ },
32
+ "options": {}
33
+ }
@@ -0,0 +1,160 @@
1
+ {
2
+ "script": {
3
+ "version": "3.0.0",
4
+ "id": "e2e-legacy-same-url-lifecycle",
5
+ "metadata": {
6
+ "title": "E2E Legacy Same URL Web Lifecycle",
7
+ "description": "Derived from BranchVideo project AAABoBeGRIchRg version 1 Web nodes S01_1 and S02_1."
8
+ },
9
+ "assets": {
10
+ "videos": {},
11
+ "images": {},
12
+ "audios": {},
13
+ "speeches": {}
14
+ },
15
+ "resources": {
16
+ "variables": {}
17
+ },
18
+ "playerConfig": {
19
+ "security": {
20
+ "defaultAllowedOrigins": [
21
+ "https://aic-view.sdp.cn.ndhy.com"
22
+ ]
23
+ }
24
+ },
25
+ "graph": {
26
+ "entryNodeId": "S01_1",
27
+ "nodes": {
28
+ "S01_1": {
29
+ "id": "S01_1",
30
+ "type": "web",
31
+ "metadata": {
32
+ "title": "题1:影子在哪一侧"
33
+ },
34
+ "config": {
35
+ "url": "https://aic-view.sdp.cn.ndhy.com/view/1Ba4eX-4R3asAk_Dz7C2l05Z",
36
+ "allowedOrigins": [
37
+ "https://aic-view.sdp.cn.ndhy.com"
38
+ ],
39
+ "initData": {
40
+ "question": "光源在物体的左侧,影子在哪一侧?",
41
+ "options": [
42
+ {
43
+ "label": "A",
44
+ "text": "左侧"
45
+ },
46
+ {
47
+ "label": "B",
48
+ "text": "右侧"
49
+ }
50
+ ],
51
+ "answer": "B"
52
+ },
53
+ "messageMapping": {
54
+ "1": "success",
55
+ "2": "fail"
56
+ }
57
+ },
58
+ "interactions": [],
59
+ "branchConfig": {
60
+ "rules": [
61
+ {
62
+ "id": "S01_1_success",
63
+ "trigger": {
64
+ "type": "message",
65
+ "value": "success"
66
+ },
67
+ "action": {
68
+ "type": "goto",
69
+ "target": "S02_1"
70
+ }
71
+ },
72
+ {
73
+ "id": "S01_1_fail",
74
+ "trigger": {
75
+ "type": "message",
76
+ "value": "fail"
77
+ },
78
+ "action": {
79
+ "type": "goto",
80
+ "target": "S01_1"
81
+ }
82
+ }
83
+ ]
84
+ }
85
+ },
86
+ "S02_1": {
87
+ "id": "S02_1",
88
+ "type": "web",
89
+ "metadata": {
90
+ "title": "题2:影子怎么变"
91
+ },
92
+ "config": {
93
+ "url": "https://aic-view.sdp.cn.ndhy.com/view/1Ba4eX-4R3asAk_Dz7C2l05Z",
94
+ "allowedOrigins": [
95
+ "https://aic-view.sdp.cn.ndhy.com"
96
+ ],
97
+ "initData": {
98
+ "question": "光源从左移到右,影子会怎么变?",
99
+ "options": [
100
+ {
101
+ "label": "A",
102
+ "text": "同向(影子也向右)"
103
+ },
104
+ {
105
+ "label": "B",
106
+ "text": "反向(影子向左)"
107
+ }
108
+ ],
109
+ "answer": "B"
110
+ },
111
+ "messageMapping": {
112
+ "1": "success",
113
+ "2": "fail"
114
+ }
115
+ },
116
+ "interactions": [],
117
+ "branchConfig": {
118
+ "rules": [
119
+ {
120
+ "id": "S02_1_success",
121
+ "trigger": {
122
+ "type": "message",
123
+ "value": "success"
124
+ },
125
+ "action": {
126
+ "type": "goto",
127
+ "target": "end"
128
+ }
129
+ },
130
+ {
131
+ "id": "S02_1_fail",
132
+ "trigger": {
133
+ "type": "message",
134
+ "value": "fail"
135
+ },
136
+ "action": {
137
+ "type": "goto",
138
+ "target": "S02_1"
139
+ }
140
+ }
141
+ ]
142
+ }
143
+ },
144
+ "end": {
145
+ "id": "end",
146
+ "type": "end",
147
+ "metadata": {
148
+ "title": "完成"
149
+ },
150
+ "config": {
151
+ "display": "restart_screen",
152
+ "title": "完成",
153
+ "showRestartButton": true
154
+ }
155
+ }
156
+ }
157
+ }
158
+ },
159
+ "options": {}
160
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "script": {
3
+ "version": "3.0.0",
4
+ "id": "e2e-mask-mobile",
5
+ "metadata": { "title": "E2E Mask Mobile" },
6
+ "assets": {
7
+ "videos": {},
8
+ "images": {
9
+ "stage": {
10
+ "src": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23272962'/%3E%3C/svg%3E"
11
+ }
12
+ },
13
+ "audios": {},
14
+ "speeches": {},
15
+ "effects": {},
16
+ "characters": {}
17
+ },
18
+ "resources": { "variables": {} },
19
+ "playerConfig": {},
20
+ "graph": {
21
+ "entryNodeId": "avg-mask",
22
+ "nodes": {
23
+ "avg-mask": {
24
+ "id": "avg-mask",
25
+ "type": "image",
26
+ "metadata": { "title": "蒙版互动" },
27
+ "config": { "slides": [{ "assetRef": "stage", "duration": 999 }] },
28
+ "interactions": [
29
+ {
30
+ "id": "mask-question",
31
+ "trigger": { "type": "time", "value": 0 },
32
+ "pauseContent": true,
33
+ "interactive": {
34
+ "type": "story_choice",
35
+ "inputMode": "mask",
36
+ "title": "选择蒙版区域",
37
+ "maskConfig": {
38
+ "maskImage": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23000000'/%3E%3Crect x='533' y='0' width='534' height='300' fill='%23FF0000'/%3E%3Crect x='533' y='600' width='534' height='300' fill='%2300FF00'/%3E%3Crect x='0' y='300' width='533' height='300' fill='%230000FF'/%3E%3Crect x='1067' y='300' width='533' height='300' fill='%23FFFF00'/%3E%3Crect x='533' y='300' width='534' height='300' fill='%23FF00FF'/%3E%3C/svg%3E",
39
+ "colorTolerance": 10,
40
+ "highlight": { "enabled": true, "mode": "glow", "animation": "none" },
41
+ "colorMapping": [
42
+ { "color": "#FF0000", "optionId": "top", "tooltip": "上方" },
43
+ { "color": "#00FF00", "optionId": "bottom", "tooltip": "下方" },
44
+ { "color": "#0000FF", "optionId": "left", "tooltip": "左侧" },
45
+ { "color": "#FFFF00", "optionId": "right", "tooltip": "右侧" },
46
+ { "color": "#FF00FF", "optionId": "center", "tooltip": "中间" }
47
+ ]
48
+ },
49
+ "options": [
50
+ { "id": "top", "text": "上方" },
51
+ { "id": "bottom", "text": "下方" },
52
+ { "id": "left", "text": "左侧" },
53
+ { "id": "right", "text": "右侧" },
54
+ { "id": "center", "text": "中间" }
55
+ ],
56
+ "collectMode": { "mode": "all", "showProgress": true }
57
+ },
58
+ "branches": [],
59
+ "fallback": { "onTimeout": { "type": "end" }, "onDefault": { "type": "end" } }
60
+ }
61
+ ],
62
+ "branches": []
63
+ }
64
+ }
65
+ }
66
+ },
67
+ "options": {}
68
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "script": {
3
+ "version": "3.0.0",
4
+ "id": "e2e-branch-video-portrait-image",
5
+ "metadata": { "title": "E2E Portrait Image" },
6
+ "assets": {
7
+ "videos": {},
8
+ "images": {
9
+ "portrait": {
10
+ "src": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='1600' viewBox='0 0 900 1600'%3E%3Crect width='900' height='1600' fill='%235753C6'/%3E%3C/svg%3E"
11
+ }
12
+ },
13
+ "audios": {},
14
+ "speeches": {}
15
+ },
16
+ "resources": { "variables": {} },
17
+ "playerConfig": { "security": { "defaultAllowedOrigins": ["*"] } },
18
+ "graph": {
19
+ "entryNodeId": "image-portrait",
20
+ "nodes": {
21
+ "image-portrait": {
22
+ "id": "image-portrait",
23
+ "type": "image",
24
+ "metadata": { "title": "竖向图片" },
25
+ "config": { "slides": [{ "assetRef": "portrait", "duration": 999 }] },
26
+ "interactions": [],
27
+ "branches": []
28
+ }
29
+ }
30
+ }
31
+ },
32
+ "options": {}
33
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "script": {
3
+ "version": "3.0.0",
4
+ "id": "e2e-real-aic-view-mobile",
5
+ "metadata": { "title": "E2E Real AIC View Mobile Canary" },
6
+ "assets": { "videos": {}, "images": {}, "audios": {}, "speeches": {} },
7
+ "resources": { "variables": {} },
8
+ "playerConfig": {
9
+ "theme": { "themeId": "cartoon" },
10
+ "security": { "defaultAllowedOrigins": ["*"] }
11
+ },
12
+ "graph": {
13
+ "entryNodeId": "real-aic-view-fill-keyboard",
14
+ "nodes": {
15
+ "real-aic-view-fill-keyboard": {
16
+ "id": "real-aic-view-fill-keyboard",
17
+ "type": "web",
18
+ "metadata": { "title": "真实 AIC View 填空题" },
19
+ "config": {
20
+ "url": "https://aic-view.sdp.cn.ndhy.com/view/3ahDXL0Oh3tFAaR7Lu6Sv3Dv",
21
+ "timeout": 30,
22
+ "allowedOrigins": ["*"],
23
+ "waitForPageReady": true,
24
+ "initData": {
25
+ "question": "一个长方体容器从里面量长20厘米、宽15厘米,装有水且水深8厘米。将体积为900立方厘米的铁块完全浸没后,水面会上升多少厘米?请阅读题干、确认单位,再在下方数字键盘填写【答案】。为了验证真实移动 Web 内容区可以独立滚动,本题保留这一段说明:铁块完全浸没且容器未溢出,排开水的体积等于铁块体积。请继续向下阅读题干提示后完成填写。",
26
+ "keyboard": "numeric",
27
+ "option": "一个长方体容器从里面量长20厘米、宽15厘米,装有水且水深8厘米。将体积为900立方厘米的铁块完全浸没后,水面会上升【空格1】厘米。",
28
+ "answer": "【空格1】:3",
29
+ "Verification": "Full verification"
30
+ },
31
+ "messageMapping": {},
32
+ "messageHandlers": []
33
+ },
34
+ "interactions": [],
35
+ "branches": []
36
+ }
37
+ }
38
+ }
39
+ },
40
+ "options": {}
41
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "script": {
3
+ "version": "3.0.0",
4
+ "id": "e2e-settlement-history-mobile",
5
+ "metadata": { "title": "E2E Settlement History Mobile" },
6
+ "assets": { "videos": {}, "images": {}, "audios": {}, "speeches": {}, "effects": {}, "characters": {} },
7
+ "resources": { "variables": { "score": { "type": "number", "default": 75, "min": 0, "max": 100 } } },
8
+ "playerConfig": { "security": { "defaultAllowedOrigins": ["*"] } },
9
+ "graph": {
10
+ "entryNodeId": "web-settlement",
11
+ "nodes": {
12
+ "web-settlement": {
13
+ "id": "web-settlement",
14
+ "type": "web",
15
+ "metadata": { "title": "Settlement history trigger" },
16
+ "config": { "url": "/e2e/web-node-settlement-trigger.html", "allowedOrigins": ["*"], "waitForPageReady": false },
17
+ "interactions": [
18
+ {
19
+ "id": "settlement",
20
+ "trigger": { "type": "message", "value": "settle" },
21
+ "pauseContent": true,
22
+ "interactive": {
23
+ "type": "score_settlement",
24
+ "settlementConfig": {
25
+ "title": "学习结算",
26
+ "values": [{ "id": "score", "variableName": "score", "label": "得分", "isPrimary": true, "showProgressBar": true, "order": 1 }],
27
+ "levels": [{ "id": "pass", "levelName": "A", "minScore": 0, "maxScore": 100, "title": "完成", "evaluation": "结算后返回设置", "starCount": 4 }],
28
+ "layoutMode": "vertical",
29
+ "animated": false,
30
+ "confirmButtonText": "完成"
31
+ }
32
+ },
33
+ "branches": []
34
+ }
35
+ ],
36
+ "branches": []
37
+ }
38
+ }
39
+ }
40
+ },
41
+ "options": {}
42
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "script": {
3
+ "version": "3.0.0",
4
+ "id": "e2e-settlement-mobile",
5
+ "metadata": { "title": "E2E Settlement Mobile" },
6
+ "assets": {
7
+ "videos": {},
8
+ "images": {
9
+ "stage": {
10
+ "src": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23272962'/%3E%3C/svg%3E"
11
+ }
12
+ },
13
+ "audios": {},
14
+ "speeches": {},
15
+ "effects": {},
16
+ "characters": {}
17
+ },
18
+ "resources": {
19
+ "variables": {
20
+ "score": { "type": "number", "default": 75, "min": 0, "max": 100 }
21
+ }
22
+ },
23
+ "playerConfig": {},
24
+ "graph": {
25
+ "entryNodeId": "avg-settlement",
26
+ "nodes": {
27
+ "avg-settlement": {
28
+ "id": "avg-settlement",
29
+ "type": "image",
30
+ "metadata": { "title": "结算独占" },
31
+ "config": { "slides": [{ "assetRef": "stage", "duration": 999 }] },
32
+ "interactions": [
33
+ {
34
+ "id": "settlement",
35
+ "trigger": { "type": "time", "value": 6 },
36
+ "pauseContent": true,
37
+ "interactive": {
38
+ "type": "score_settlement",
39
+ "settlementConfig": {
40
+ "title": "学习结算",
41
+ "subtitle": "ScoreSettlement 独占 player root",
42
+ "values": [
43
+ { "id": "score", "variableName": "score", "label": "得分", "isPrimary": true, "showProgressBar": true, "order": 1 }
44
+ ],
45
+ "levels": [
46
+ { "id": "pass", "levelName": "A", "minScore": 0, "maxScore": 100, "title": "完成", "evaluation": "已完成移动结算验证", "starCount": 4 }
47
+ ],
48
+ "layoutMode": "vertical",
49
+ "animated": false,
50
+ "confirmButtonText": "完成"
51
+ }
52
+ },
53
+ "branches": [],
54
+ "fallback": { "onTimeout": { "type": "end" }, "onDefault": { "type": "end" } }
55
+ }
56
+ ],
57
+ "branches": []
58
+ }
59
+ }
60
+ }
61
+ },
62
+ "options": {}
63
+ }
@@ -8,27 +8,27 @@
8
8
  "assets": {
9
9
  "videos": {
10
10
  "video_intro": {
11
- "src": "https://gcdncs.101.com/v0.1/static/edu_product/esp/assets/ff839606-a80a-4dd3-b044-1e9dc725a014.pkg/公演:晚归. 深山. 昏.mp4",
11
+ "src": "https://gcdncs.cn.ndhy.com/v0.1/static/edu_product/esp/assets/ff839606-a80a-4dd3-b044-1e9dc725a014.pkg/公演:晚归. 深山. 昏.mp4",
12
12
  "duration": 5.0
13
13
  },
14
14
  "video_input_true": {
15
- "src": "https://gcdncs.101.com/v0.1/static/edu_product/esp/assets/3506731e-8874-4be6-953a-12815c557da7.pkg/选角正确:屠夫. 微缩舞台沙盘. 夜.mp4",
15
+ "src": "https://gcdncs.cn.ndhy.com/v0.1/static/edu_product/esp/assets/3506731e-8874-4be6-953a-12815c557da7.pkg/选角正确:屠夫. 微缩舞台沙盘. 夜.mp4",
16
16
  "duration": 21.0
17
17
  },
18
18
  "video_input_partial": {
19
- "src": "https://gcdncs.101.com/v0.1/static/edu_product/esp/assets/7965e430-8c43-476a-bece-543b67695e0a.pkg/需求详解. 时空剧社排练厅. 夜.mp4",
19
+ "src": "https://gcdncs.cn.ndhy.com/v0.1/static/edu_product/esp/assets/7965e430-8c43-476a-bece-543b67695e0a.pkg/需求详解. 时空剧社排练厅. 夜.mp4",
20
20
  "duration": 41.0
21
21
  },
22
22
  "video_input_false": {
23
- "src": "https://gcdncs.101.com/v0.1/static/edu_product/esp/assets/ec142981-949a-40d3-a930-60b19baedca0.pkg/豪爽接单. 时空剧社排练厅. 夜.mp4",
23
+ "src": "https://gcdncs.cn.ndhy.com/v0.1/static/edu_product/esp/assets/ec142981-949a-40d3-a930-60b19baedca0.pkg/豪爽接单. 时空剧社排练厅. 夜.mp4",
24
24
  "duration": 17.0
25
25
  },
26
26
  "video_logic_true": {
27
- "src": "https://gcdncs.101.com/v0.1/static/edu_product/esp/assets/9a72eb8f-f689-475a-b7da-59a7e2402225.pkg/评价:赞赏. 时空剧社排练厅. 夜.mp4",
27
+ "src": "https://gcdncs.cn.ndhy.com/v0.1/static/edu_product/esp/assets/9a72eb8f-f689-475a-b7da-59a7e2402225.pkg/评价:赞赏. 时空剧社排练厅. 夜.mp4",
28
28
  "duration": 31.0
29
29
  },
30
30
  "video_logic_false": {
31
- "src": "https://gcdncs.101.com/v0.1/static/edu_product/esp/assets/c45f9d78-6b9d-4bc1-af25-ec89bba8d77d.pkg/评价:勉励. 时空剧社排练厅. 夜.mp4",
31
+ "src": "https://gcdncs.cn.ndhy.com/v0.1/static/edu_product/esp/assets/c45f9d78-6b9d-4bc1-af25-ec89bba8d77d.pkg/评价:勉励. 时空剧社排练厅. 夜.mp4",
32
32
  "duration": 29.0
33
33
  }
34
34
  },
@@ -0,0 +1,11 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <body>
4
+ <button id="trigger" type="button">Trigger settlement</button>
5
+ <script>
6
+ document.getElementById('trigger').addEventListener('click', function () {
7
+ window.parent.postMessage('settle', '*')
8
+ })
9
+ </script>
10
+ </body>
11
+ </html>
@@ -1,8 +1,7 @@
1
1
  <!doctype html>
2
2
  <html lang="en">
3
- <head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>BranchVideo Player</title> <script type="module" crossorigin src="./assets/player-C043eI9W.js"></script>
4
- <link rel="stylesheet" crossorigin href="./assets/player-FYK_pFp2.css">
3
+ <head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>BranchVideo Player</title> <script type="module" crossorigin src="./assets/player-BhovFmYg.js"></script>
4
+ <link rel="stylesheet" crossorigin href="./assets/player-qJJgCEk8.css">
5
5
  </head>
6
6
  <body><div id="root"></div></body>
7
7
  </html>
8
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "branch-video-player-sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",