open method
Implementation
@override
Future<PlatformResult<void>> open(
String source, {
bool play = true,
bool loop = false,
}) => _run(() async {
_ready = false;
_failure = null;
_publish();
await _disposeController();
final resolved = await resolveMediaSource(source);
if (!resolved.isSuccess) {
_failure = resolved.failure;
_publish();
return PlatformResult.failure(resolved.failure, resolved.details);
}
final controller = _createController(Uri.parse(resolved.value!));
_controller = controller;
controller.addListener(_publish);
await controller.initialize().timeout(const Duration(seconds: 20));
await controller.setLooping(loop);
_ready = true;
if (play) await controller.play();
_publish();
return const PlatformResult.success();
});