Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix some media bugs & support big video file #1024

Merged
merged 5 commits into from
Nov 29, 2021
Merged

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
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reuse image to reduce file size
2 participants