Skip to content

Fix some media bugs & support big video file #1024

Merged
gitbrent merged 5 commits intogitbrent:masterfrom
canwdev:master
Nov 29, 2021
Merged

Fix some media bugs & support big video file #1024
gitbrent merged 5 commits intogitbrent:masterfrom
canwdev:master

Conversation

@canwdev
Copy link
Contributor

@canwdev canwdev commented Nov 5, 2021

  • Fix: addMediaDefinition ext and cover
  • Support big video files: demo
slide.addMedia({
	x: 1.0,
	y: 2.2,
	w: imgWidth,
	h: imgHeight,
	type: "video",
	path: videoUrl,
	ext: "mp4", // fix file extension name, Sometimes the url does not contain the suffix name
	cover: imgData.base64, // video cover base64 string
	isFsPath: true, // Let node.js read the file directly instead of converting to base64
});
// Use stream output directly
const fileData = await pptx.stream({
	compression: false,
});
console.log("createWriteStream...");
const out = fs.createWriteStream(savePath);
fileData.pipe(out).on("finish", () => {
	console.log("Success!");
});

@canwdev canwdev changed the title Fix some bugs & support big file Fix some media bugs & support big video file Nov 5, 2021
@gitbrent
Copy link
Owner

Thanks @canwdev !

@gitbrent gitbrent linked an issue Nov 29, 2021 that may be closed by this pull request
gitbrent added a commit that referenced this pull request Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reuse image to reduce file size

2 participants