feat: add mobile Remotion video generator with image, text, audio, and Facebook publishing features.

This commit is contained in:
Michael committed 2026-03-25 16:16:30 +01:00
1 parent 3d51fdc90b
commit e1a6d1e06c
4 files changed
+19 -4

No files matched your search

+9 -1
View File
@@ -1,3 +1,5 @@
import fs from 'fs';
import path from 'path';
import { storage } from '../storage';
import type { Post, SocialPage, Media } from '@shared/schema';
import { imageProcessor } from './imageProcessor';
@@ -71,7 +73,13 @@ export class FacebookService {
throw new Error('Reels require a video media');
}
return await this.publishReel(page, resolvePublicUrl(videoMedia.originalUrl), post.content);
// Upload video bytes directly — Facebook cannot fetch local/Docker URLs
const localPath = videoMedia.originalUrl.startsWith('/')
? 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.publishReelFromBuffer(page, arrayBuffer, post.content);
} else {
// Default to feed
const imageMedia = mediaList.filter(m => m.type === 'image');