Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] App crash on iOS #1056

Open
1 task done
wer-mathurin opened this issue Mar 3, 2025 · 1 comment
Open
1 task done

[BUG] App crash on iOS #1056

wer-mathurin opened this issue Mar 3, 2025 · 1 comment
Assignees

Comments

@wer-mathurin
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Package

youtube_player_iframe (Default)

What happened?

The app simply crash hen opening a video on iOS.
This is cause by flutter_webview

The workaround is to add this:

dependency_overrides: 
  webview_flutter_wkwebview : 3.18.3

What is the expected behaviour?

Not crash :-)

How to reproduce?

class VideoWidget extends StatefulWidget {
  const VideoWidget({required this.videoId, super.key});

  final String videoId;

  @override
  State<VideoWidget> createState() => _VideoWidgetState();
}

class _VideoWidgetState extends State<VideoWidget> {
  late final YoutubePlayerController _controller;

  @override
  void initState() {
    super.initState();

    _controller = YoutubePlayerController(
        params: const YoutubePlayerParams(
      showControls: false,
      strictRelatedVideos: true,
    ));

    _controller.loadVideoById(videoId: widget.videoId, startSeconds: 0);
  }

  @override
  Widget build(BuildContext context) {
    final player = YoutubePlayer(
      controller: _controller,
    );

    return YoutubePlayerControllerProvider(
      controller: _controller,
      child: Column(
        children: [
          player,
        ],
      ),
    );
  }
}

Flutter Doctor Output

[✓] Flutter (Channel stable, 3.27.3, on macOS 14.5 23F79 darwin-arm64, locale en-CA)
    • Flutter version 3.27.3 on channel stable at /Users/lmm/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c519ee916e (6 weeks ago), 2025-01-21 10:32:23 -0800
    • Engine revision e672b006cb
    • Dart version 3.6.1
    • DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc2)
    • Android SDK at /Users/lmm/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0-rc2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)

[✓] VS Code (version 1.97.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.104.0
@wer-mathurin
Copy link
Author

@sarbagyastha
To resolve this issue you need to update the dependencies in the pubspec.yaml.

@sarbagyastha
I can create a PR if you need one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants