sarbagyastha / youtube_player_flutter

A Flutter plugin for inline playback or streaming of YouTube videos using the official iFrame Player API.
https://youtube.sarbagyastha.com.np
BSD 3-Clause "New" or "Revised" License
692 stars 784 forks source link

[BUG] Video is not playing when changing to fullscreen mode #370

Open cerireyhan opened 3 years ago

cerireyhan commented 3 years ago

After starting the video, rotating the device or switching to fullscreen mode through the controls stops the video and it produces the error message below.

MissingPluginException: MissingPluginException(No implementation found for method evaluateJavascript on channel com.pichillilorenzo/flutter_inappwebview_2) File "platform_channel.dart", line 159, in MethodChannel._invokeMethod File "<asynchronous suspension>" File "in_app_webview_controller.dart", line 1350, in InAppWebViewController.evaluateJavascript File "<asynchronous suspension>" File "unparsed"

Steps to reproduce the behavior:

  1. Start the video
  2. Enable fullscreen mode
  3. Video stops playing

    • OS: iOS & Android
    • Plugin Version 7.0.0+7

Similar issue: https://github.com/sarbagyastha/youtube_player_flutter/issues/242

artem-bakuta commented 3 years ago

same issue

liu-yang-10antz commented 3 years ago

I fix like this:

in full_screen_button.dart @override Widget build(BuildContext context) { return IconButton( icon: Icon( _controller.value.isFullScreen ? Icons.fullscreen_exit : Icons.fullscreen, color: widget.color, ), onPressed: () => { _controller.pause(), Future.delayed(Duration(milliseconds: 200)).then((e) { _controller.toggleFullScreenMode(); }) }, ); }

stefanicarol commented 3 years ago

some solution to this problem ?