newtaDev / pod_player

Video player for flutter web & mobile devices, Play video from youtube or vimeo or network in flutter using pod player
https://pub.dev/packages/pod_player
MIT License
96 stars 159 forks source link

Flutter Web YOUTUBE API ERROR: XMLHttpRequest error. #73

Open cia1099 opened 1 year ago

cia1099 commented 1 year ago

I had followed the instruction and settled up flutter_cors I used the same example code to run on web. I got the error:

===== YOUTUBE API ERROR: XMLHttpRequest error. ==========
Error: XMLHttpRequest error.
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49  throw_
packages/pod_player/src/controllers/pod_player_controller.dart 73:9           _checkAndWaitTillInitialized$
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54            runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5            _async
packages/pod_player/src/controllers/pod_player_controller.dart 64:44          [_checkAndWaitTillInitialized]
packages/pod_player/src/controllers/pod_player_controller.dart 82:11          _checkAndWaitTillInitialized$
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50            <fn>
dart-sdk/lib/async/zone.dart 1653:54                                          runUnary
dart-sdk/lib/async/future_impl.dart 147:18                                    handleValue
dart-sdk/lib/async/future_impl.dart 766:44                                    handleValueCallback
dart-sdk/lib/async/future_impl.dart 795:13                                    _propagateToListeners
dart-sdk/lib/async/future_impl.dart 557:7                                     [_complete]
dart-sdk/lib/async/future.dart 421:15                                         <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19       internalCallback

Environment:

fail to load image


Have someone got the same problem?

SKnoedler commented 1 year ago

Hello! Please check the readme: run dart pub global activate flutter_cors && fluttercors --disable, close your chrome instance and rerun. Good Luck!

aytunch commented 1 year ago

Hi @SKnoedler if we deploy our Flutter web app, then will this flutter_cors workaround be still helpful? Or can we not run this plugin in production for Web?

SKnoedler commented 1 year ago

Hi @SKnoedler if we deploy our Flutter web app, then will this flutter_cors workaround be still helpful? Or can we not run this plugin in production for Web?

you cannot use that for production. For production check this https://docs.flutter.dev/development/platform-integration/web/web-images

shabbirdudhiya commented 2 months ago

@SKnoedler how did you solve it?