cm-chessboard 5.5.7 → 5.5.9
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.
|
@@ -34,9 +34,10 @@
|
|
|
34
34
|
setTimeout(() => {
|
|
35
35
|
chessboard.movePiece("e7", "e5", true).then(() => {
|
|
36
36
|
setTimeout(() => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
chessboard.recorderStop().then((url) => {
|
|
38
|
+
const video = document.getElementById("videoOut")
|
|
39
|
+
video.src = url
|
|
40
|
+
})
|
|
40
41
|
}, 100)
|
|
41
42
|
})
|
|
42
43
|
}, 400)
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ export class RenderVideo extends Extension {
|
|
|
17
17
|
this.images = []
|
|
18
18
|
this.makeSpriteInline()
|
|
19
19
|
this.registerExtensionPoint(EXTENSION_POINT.animation, (event) => {
|
|
20
|
-
console.log(event)
|
|
20
|
+
// console.log(event)
|
|
21
21
|
if (this.recorder && this.recorder.state === "recording") {
|
|
22
22
|
setTimeout(() => {
|
|
23
23
|
this.cloneImageAndRender()
|
|
@@ -25,7 +25,7 @@ export class RenderVideo extends Extension {
|
|
|
25
25
|
}
|
|
26
26
|
})
|
|
27
27
|
this.registerMethod("recorderStart", () => {
|
|
28
|
-
if(this.recorder && this.recorder.state === "recording") {
|
|
28
|
+
if (this.recorder && this.recorder.state === "recording") {
|
|
29
29
|
console.error("recorder is running")
|
|
30
30
|
return
|
|
31
31
|
}
|
|
@@ -58,14 +58,17 @@ export class RenderVideo extends Extension {
|
|
|
58
58
|
* returns the url of the recorded media
|
|
59
59
|
*/
|
|
60
60
|
this.registerMethod("recorderStop", () => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
return new Promise((resolve, reject) => {
|
|
62
|
+
if (!this.recorder || this.recorder.state !== "recording") {
|
|
63
|
+
reject("recorder is not recording")
|
|
64
|
+
}
|
|
65
|
+
this.recorder.requestData()
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
this.recorder.stop()
|
|
68
|
+
console.log("recorder", this.recorder.state)
|
|
69
|
+
resolve(URL.createObjectURL(new Blob(this.recordedData, {type: this.props.mediaType})))
|
|
70
|
+
}, 100)
|
|
71
|
+
})
|
|
69
72
|
})
|
|
70
73
|
}
|
|
71
74
|
|