Add comprehensive studio mode support and stream organization
- Implement studio mode transition workflow with Go Live buttons - Add collapsible team grouping for better stream organization - Include source locking functionality for newly created streams - Enhance footer status indicators with improved visual styling - Create triggerTransition API endpoint for studio mode operations - Add CollapsibleGroup component for expandable content sections 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
07028b0792
commit
3bad71cb26
8 changed files with 603 additions and 116 deletions
62
app/api/triggerTransition/route.ts
Normal file
62
app/api/triggerTransition/route.ts
Normal file
|
@ -0,0 +1,62 @@
|
|||
import { NextResponse } from 'next/server';
|
||||
import { getOBSClient } from '../../../lib/obsClient';
|
||||
|
||||
export async function POST() {
|
||||
try {
|
||||
const obsClient = await getOBSClient();
|
||||
|
||||
// Check if studio mode is active
|
||||
const { studioModeEnabled } = await obsClient.call('GetStudioModeEnabled');
|
||||
|
||||
if (!studioModeEnabled) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
error: 'Studio mode is not enabled',
|
||||
message: 'Studio mode must be enabled to trigger transitions'
|
||||
},
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
// Trigger the studio mode transition (preview to program)
|
||||
await obsClient.call('TriggerStudioModeTransition');
|
||||
console.log('Successfully triggered studio mode transition');
|
||||
|
||||
// Get the updated scene information after transition
|
||||
const [programResponse, previewResponse] = await Promise.all([
|
||||
obsClient.call('GetCurrentProgramScene'),
|
||||
obsClient.call('GetCurrentPreviewScene')
|
||||
]);
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
data: {
|
||||
programScene: programResponse.currentProgramSceneName,
|
||||
previewScene: previewResponse.currentPreviewSceneName
|
||||
},
|
||||
message: 'Successfully transitioned preview to program'
|
||||
});
|
||||
} catch (obsError) {
|
||||
console.error('OBS WebSocket error during transition:', obsError);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
error: 'Failed to trigger transition in OBS',
|
||||
details: obsError instanceof Error ? obsError.message : 'Unknown error'
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error triggering transition:', error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
error: 'Failed to connect to OBS or trigger transition'
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue