initVideoPlayer method
Implementation
@override
Future<Map<String, dynamic>> initVideoPlayer(String id, String url,
{String? title}) async {
final context = AppbridgenewPlatform.instance.navigatorKey.currentContext;
if (context != null) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => VideoPlayerPage(
videoId: id,
videoUrl: url,
title: title,
appBridge: Appbridgenew(),
),
),
);
return {
'id': id,
'status': 'success',
'message': 'VideoPlayerPage opened successfully'
};
} else {
return {
'id': id,
'status': 'failed',
'message': 'BuildContext is null, could not navigate.'
};
}
}