MediaPlayback constructor
MediaPlayback(
- Iterable<
Uri> resources, { - required WidgetBuilder onLoadFailed,
- WidgetBuilder? onLoading,
- PlayerConfiguration configuration = const PlayerConfiguration(muted: true, protocolWhitelist: _protocolWhitelist),
- VideoControllerConfiguration? videoCtrlConfiguration,
- Key? key,
Construct MediaPlayback with predefined preferences.
It should not be built during widget test due to behavourial of Dart's built in client. Therefore, UnsupportedError will be thrown if attempted to build it.
Implementation
MediaPlayback(Iterable<Uri> resources,
{required this.onLoadFailed,
this.onLoading,
this.configuration = const PlayerConfiguration(
muted: true, protocolWhitelist: _protocolWhitelist),
this.videoCtrlConfiguration,
super.key})
: resources = List.unmodifiable(resources) {
if (isTesting) {
throw UnsupportedError(
"No real network interaction allowed during test, and it should never be built.");
}
}