mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-15 19:29:03 +02:00
feat: add Ken Burns effect, fix caption visibility and Facebook binary upload
- Add slow zoom/pan (Ken Burns) effect to each image slide, cycling through 8 deterministic presets per image index for natural variety - CapCut-style captions: semi-transparent pill background + yellow glow on active word; background/text now only visible while voice is speaking - Fix Facebook error 6000: pass Node.js Buffer directly instead of unsafe ArrayBuffer pool-slice conversion which could corrupt the upload payload - Fix TypeScript error: replace u-flag emoji regex with BMP surrogate pairs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
487a8ee352
commit
5d7ab93bf8
3 files changed
+8
-24
No files matched your search
@@ -378,8 +378,7 @@ remotionRouter.post("/publish", async (req, res) => {
|
||||
console.log(`🚀 Publishing to ${page.pageName} (direct binary upload)...`);
|
||||
// Upload video bytes directly — Facebook cannot access local URLs
|
||||
const videoBuffer = await fs.promises.readFile(localPath);
|
||||
const arrayBuffer = videoBuffer.buffer.slice(videoBuffer.byteOffset, videoBuffer.byteOffset + videoBuffer.byteLength) as ArrayBuffer;
|
||||
const reelId = await facebookService.publishVideoFromBuffer(page, arrayBuffer, description || "");
|
||||
const reelId = await facebookService.publishVideoFromBuffer(page, videoBuffer, description || "");
|
||||
await dbStorage.updateScheduledPost(scheduledPost.id, { publishedAt: new Date(), externalPostId: reelId });
|
||||
results.push({ pageId, success: true, reelId });
|
||||
} else {
|
||||
|
||||
@@ -78,8 +78,7 @@ export class FacebookService {
|
||||
? path.join(process.cwd(), videoMedia.originalUrl)
|
||||
: videoMedia.originalUrl;
|
||||
const nodeBuffer = await fs.promises.readFile(localPath);
|
||||
const arrayBuffer = nodeBuffer.buffer.slice(nodeBuffer.byteOffset, nodeBuffer.byteOffset + nodeBuffer.byteLength) as ArrayBuffer;
|
||||
return await this.publishVideoFromBuffer(page, arrayBuffer, post.content);
|
||||
return await this.publishVideoFromBuffer(page, nodeBuffer, post.content);
|
||||
} else {
|
||||
// Default to feed
|
||||
const imageMedia = mediaList.filter(m => m.type === 'image');
|
||||
@@ -568,7 +567,7 @@ export class FacebookService {
|
||||
*/
|
||||
async publishVideoFromBuffer(
|
||||
page: SocialPage,
|
||||
videoBuffer: ArrayBuffer,
|
||||
videoBuffer: Buffer | ArrayBuffer,
|
||||
description?: string
|
||||
): Promise<string> {
|
||||
if (!page.accessToken) throw new Error('No access token found for this page');
|
||||
|
||||
Reference in new issue
Block a user