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] On orientation to landscape while video is being played, the video does not play, gets stuck #351

Open minal2709 opened 4 years ago

minal2709 commented 4 years ago

Describe the bug While the video is playing, if we change the orientation, the video shows a || pause in the center and does not play. even the pause button is not clickable.

To Reproduce Play a video, change the orientation of the phone.

Expected behavior It should continue playing in landscape mode

Screenshots

IMG_9408

Technical Details:

Additional context

csacchetti commented 4 years ago

I also found this bug. In iOS it runs very good but in Android it has this problem. I put the api at 20, but the problem remains.

zjamshidi commented 4 years ago

I have the same problem on Android. When I change the orientation, the video pauses.

minal2709 commented 4 years ago

I also get this error:

[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method evaluateJavascript on channel com.pichillilorenzo/flutter_inappwebview_1) E/flutter (30387): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7) E/flutter (30387): E/flutter (30387): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12) E/flutter (30387): #2 InAppWebViewController.evaluateJavascript (package:flutter_inappwebview/src/in_app_webview_controller.dart:1350:31) E/flutter (30387): #3 YoutubePlayerController._callMethod (package:youtube_player_flutter/src/utils/youtube_player_controller.dart:173:32) E/flutter (30387): #4 YoutubePlayerController.pause (package:youtube_player_flutter/src/utils/youtube_player_controller.dart:187:19) E/flutter (30387): #5 _TestScreenState.getYoutubeWidget. (package:avtaar/screens/TestScreen.dart:79:21) E/flutter (30387): #6 _YoutubePlayerBuilderState.didChangeMetrics (package:youtube_player_flutter/src/widgets/youtube_player_builder.dart:60:67) E/flutter (30387): #7 WidgetsBinding.handleMetricsChanged (package:flutter/src/widgets/binding.dart:540:16) E/flutter (30387): #8 _rootRun (dart:async/zone.dart:1190:13) E/flutter (30387): #9 _CustomZone.run (dart:async/zone.dart:1093:19) E/flutter (30387): #10 _CustomZone.runGuarded (dart:async/zone.dart:997:7) E/flutter (30387): #11 _invoke (dart:ui/hooks.dart:253:10) E/flutter (30387): #12 _updateWindowMetrics (dart:ui/hooks.dart:55:3)

MrJohn2014 commented 4 years ago

Same issue here. Also i tried code below. It works just on ios, but not on android devices. Please solve this bug. onEnterFullScreen: (){ Future.delayed(const Duration(seconds: 1), () { _controller.play(); }); },

sallypeters commented 3 years ago

I have the reverse of this issue - When we rotate to Landscape - no issue, video plays straight away ... but when we rotate back to Portrait , the video stops and we need to manually press the play button ...