StoryboardHandler (#37): breaks the project's script into a numbered scene-by-scene breakdown (description + image prompt per scene) via OpenAI in JSON mode (added json_mode support to OpenAiDriver for reliable structured output), stored as a JSON asset. VideoGenerationHandler (#38): generates one still image per storyboard scene via StabilityAI — the scene *visuals*, not motion/video clips (no text-to-video model integrated; see the task comment for why). VideoEditingHandler (#39): the step that actually produces a video file — assembles the scene stills into an MP4 via ffmpeg's concat demuxer, timed to the voiceover audio's duration (probed via ffprobe) or a fixed per-scene duration if there's no audio, then muxes the audio track in. Verified against the real ffmpeg/ffprobe binaries on this box, not just Process::fake(). Asset previews (#45, #46): a reusable partial renders each asset inline by type — image/audio/video get real playback elements, text/ JSON gets a truncated <pre> block, everything else a download link. Wired into both the awaiting_approval step view (so approving/ rejecting is an actual content review, not just a word count) and a general project assets grid. Also fixes a latent bug in AssetStorage::url(), found while wiring up previews: it called Storage::url() on the default 'local' disk, which has no configured URL driver and throws in production — only worked before because Storage::fake() is more permissive than the real local driver. Now serves assets through a new authenticated streaming route instead (VideoProjectAssetController). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
59 lines
2.1 KiB
PHP
59 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Support\AiProviders\AiProviderManager;
|
|
use App\Support\AiProviders\ElevenLabsDriver;
|
|
use App\Support\AiProviders\OpenAiDriver;
|
|
use App\Support\AiProviders\StabilityAiDriver;
|
|
use App\Support\Publishing\LinkedInPublisher;
|
|
use App\Support\Publishing\PublisherManager;
|
|
use App\Support\Publishing\RedditPublisher;
|
|
use App\Support\Publishing\TwitterPublisher;
|
|
use App\Support\Publishing\WordPressPublisher;
|
|
use App\Support\VideoWorkflow\StepHandlers\ScriptGenerationHandler;
|
|
use App\Support\VideoWorkflow\StepHandlers\StepHandlerManager;
|
|
use App\Support\VideoWorkflow\StepHandlers\StoryboardHandler;
|
|
use App\Support\VideoWorkflow\StepHandlers\TtsVoiceoverHandler;
|
|
use App\Support\VideoWorkflow\StepHandlers\VideoEditingHandler;
|
|
use App\Support\VideoWorkflow\StepHandlers\VideoGenerationHandler;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(PublisherManager::class, fn ($app) => new PublisherManager([
|
|
$app->make(WordPressPublisher::class),
|
|
$app->make(RedditPublisher::class),
|
|
$app->make(TwitterPublisher::class),
|
|
$app->make(LinkedInPublisher::class),
|
|
]));
|
|
|
|
$this->app->singleton(AiProviderManager::class, fn ($app) => new AiProviderManager([
|
|
'openai' => $app->make(OpenAiDriver::class),
|
|
'stability_ai' => $app->make(StabilityAiDriver::class),
|
|
'elevenlabs' => $app->make(ElevenLabsDriver::class),
|
|
]));
|
|
|
|
$this->app->singleton(StepHandlerManager::class, fn ($app) => new StepHandlerManager([
|
|
$app->make(ScriptGenerationHandler::class),
|
|
$app->make(TtsVoiceoverHandler::class),
|
|
$app->make(StoryboardHandler::class),
|
|
$app->make(VideoGenerationHandler::class),
|
|
$app->make(VideoEditingHandler::class),
|
|
]));
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
//
|
|
}
|
|
}
|