thomaswp / snap-replay

"Video"-like replayer for Snap logs
1 stars 1 forks source link

Forcing a language #7

Open cvetelinandreev opened 2 years ago

cvetelinandreev commented 2 years ago

What would be a good way to force a Language on the playback side?

I played a bit with the code and this works in some cases. However it is not a good solution: playback.js, line 330.

setTimeout(() => {
    this.snapWindow.recorder.constructor.setRecordScale(this.script.config.blockScale);

    setTimeout(() => {
        this.snapWindow.recorder.constructor.setLanguage(this.script.config.language);

        setTimeout(() => {
            this.snapWindow.recorder.constructor.resetSnap(this.script.startXML);
        }, 1000);    
    }, 1000);    
}, 1000);

This is related somehow with #2

cvetelinandreev commented 2 years ago

Another observation:

resetSnap() is invoked on rewind. Since the project loading is async, the record logs are executed before the project gets loaded. The result is sporadic. Attached is a project to test with. 1) Start the playback. 2) Fast forward at 66%. 3) Then rewind to 33%

Archive.zip