Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error code parsing is problematic #989

Open
1 task done
panghy opened this issue Sep 12, 2024 · 0 comments
Open
1 task done

[BUG] Error code parsing is problematic #989

panghy opened this issue Sep 12, 2024 · 0 comments
Assignees

Comments

@panghy
Copy link

panghy commented Sep 12, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Package

youtube_player_flutter

What happened?

The current code in raw_youtube_player.dart (line 189) could fail if args actually contains int (as int.parse will throw is it's already an int). This prevents us from trapping any player errors.

[JavaScript Handler "Errors"] type 'int' is not a subtype of type 'String'
#0      _RawYoutubePlayerState.build.<anonymous closure>.<anonymous closure> (package:youtube_player_flutter/src/player/raw_youtube_player.dart:189:72)
#1      IOSInAppWebViewController._handleMethod (package:flutter_inappwebview_ios/src/in_app_webview/in_app_webview_controller.dart:1538:73)
#2      InternalChannelController.initMethodCallHandler.<anonymous closure> (package:flutter_inappwebview_platform_interface/src/util.dart:631:30)
#3      MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:571:55)
#4      MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:564:34)
#5      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:581:35)
#6      _invoke2 (dart:ui/hooks.dart:344:13)
#7      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45:5)

What is the expected behaviour?

The code should not fault if args already contains ints and not strings.

How to reproduce?

Try to play a video that is region blocked or no longer available.

Flutter Doctor Output

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants