myCustomPreJoinPage function
- {PreJoinPageOptions? options,
- required Credentials credentials}
A custom pre-join page widget that can be used instead of the default MediaSFU pre-join page.
This widget displays a personalized welcome message and includes a button to proceed to the broadcast session.
Note: Ensure this widget is passed to MediasfuBroadcastOptions only when you intend to use a custom pre-join page.
Implementation
Widget myCustomPreJoinPage({
PreJoinPageOptions? options,
required Credentials credentials,
}) {
return Scaffold(
appBar: AppBar(
title: const Text('Welcome to MediaSFU Broadcast'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Hello, ${credentials.apiUserName}!',
style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
const SizedBox(height: 20),
const Text(
'Get ready to join your broadcast session.',
style: TextStyle(fontSize: 18),
),
const SizedBox(height: 40),
ElevatedButton(
onPressed: () {
// Proceed to the session by updating the validation status
if (options != null) {
options.parameters.updateValidated(true);
}
},
child: const Text('Join Now'),
),
],
),
),
);
}