play method
Implementation
@override
Future<void> play(String url) async {
if (url.isEmpty) {
throw ArgumentError('URL cannot be empty');
}
try {
_currentUrl = url;
_updateState(PlayerState.loading);
_clearError();
// Wait for platform view creation on Android
if (Platform.isAndroid && _viewId == null) {
await Future.delayed(const Duration(milliseconds: 100));
}
await _platformChannel.invokePlay(url, viewId: _viewId);
} catch (e) {
_updateState(PlayerState.error);
_errorMessage = e.toString();
notifyListeners();
}
}