jclic 2.1.21 → 2.1.23

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.
Files changed (175) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/jclic-node.js +9 -8
  3. package/dist/jclic-node.js.map +1 -1
  4. package/dist/jclic.min.js +2 -2
  5. package/dist/jclic.min.js.map +1 -1
  6. package/package.json +4 -4
  7. package/src/GlobalData.js +1 -1
  8. package/src/JClicPlayer.js +2 -2
  9. package/src/bags/MediaBag.js +6 -5
  10. package/dist/1078.jclic-node.js +0 -282
  11. package/dist/1078.jclic-node.js.map +0 -1
  12. package/dist/1196.jclic-node.js +0 -808
  13. package/dist/1196.jclic-node.js.map +0 -1
  14. package/dist/1253.jclic-node.js +0 -1432
  15. package/dist/1253.jclic-node.js.map +0 -1
  16. package/dist/13.jclic-node.js +0 -103
  17. package/dist/13.jclic-node.js.map +0 -1
  18. package/dist/1567.jclic-node.js +0 -2313
  19. package/dist/1567.jclic-node.js.map +0 -1
  20. package/dist/1588.jclic-node.js +0 -602
  21. package/dist/1588.jclic-node.js.map +0 -1
  22. package/dist/1725.jclic-node.js +0 -836
  23. package/dist/1725.jclic-node.js.map +0 -1
  24. package/dist/1731.jclic-node.js +0 -438
  25. package/dist/1731.jclic-node.js.map +0 -1
  26. package/dist/1842.jclic-node.js +0 -651
  27. package/dist/1842.jclic-node.js.map +0 -1
  28. package/dist/2160.jclic-node.js +0 -1016
  29. package/dist/2160.jclic-node.js.map +0 -1
  30. package/dist/222.jclic-node.js +0 -129
  31. package/dist/222.jclic-node.js.map +0 -1
  32. package/dist/2316.jclic-node.js +0 -949
  33. package/dist/2316.jclic-node.js.map +0 -1
  34. package/dist/2355.jclic-node.js +0 -371
  35. package/dist/2355.jclic-node.js.map +0 -1
  36. package/dist/2366.jclic-node.js +0 -431
  37. package/dist/2366.jclic-node.js.map +0 -1
  38. package/dist/2379.jclic-node.js +0 -202
  39. package/dist/2379.jclic-node.js.map +0 -1
  40. package/dist/2437.jclic-node.js +0 -450
  41. package/dist/2437.jclic-node.js.map +0 -1
  42. package/dist/2531.jclic-node.js +0 -869
  43. package/dist/2531.jclic-node.js.map +0 -1
  44. package/dist/2608.jclic-node.js +0 -160
  45. package/dist/2608.jclic-node.js.map +0 -1
  46. package/dist/2715.jclic-node.js +0 -554
  47. package/dist/2715.jclic-node.js.map +0 -1
  48. package/dist/277.jclic-node.js +0 -22
  49. package/dist/277.jclic-node.js.map +0 -1
  50. package/dist/2921.jclic-node.js +0 -660
  51. package/dist/2921.jclic-node.js.map +0 -1
  52. package/dist/2952.jclic-node.js +0 -101
  53. package/dist/2952.jclic-node.js.map +0 -1
  54. package/dist/3018.jclic-node.js +0 -421
  55. package/dist/3018.jclic-node.js.map +0 -1
  56. package/dist/3019.jclic-node.js +0 -682
  57. package/dist/3019.jclic-node.js.map +0 -1
  58. package/dist/3231.jclic-node.js +0 -274
  59. package/dist/3231.jclic-node.js.map +0 -1
  60. package/dist/331.jclic-node.js +0 -115
  61. package/dist/331.jclic-node.js.map +0 -1
  62. package/dist/3391.jclic-node.js +0 -276
  63. package/dist/3391.jclic-node.js.map +0 -1
  64. package/dist/3502.jclic-node.js +0 -671
  65. package/dist/3502.jclic-node.js.map +0 -1
  66. package/dist/3653.jclic-node.js +0 -982
  67. package/dist/3653.jclic-node.js.map +0 -1
  68. package/dist/371.jclic.min.js +0 -2
  69. package/dist/371.jclic.min.js.map +0 -1
  70. package/dist/3856.jclic-node.js +0 -575
  71. package/dist/3856.jclic-node.js.map +0 -1
  72. package/dist/4112.jclic-node.js +0 -659
  73. package/dist/4112.jclic-node.js.map +0 -1
  74. package/dist/4123.jclic-node.js +0 -910
  75. package/dist/4123.jclic-node.js.map +0 -1
  76. package/dist/427.jclic-node.js +0 -894
  77. package/dist/427.jclic-node.js.map +0 -1
  78. package/dist/4483.jclic-node.js +0 -327
  79. package/dist/4483.jclic-node.js.map +0 -1
  80. package/dist/4548.jclic-node.js +0 -1078
  81. package/dist/4548.jclic-node.js.map +0 -1
  82. package/dist/466.jclic-node.js +0 -99
  83. package/dist/466.jclic-node.js.map +0 -1
  84. package/dist/485.jclic-node.js +0 -783
  85. package/dist/485.jclic-node.js.map +0 -1
  86. package/dist/4921.jclic-node.js +0 -500
  87. package/dist/4921.jclic-node.js.map +0 -1
  88. package/dist/5091.jclic-node.js +0 -239
  89. package/dist/5091.jclic-node.js.map +0 -1
  90. package/dist/520.jclic-node.js +0 -550
  91. package/dist/520.jclic-node.js.map +0 -1
  92. package/dist/5312.jclic-node.js +0 -1126
  93. package/dist/5312.jclic-node.js.map +0 -1
  94. package/dist/5338.jclic-node.js +0 -212
  95. package/dist/5338.jclic-node.js.map +0 -1
  96. package/dist/5344.jclic-node.js +0 -229
  97. package/dist/5344.jclic-node.js.map +0 -1
  98. package/dist/5550.jclic-node.js +0 -238
  99. package/dist/5550.jclic-node.js.map +0 -1
  100. package/dist/5626.jclic-node.js +0 -614
  101. package/dist/5626.jclic-node.js.map +0 -1
  102. package/dist/5977.jclic-node.js +0 -1081
  103. package/dist/5977.jclic-node.js.map +0 -1
  104. package/dist/6148.jclic-node.js +0 -345
  105. package/dist/6148.jclic-node.js.map +0 -1
  106. package/dist/6176.jclic-node.js +0 -481
  107. package/dist/6176.jclic-node.js.map +0 -1
  108. package/dist/6221.jclic-node.js +0 -1072
  109. package/dist/6221.jclic-node.js.map +0 -1
  110. package/dist/6238.jclic-node.js +0 -718
  111. package/dist/6238.jclic-node.js.map +0 -1
  112. package/dist/6454.jclic-node.js +0 -1413
  113. package/dist/6454.jclic-node.js.map +0 -1
  114. package/dist/6565.jclic-node.js +0 -294
  115. package/dist/6565.jclic-node.js.map +0 -1
  116. package/dist/6579.jclic-node.js +0 -719
  117. package/dist/6579.jclic-node.js.map +0 -1
  118. package/dist/6715.jclic-node.js +0 -148
  119. package/dist/6715.jclic-node.js.map +0 -1
  120. package/dist/6777.jclic-node.js +0 -171
  121. package/dist/6777.jclic-node.js.map +0 -1
  122. package/dist/6782.jclic-node.js +0 -1611
  123. package/dist/6782.jclic-node.js.map +0 -1
  124. package/dist/6847.jclic-node.js +0 -601
  125. package/dist/6847.jclic-node.js.map +0 -1
  126. package/dist/6856.jclic-node.js +0 -252
  127. package/dist/6856.jclic-node.js.map +0 -1
  128. package/dist/696.jclic-node.js +0 -1821
  129. package/dist/696.jclic-node.js.map +0 -1
  130. package/dist/698.jclic-node.js +0 -583
  131. package/dist/698.jclic-node.js.map +0 -1
  132. package/dist/704.jclic-node.js +0 -80
  133. package/dist/704.jclic-node.js.map +0 -1
  134. package/dist/7046.jclic-node.js +0 -735
  135. package/dist/7046.jclic-node.js.map +0 -1
  136. package/dist/7220.jclic-node.js +0 -156
  137. package/dist/7220.jclic-node.js.map +0 -1
  138. package/dist/7257.jclic-node.js +0 -931
  139. package/dist/7257.jclic-node.js.map +0 -1
  140. package/dist/743.jclic-node.js +0 -583
  141. package/dist/743.jclic-node.js.map +0 -1
  142. package/dist/757.jclic-node.js +0 -1072
  143. package/dist/757.jclic-node.js.map +0 -1
  144. package/dist/7781.jclic-node.js +0 -202
  145. package/dist/7781.jclic-node.js.map +0 -1
  146. package/dist/7912.jclic-node.js +0 -2103
  147. package/dist/7912.jclic-node.js.map +0 -1
  148. package/dist/827.jclic-node.js +0 -708
  149. package/dist/827.jclic-node.js.map +0 -1
  150. package/dist/8276.jclic-node.js +0 -409
  151. package/dist/8276.jclic-node.js.map +0 -1
  152. package/dist/8322.jclic-node.js +0 -498
  153. package/dist/8322.jclic-node.js.map +0 -1
  154. package/dist/8641.jclic-node.js +0 -360
  155. package/dist/8641.jclic-node.js.map +0 -1
  156. package/dist/8837.jclic-node.js +0 -651
  157. package/dist/8837.jclic-node.js.map +0 -1
  158. package/dist/8895.jclic-node.js +0 -151
  159. package/dist/8895.jclic-node.js.map +0 -1
  160. package/dist/9072.jclic-node.js +0 -1285
  161. package/dist/9072.jclic-node.js.map +0 -1
  162. package/dist/9078.jclic-node.js +0 -935
  163. package/dist/9078.jclic-node.js.map +0 -1
  164. package/dist/9103.jclic-node.js +0 -718
  165. package/dist/9103.jclic-node.js.map +0 -1
  166. package/dist/9359.jclic-node.js +0 -145
  167. package/dist/9359.jclic-node.js.map +0 -1
  168. package/dist/9409.jclic-node.js +0 -921
  169. package/dist/9409.jclic-node.js.map +0 -1
  170. package/dist/9513.jclic-node.js +0 -720
  171. package/dist/9513.jclic-node.js.map +0 -1
  172. package/dist/9704.jclic-node.js +0 -81
  173. package/dist/9704.jclic-node.js.map +0 -1
  174. package/dist/9950.jclic-node.js +0 -827
  175. package/dist/9950.jclic-node.js.map +0 -1
@@ -1,659 +0,0 @@
1
- "use strict";
2
- exports.id = 4112;
3
- exports.ids = [4112,2355];
4
- exports.modules = {
5
-
6
- /***/ 2355:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "default": () => (/* binding */ media_MediaContent)
13
- });
14
-
15
- // UNUSED EXPORTS: MediaContent
16
-
17
- // EXTERNAL MODULE: external "jquery"
18
- var external_jquery_ = __webpack_require__(7750);
19
- var external_jquery_default = /*#__PURE__*/__webpack_require__.n(external_jquery_);
20
- // EXTERNAL MODULE: ./src/AWT.js
21
- var AWT = __webpack_require__(7912);
22
- // EXTERNAL MODULE: ./src/Utils.js
23
- var Utils = __webpack_require__(1253);
24
- ;// ./src/media/icons/generic.svg
25
- const generic_namespaceObject = "<svg height=\"48\" viewBox=\"0 0 48 48\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M28.8 12L28 8H10v34h4V28h11.2l.8 4h14V12z\" />\n</svg>\n";
26
- ;// ./src/media/icons/audio.svg
27
- const audio_namespaceObject = "<svg fill=\"#000000\" height=\"48\" viewBox=\"0 0 24 24\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z\" />\n</svg>\n";
28
- ;// ./src/media/icons/mic.svg
29
- const mic_namespaceObject = "<svg fill=\"#000000\" height=\"48\" viewBox=\"0 0 24 24\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z\" />\n</svg>\n";
30
- ;// ./src/media/icons/movie.svg
31
- const movie_namespaceObject = "<svg fill=\"#000000\" height=\"48\" viewBox=\"0 0 24 24\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z\" />\n</svg>\n";
32
- ;// ./src/media/icons/music.svg
33
- const music_namespaceObject = "<svg fill=\"#000000\" height=\"48\" viewBox=\"0 0 24 24\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z\" />\n</svg>\n";
34
- ;// ./src/media/icons/url.svg
35
- const url_namespaceObject = "<svg fill=\"#000000\" height=\"48\" viewBox=\"0 0 24 24\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z\" />\n</svg>\n";
36
- ;// ./src/media/MediaContent.js
37
- /**
38
- * File : media/MediaContent.js
39
- * Created : 13/04/2015
40
- * By : Francesc Busquets <francesc@gmail.com>
41
- *
42
- * JClic.js
43
- * An HTML5 player of JClic activities
44
- * https://projectestac.github.io/jclic.js
45
- *
46
- * @source https://github.com/projectestac/jclic.js
47
- *
48
- * @license EUPL-1.2
49
- * @licstart
50
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
51
- *
52
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
53
- * the European Commission- subsequent versions of the EUPL (the "Licence");
54
- * You may not use this work except in compliance with the Licence.
55
- *
56
- * You may obtain a copy of the Licence at:
57
- * https://joinup.ec.europa.eu/software/page/eupl
58
- *
59
- * Unless required by applicable law or agreed to in writing, software
60
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
61
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
62
- * Licence for the specific language governing permissions and limitations
63
- * under the Licence.
64
- * @licend
65
- * @module
66
- */
67
-
68
- /* global Image */
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- /**
82
- * This object contains a description of any multimedia content (sound, video, MIDI, voice
83
- * recording..) or special actions (jump to another point in the sequence, link to an URL, etc.)
84
- * associated to an {@link module:boxes/ActiveBox.ActiveBox ActiveBox} object.
85
- */
86
- class MediaContent {
87
- /**
88
- * MediaContent constructor
89
- * @param {string} type - The type of media. Valid values are: `UNKNOWN`, `PLAY_AUDIO`, `PLAY_VIDEO`,
90
- * `PLAY_MIDI`, `PLAY_CDAUDIO`, `RECORD_AUDIO`, `PLAY_RECORDED_AUDIO`, `RUN_CLIC_ACTIVITY`,
91
- * `RUN_CLIC_PACKAGE`, `RUN_EXTERNAL`, `URL`, `EXIT` and `RETURN`
92
- * @param {string} [file] - Optional parameter indicating the media file name
93
- */
94
- constructor(type, file) {
95
- this.type = type;
96
- if (file)
97
- this.file = file;
98
- }
99
-
100
- /**
101
- * Loads the MediaContent settings from a specific JQuery XML element
102
- * @param {external:jQuery} $xml
103
- */
104
- setProperties($xml) {
105
- (0,Utils/* attrForEach */.GM)($xml.get(0).attributes, (name, val) => {
106
- switch (name) {
107
- case 'type':
108
- this.type = val;
109
- break;
110
- case 'file':
111
- this.file = (0,Utils/* nSlash */.c4)(val);
112
- break;
113
- case 'params':
114
- this.externalParam = (0,Utils/* nSlash */.c4)(val);
115
- break;
116
-
117
- case 'pFrom':
118
- this.absLocationFrom = val;
119
- break;
120
-
121
- case 'buffer':
122
- this.recBuffer = Number(val);
123
- break;
124
- case 'level':
125
- case 'from':
126
- case 'to':
127
- case 'length':
128
- this[name] = Number(val);
129
- break;
130
-
131
- case 'px':
132
- case 'py':
133
- if (this.absLocation === null)
134
- this.absLocation = new AWT/* Point */.bR(0, 0);
135
- if (name === 'px')
136
- this.absLocation.x = Number(val);
137
- else
138
- this.absLocation.y = Number(val);
139
- break;
140
-
141
- case 'stretch':
142
- case 'free':
143
- case 'catchMouseEvents':
144
- case 'loop':
145
- case 'autostart':
146
- this[name] = (0,Utils/* getBoolean */.pW)(val);
147
- break;
148
- }
149
- });
150
- return this;
151
- }
152
-
153
- /**
154
- * Gets a object with the basic attributes needed to rebuild this instance excluding functions,
155
- * parent references, constants and also attributes retaining the default value.
156
- * The resulting object is commonly usued to serialize elements in JSON format.
157
- * @returns {object} - The resulting object, with minimal attrributes
158
- */
159
- getAttributes() {
160
- return (0,Utils/* getAttr */.iu)(this, [
161
- 'type', 'file', 'externalParam',
162
- 'absLocation', // -> AWT.Point
163
- 'absLocationFrom', 'recBuffer',
164
- 'level|1', 'from', 'to', 'length',
165
- 'stretch', 'free', 'catchMouseEvents', 'loop', 'autostart'
166
- ]);
167
- }
168
-
169
- /**
170
- * Reads the properties of this MediaContent from a data object
171
- * @param {object} data - The data object to be parsed
172
- * @returns {module:media/MediaContent.MediaContent}
173
- */
174
- setAttributes(data) {
175
- return (0,Utils/* setAttr */.ob)(this, data, [
176
- 'type', 'file', 'externalParam',
177
- { key: 'absLocation', fn: AWT/* Point */.bR },
178
- 'absLocationFrom', 'recBuffer',
179
- 'level', 'from', 'to', 'length',
180
- 'stretch', 'free', 'catchMouseEvents', 'loop', 'autostart',
181
- ]);
182
- }
183
-
184
- /**
185
- * Compares this object with another MediaContent.
186
- * @param {module:media/MediaContent.MediaContent} mc - The Media Content to compare against to.
187
- * @returns {boolean} - `true` when both objects are equivalent.
188
- */
189
- isEquivalent(mc) {
190
- return this.type === mc.type &&
191
- (this.file === mc.file ||
192
- this.file !== null && mc.file !== null &&
193
- this.file.toLocaleLowerCase() === mc.file.toLocaleLowerCase()) &&
194
- this.from === mc.from &&
195
- this.to === mc.to &&
196
- this.recBuffer === mc.recBuffer;
197
- }
198
-
199
- /**
200
- * Gets a string representing this media content, useful for checking if two different elements
201
- * are equivalent.
202
- * @returns {string}
203
- */
204
- getDescription() {
205
- let result = `${this.type}`;
206
- if (this.file)
207
- result = `${result} ${this.file}${this.from >= 0 ? ` from:${this.from}` : ''}${this.to >= 0 ? ` to:${this.to}` : ''}`;
208
- else if (this.externalParam)
209
- result = `${result} ${this.externalParam}`;
210
- return result;
211
- }
212
-
213
- /**
214
- * Returns a simplified description of this media content. Useful for accessibility methods.
215
- * @returns {string}
216
- */
217
- toString() {
218
- return `${this.type}${this.file ? ` ${this.file}` : ''}`;
219
- }
220
-
221
- /**
222
- * Returns an image to be used as icon for representing this media content.
223
- * @returns {external:HTMLImageElement}
224
- */
225
- getIcon() {
226
- let icon = null;
227
- switch (this.type) {
228
- case 'PLAY_AUDIO':
229
- case 'PLAY_RECORDED_AUDIO':
230
- icon = 'audio';
231
- break;
232
- case 'RECORD_AUDIO':
233
- icon = 'mic';
234
- break;
235
- case 'PLAY_VIDEO':
236
- icon = 'movie';
237
- break;
238
- case 'PLAY_MIDI':
239
- icon = 'music';
240
- break;
241
- case 'URL':
242
- icon = 'url';
243
- break;
244
- default:
245
- icon = 'generic';
246
- break;
247
- }
248
- return icon ? MediaContent.ICONS[icon] : null;
249
- }
250
- }
251
-
252
- Object.assign(MediaContent.prototype, {
253
- /**
254
- * The type of media. Valid values are: `UNKNOWN`, `PLAY_AUDIO`, `PLAY_VIDEO`,
255
- * `PLAY_MIDI`, `PLAY_CDAUDIO`, `RECORD_AUDIO`, `PLAY_RECORDED_AUDIO`, `RUN_CLIC_ACTIVITY`,
256
- * `RUN_CLIC_PACKAGE`, `RUN_EXTERNAL`, `URL`, `EXIT` and `RETURN`
257
- * @name module:media/MediaContent.MediaContent#type
258
- * @type {string} */
259
- type: 'UNKNOWN',
260
- /**
261
- * The priority level is important when different medias want to play together. Objects with
262
- * highest priority level can mute lower ones.
263
- * @name module:media/MediaContent.MediaContent#level
264
- * @type {number} */
265
- level: 1,
266
- /**
267
- * Media file name
268
- * @name module:media/MediaContent.MediaContent#file
269
- * @type {string} */
270
- file: null,
271
- /**
272
- * Optional parameters passed to external calls
273
- * @name module:media/MediaContent.MediaContent#externalParams
274
- * @type {string} */
275
- externalParam: null,
276
- /**
277
- * Special setting used to play only a fragment of media. `-1` means not used (plays full
278
- * length, from the beginning)
279
- * @name module:media/MediaContent.MediaContent#from
280
- * @type {number} */
281
- from: -1,
282
- /**
283
- * Special setting used to play only a fragment of media. `-1` means not used (plays to the end
284
- * of the media)
285
- * @name module:media/MediaContent.MediaContent#to
286
- * @type {number} */
287
- to: -1,
288
- /**
289
- * When `type` is `RECORD_AUDIO`, this member stores the maximum length of the recorded
290
- * sound, in seconds.
291
- * @name module:media/MediaContent.MediaContent#length
292
- * @type {number} */
293
- length: 3,
294
- /**
295
- * When `type` is `RECORD_AUDIO`, this member stores the buffer ID where the recording
296
- * will be stored.
297
- * @name module:media/MediaContent.MediaContent#recBuffer
298
- * @type {number} */
299
- recBuffer: 0,
300
- /**
301
- * Whether to stretch or not the video size to fit the cell space.
302
- * @name module:media/MediaContent.MediaContent#stretch
303
- * @type {boolean} */
304
- stretch: false,
305
- /**
306
- * When `true`, the video plays out of the cell, centered on the activity window.
307
- * @name module:media/MediaContent.MediaContent#free
308
- * @type {boolean} */
309
- free: false,
310
- /**
311
- * Places the video window at a specific location.
312
- * @name module:media/MediaContent.MediaContent#absLocation
313
- * @type {module:AWT.Point} */
314
- absLocation: null,
315
- /**
316
- * When {@link module:media/MediaContent.MediaContent#absLocation} is not `null`, this field indicates from where to
317
- * measure its coordinates. Valid values are: `BOX`, `WINDOW` or `FRAME`.
318
- * @name module:media/MediaContent.MediaContent#absLocationFrom
319
- * @type {string} */
320
- absLocationFrom: null,
321
- /**
322
- * `true` when the video window must catch mouse clicks.
323
- * @name module:media/MediaContent.MediaContent#catchMouseEvents
324
- * @type {boolean} */
325
- catchMouseEvents: false,
326
- /**
327
- * Whether to repeat the media in loop, or just one time.
328
- * @name module:media/MediaContent.MediaContent#loop
329
- * @type {boolean} */
330
- loop: false,
331
- /**
332
- * When `true`, the media will automatically start playing when the associated {@link module:boxes/ActiveBox.ActiveBox ActiveBox}
333
- * become active.
334
- * @name module:media/MediaContent.MediaContent#autoStart
335
- * @type {boolean} */
336
- autoStart: false,
337
- });
338
-
339
- /**
340
- * Default icons for media types.
341
- * @type {object} */
342
- const ICONS = {
343
- generic: generic_namespaceObject,
344
- audio: audio_namespaceObject,
345
- movie: movie_namespaceObject,
346
- mic: mic_namespaceObject,
347
- music: music_namespaceObject,
348
- url: url_namespaceObject,
349
- };
350
-
351
- /**
352
- * Collection of icon {@link external:HTMLImageElement} objects
353
- * @name module:media/MediaContent.MediaContent.ICONS
354
- * @type {object} */
355
- MediaContent.ICONS = {};
356
-
357
- // Load the icons
358
- external_jquery_default().each(ICONS, (key, value) => {
359
- const img = new Image();
360
- img.src = (0,Utils/* svgToURI */.g8)(value);
361
- MediaContent.ICONS[key] = img;
362
- });
363
-
364
- /* harmony default export */ const media_MediaContent = (MediaContent);
365
-
366
-
367
- /***/ }),
368
-
369
- /***/ 570:
370
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
371
-
372
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
373
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
374
- /* harmony export */ });
375
- /* unused harmony export ProjectSettings */
376
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7750);
377
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
378
- /* harmony import */ var _media_EventSounds_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5338);
379
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1253);
380
- /**
381
- * File : project/ProjectSettings.js
382
- * Created : 01/04/2015
383
- * By : Francesc Busquets <francesc@gmail.com>
384
- *
385
- * JClic.js
386
- * An HTML5 player of JClic activities
387
- * https://projectestac.github.io/jclic.js
388
- *
389
- * @source https://github.com/projectestac/jclic.js
390
- *
391
- * @license EUPL-1.2
392
- * @licstart
393
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
394
- *
395
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
396
- * the European Commission- subsequent versions of the EUPL (the "Licence");
397
- * You may not use this work except in compliance with the Licence.
398
- *
399
- * You may obtain a copy of the Licence at:
400
- * https://joinup.ec.europa.eu/software/page/eupl
401
- *
402
- * Unless required by applicable law or agreed to in writing, software
403
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
404
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
405
- * Licence for the specific language governing permissions and limitations
406
- * under the Licence.
407
- * @licend
408
- * @module
409
- */
410
-
411
- /* global window */
412
-
413
-
414
-
415
-
416
-
417
- /**
418
- * This class contains miscellaneous settings of JClic projects.
419
- *
420
- * In addition to the members of this class, there can be other properties in JClic project files
421
- * that are not currently loaded:
422
- * - iconFileName
423
- * - descriptors
424
- * - area
425
- * - level
426
- * - locale
427
- * - authors
428
- * - organizations
429
- * - revisions
430
- */
431
- class ProjectSettings {
432
- /**
433
- * ProjectSettings constructor
434
- * @param {module:project/JClicProject.JClicProject} project - The project to which this settings belongs
435
- */
436
- constructor(project) {
437
- this.project = project;
438
- this.authors = [];
439
- this.organizations = [];
440
- this.revisions = [];
441
- this.languages = [];
442
- this.locales = [];
443
- this.description = {};
444
- this.tags = {};
445
- }
446
-
447
- /**
448
- * Reads the ProjectSettings values from a JQuery XML element
449
- * @param {external:jQuery} $xml - The XML element to parse
450
- */
451
- setProperties($xml) {
452
- let single_description = null;
453
- const multiple_descriptions = [];
454
-
455
- $xml.children().each((_n, child) => {
456
- switch (child.nodeName) {
457
- case 'title':
458
- this.title = child.textContent;
459
- break;
460
- case 'description':
461
- single_description = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .getXmlNodeText */ .H_)(child);
462
- break;
463
- case 'descriptions':
464
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(child).children().each((_n, desc) => multiple_descriptions.push((0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .parseXmlNode */ .Fy)(desc)));
465
- break;
466
- case 'author':
467
- this.authors.push((0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .reduceTextsToStrings */ .DC)((0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .parseXmlNode */ .Fy)(child)));
468
- break;
469
- case 'organization':
470
- this.organizations.push((0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .reduceTextsToStrings */ .DC)((0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .parseXmlNode */ .Fy)(child)));
471
- break;
472
- case 'revision':
473
- const revision = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .reduceTextsToStrings */ .DC)((0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .parseXmlNode */ .Fy)(child));
474
- if (revision.date)
475
- revision.date = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .parseOldDate */ .DV)(revision.date);
476
- this.revisions.push(revision);
477
- break;
478
- case 'language':
479
- this.languages.push((0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .cleanOldLanguageTag */ .bG)(child.textContent));
480
- break;
481
- case 'eventSounds':
482
- this.eventSounds = new _media_EventSounds_js__WEBPACK_IMPORTED_MODULE_1__["default"]();
483
- this.eventSounds.setProperties(jquery__WEBPACK_IMPORTED_MODULE_0___default()(child));
484
- break;
485
- case 'skin':
486
- this.skinFileName = jquery__WEBPACK_IMPORTED_MODULE_0___default()(child).attr('file');
487
- break;
488
- case 'descriptors':
489
- this.tags = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .parseXmlNode */ .Fy)(child, true);
490
- if (this.tags['#text']) {
491
- this.tags.other = this.tags['#text'].textContent;
492
- delete this.tags['#text'];
493
- }
494
- break;
495
- case 'license':
496
- this.license = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .getXmlNodeText */ .H_)(child);
497
- break;
498
- case 'cover':
499
- case 'thumb':
500
- const img = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .getXmlNodeText */ .H_)(child);
501
- if (img.file)
502
- this[child.nodeName] = img.file;
503
- break;
504
- }
505
- });
506
-
507
- this.buildLocales();
508
-
509
- multiple_descriptions.forEach(d => {
510
- if (d.language && d.text)
511
- this.description[d.language] = d.text;
512
- });
513
-
514
- if (single_description && this.languages.length > 0 && !this.description[this.languages[0]])
515
- this.description[this.languages[0]] = single_description;
516
-
517
- return this;
518
- }
519
-
520
- buildLocales() {
521
- // Try to find an array of valid locales
522
- // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl
523
- if (this.languages.length > 0 && window.Intl && window.Intl.getCanonicalLocales) {
524
- this.locales = [];
525
- this.languages.forEach(lang => {
526
- // Languages usually are stored in the form: "English (en)"
527
- const matches = /\(([a-z,A-Z,-]+)\)/.exec(lang);
528
- if (matches && matches.length > 1) {
529
- try {
530
- const canonicals = window.Intl.getCanonicalLocales(matches[1]);
531
- if (canonicals)
532
- this.locales = this.locales.concat(canonicals);
533
- } catch (_err) {
534
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .log */ .Rm)('error', `Invalid language: ${lang}`);
535
- }
536
- }
537
- });
538
- }
539
- return this;
540
- }
541
-
542
- /**
543
- * Gets a object with the basic attributes needed to rebuild this instance excluding functions,
544
- * parent references, constants and also attributes retaining the default value.
545
- * The resulting object is commonly usued to serialize elements in JSON format.
546
- * @returns {object} - The resulting object, with minimal attrributes
547
- */
548
- getAttributes() {
549
- return (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .getAttr */ .iu)(this, [
550
- 'title', 'description',
551
- 'tags', 'languages', 'license',
552
- 'authors', 'organizations',
553
- 'revisions',
554
- 'cover', 'thumb',
555
- 'skinFileName', 'eventSounds'
556
- ]);
557
- }
558
-
559
- /**
560
- * Reads the properties of this ProjectSettings from a data object
561
- * @param {object} data - The data object to be parsed, or just the text content
562
- * @returns {module:project/ProjectSettings.ProjectSettings}
563
- */
564
- setAttributes(data) {
565
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__/* .setAttr */ .ob)(this, data, [
566
- 'title', 'description',
567
- 'tags', 'languages', 'license',
568
- 'authors', 'organizations',
569
- 'revisions',
570
- 'cover', 'thumb',
571
- 'skinFileName', 'eventSounds'
572
- ]);
573
-
574
- // Build Date objects in revisions
575
- if (this.revisions)
576
- this.revisions.forEach(rv => {
577
- if (rv.date)
578
- rv.date = new Date(rv.date);
579
- });
580
-
581
- return this.buildLocales();
582
- }
583
- }
584
-
585
- Object.assign(ProjectSettings.prototype, {
586
- /**
587
- * The JClicProject to which this ProjectSettings belongs
588
- * @name module:project/ProjectSettings.ProjectSettings#project
589
- * @type {module:project/JClicProject.JClicProject} */
590
- project: null,
591
- /**
592
- * The project title
593
- * @name module:project/ProjectSettings.ProjectSettings#title
594
- * @type {string} */
595
- title: 'Untitled',
596
- /**
597
- * The authors of this project.
598
- * Each author is represented by an object with the following attributes:
599
- * `name` (mandatory), `mail`, `rol`, `organization` and `url`
600
- * @name module:project/ProjectSettings.ProjectSettings#authors
601
- * @type {object[]} */
602
- authors: null,
603
- /**
604
- * Schools, companies and other institutions involved on this project.
605
- * Each organization is represented by an object with the following attributes:
606
- * `name` (mandatory), `mail`, `url`, `address`, `pc`, `city`, `state`, `country`, `comments`
607
- * @name module:project/ProjectSettings.ProjectSettings#organizations
608
- * @type {object[]} */
609
- organizations: null,
610
- /**
611
- * The history of revisions made to this project.
612
- * Revisions are represented by objects with the following attributes:
613
- * `date` (mandatory), `description`, `comments` and `author`
614
- * @name module:project/ProjectSettings.ProjectSettings#revisions
615
- * @type {object[]} */
616
- revisions: null,
617
- /**
618
- * Project's description, maybe in multiple languages.
619
- * @name module:project/ProjectSettings.ProjectSettings#description
620
- * @type {object} */
621
- description: null,
622
- /**
623
- * JClic projects can use more than one language, so use a string array
624
- * @name module:project/ProjectSettings.ProjectSettings#languages
625
- * @type {string[]} */
626
- languages: null,
627
- tags: null,
628
- cover: null,
629
- thumb: null,
630
- license: {
631
- type: 'by-nc-sa',
632
- url: 'https://creativecommons.org/licenses/by-nc-sa/4.0',
633
- },
634
- /**
635
- * Array of canonical locales, as defined in
636
- * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation|Intl}
637
- * @name module:project/ProjectSettings.ProjectSettings#locales
638
- * @type {string[]} */
639
- locales: null,
640
- /**
641
- * The name of an optional 'skin' (visual aspect) can be set for the whole project, or for each {@link module:Activity.Activity Activity}
642
- * @name module:project/ProjectSettings.ProjectSettings#skinFileName
643
- * @type {string} */
644
- skinFileName: null,
645
- /**
646
- * The main {@link module:media/EventSounds.EventSounds EventSounds} object of the project
647
- * @name module:project/ProjectSettings.ProjectSettings#eventSounds
648
- * @type {module:media/EventSounds.EventSounds} */
649
- eventSounds: new _media_EventSounds_js__WEBPACK_IMPORTED_MODULE_1__["default"](),
650
- });
651
-
652
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProjectSettings);
653
-
654
-
655
- /***/ })
656
-
657
- };
658
- ;
659
- //# sourceMappingURL=4112.jclic-node.js.map