Youtube_player_flutter: PlatformException(evaluateJavaScript_failed, Failed evaluating JavaScript, JavaScript string was: 'play()'

Created on 9 Sep 2019  ·  3Comments  ·  Source: sarbagyastha/youtube_player_flutter

Hi there,

There is an issue with the youtube_player_flutter on iPhone XS version 12.3.1.

Exception:
Unhandled Exception: PlatformException(evaluateJavaScript_failed, Failed evaluating JavaScript, JavaScript string was: 'play()'
Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={WKJavaScriptExceptionLineNumber=1, WKJavaScriptExceptionMessage=ReferenceError: Can't find variable: play, WKJavaScriptExceptionColumnNumber=5, WKJavaScriptExceptionSourceURL=about:blank, NSLocalizedDescription=A JavaScript exception occurred})

pubspec.yaml:
youtube_player_flutter: ^4.1.0

doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.13.6 17G65, locale en-VN)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.1)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.4)
[✓] Connected device (1 available)

• No issues found!

Btw, love the plugin though :)

Most helpful comment

I am having the same issue. Do you find any solution for this?

All 3 comments

I am having the same issue. Do you find any solution for this?

I have same issue.
flutter: Video mounted YoutubePlayerValue(isReady: false, isEvaluationReady: false, isLoaded: false, duration: 0:00:00.000000, position: 0:00:00.000000, buffered: 0.0, isPlaying: false, volume: 100, playerState: PlayerState.UNKNOWN, playbackRate: PlaybackRate.NORMAL, errorCode: 0)
flutter: Video mounted YoutubePlayerValue(isReady: false, isEvaluationReady: false, isLoaded: false, duration: 0:00:00.000000, position: 0:00:00.000000, buffered: 0.0, isPlaying: false, volume: 100, playerState: PlayerState.UNKNOWN, playbackRate: PlaybackRate.NORMAL, errorCode: 0)
[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: PlatformException(evaluateJavaScript_failed, Failed evaluating JavaScript, JavaScript string was: 'play()'
Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={WKJavaScriptExceptionLineNumber=1, WKJavaScriptExceptionMessage=ReferenceError: Can't find variable: play, WKJavaScriptExceptionColumnNumber=5, WKJavaScriptExceptionSourceURL=about:blank, NSLocalizedDescription=A JavaScript exception occurred})

0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)

1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33)

2 MethodChannelWebViewPlatform.evaluateJavascript (package:webview_flutter/src/webview_method_channel.dart:90:21)

3 WebViewController.evaluateJavascript (package:webview_flutter/webview_flutter.dart:626:39)

4 YoutubePlayerController._evaluateJS (package:youtube_player_flutter/src/youtube_pl<…>

Check #79

Was this page helpful?
0 / 5 - 0 ratings