Skip to content

Commit

Permalink
v0.9.5: Update mp4_2_sb3 to add tiling and firefox/safari partial sup…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
ZXMushroom63 committed Jul 11, 2024
1 parent c9fb1f2 commit 93898c2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions static/mp4_2_sb3.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ <h1>[Scratch++] .mp4 to .sb3 packager</h1>
Status:
Processed frames:
Saved sheets:
Saved assets:
</span>
<br>
<progress id="progressBar" min=0 max=100 value=0></progress><br>
Expand All @@ -59,7 +60,8 @@ <h1>[Scratch++] .mp4 to .sb3 packager</h1>
var progInfo = {
status: "Awaiting input...",
processedFrames: 0,
sheets: 0
sheets: 0,
assets: 0
}
function wait(d) {
return new Promise((res, rej)=>{
Expand Down Expand Up @@ -94,7 +96,8 @@ <h1>[Scratch++] .mp4 to .sb3 packager</h1>
elems.progInfo.innerHTML = `
Status: ${progInfo.status}<br>
Processed frames: ${progInfo.processedFrames}<br>
Saved spritesheets: ${progInfo.sheets} (try to keep this below 200 to avoid auto-bans. Hint: use tiling variable!)<br>
Saved spritesheets: ${progInfo.sheets}<br>
Saved assets: ${progInfo.assets} (try to keep this below 200 to avoid auto-bans. Hint: use tiling variable!)
`;
}
updateProgInfo();
Expand Down Expand Up @@ -184,6 +187,7 @@ <h1>[Scratch++] .mp4 to .sb3 packager</h1>
}
progInfo.processedFrames = 0;
progInfo.sheets = 0;
progInfo.assets = 0;
progInfo.status = "Init";
updateProgInfo();
res = [480, 360].map((x)=>{return x * parseFloat(elems.resolutionControls.value)});
Expand Down Expand Up @@ -276,9 +280,11 @@ <h1>[Scratch++] .mp4 to .sb3 packager</h1>
"sampleCount": saples,
"md5ext": storedAudio.fileName
});
progInfo.assets += 1;
Object.assign(callbackStorageLoc, generateAudioCallback(positionInTime, "s"+i));
await new Promise(r => setTimeout(r, 9));
elems.progressBar.value = (i / audioEpochsToBePackaged) * 100;
updateProgInfo();
}
}

Expand Down Expand Up @@ -319,6 +325,7 @@ <h1>[Scratch++] .mp4 to .sb3 packager</h1>
"rotationCenterY": res[1] / 2 //360
});
progInfo.sheets += 1;
progInfo.assets += 1;
tilingCtx.fillRect(0, 0, res[0], res[1]);
}

Expand Down Expand Up @@ -806,7 +813,7 @@ <h1>[Scratch++] .mp4 to .sb3 packager</h1>
1,
[
10,
"Packaged with MP4 2 SCRATCH\nhttps://github.com/ZXMushroom63/mp4-to-scratch"
"Packaged with Scratch++ .mp4 converter\nhttps://github.com/ZXMushroom63/scratch-gui"
]
]
},
Expand Down

0 comments on commit 93898c2

Please sign in to comment.