Error with YouTube Player in FlutterFlow: "Uncaught Error: FormatException"

Widgets & Design

I'm encountering an issue with the YouTube Player widget in FlutterFlow. The problem occurs when I navigate to the page containing the YouTube Player. On some devices, the app shows the following error and eventually stops working:

Uncaught Error: FormatException: SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)

at Object.j (main.dart.js:3636:19)

at Object.bRa (main.dart.js:5926:9)

at aqo.rt (main.dart.js:52993:19)

at aAr.$1 (main.dart.js:134239:35)

at tear_off.<anonymous> (main.dart.js:3772:65)

at bgG.$1 (main.dart.js:134497:30)

at bpi.$1 (main.dart.js:55040:21)

The issue behaves differently depending on the platform:

  • On some devices: The page fails to load and the app becomes unresponsive.

  • On web browsers: The error is logged in the console, but the page continues to work.

    Has anyone else experienced this issue with the YouTube Player in FlutterFlow?

    Are there any known solutions or workarounds for resolving this error?

    Could this be related to specific JSON parsing requirements in the widget or app?

Thank you in advance for your help!

What have you tried so far?
  1. Adjusted YouTube Links:

    • Used only the video ID.

    • Tried embedding links.

    • Provided full YouTube URLs.

  2. Testing on a Separate Page:

    • Created a new, empty page with only the YouTube Player widget to test.

    • The error still occurs and becomes more frequent.

Despite these efforts, the issue persists. I'm not sure if the problem is with how I'm setting up the YouTube Player widget or if it's related to device-specific compatibility.

Did you check FlutterFlow's Documentation for this topic?
No
1