Youtube_player_flutter: The initial video id opens a new Browser page after upgrading to latest Flutter beta release 1.25.0-8.1.pre [BUG]

Created on 25 Dec 2020  Β·  12Comments  Β·  Source: sarbagyastha/youtube_player_flutter

The youtube_player_ifame opens a web browser of the youtube video (it shouldn't do so) once the player loads.


   @override
     void initState() {
       super.initState();
       dialogPickerColor = Colors.red;

    _controller = YoutubePlayerController(
      initialVideoId: '8oESM64gU5M',
      params: const YoutubePlayerParams(
        showControls: true,
        showFullscreenButton: false,
        desktopMode: false,
        privacyEnhanced: true,
      ),
    );
  }

Before upgrading Flutter it was working just as intended, but after upgrading flutter it started exiting the app and opening the browser page of the initialVideoId. I tried updating the youtube_player_iframe package to the latest release '1.2.0+2' but still the same issue.

Screenshots
Simulator Screen Shot - iPhone 12 Pro Max - 2020-12-25 at 19 49 23

Thank you for everything. :)

bug

Most helpful comment

Think I found a temporary fix. Downgrade to version 1.1.0 not ^1.1.0, since the caret indicates that it should either be 1.1.0 or later.
Please use the fork https://pub.dev/packages/youtube_plyr_iframe in the meantime.

It has nothing to do with Flutter nor Webview. The problem is url_launcher which was added in commit 3b6a053d37a76b5321deb1e54434a55014a59799

Edit: Pull Request for fix is out.

All 12 comments

I got the same symptom
Please fix it.
Thank for your wonderful package.

I'm on Flutter 1.22.5 β€’ channel stable

Same problem
params: YoutubePlayerParams( color: 'orange', captionLanguage: 'ru', interfaceLanguage: 'ru', enableCaption: true, autoPlay: true, showVideoAnnotations: false, showControls: true, desktopMode:true, showFullscreenButton: true, ),

[βœ“] Flutter (Channel beta, 1.24.0-10.2.pre, on macOS 11.0.1 20B50)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc2)
[βœ“] Xcode - develop for iOS and macOS (Xcode 11.3)
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 4.1)
[βœ“] Connected device (4 available)
! Error: iPhone (Витя) is not connected. Xcode will continue when iPhone (Витя) is connected. (code -13)

β€’ No issues found!

I think the problem is with flutter's WebView widget. It seems like when you pass it an Iframe, it opens it on a new page.

I think the problem is with flutter's WebView widget. It seems like when you pass it an Iframe, it opens it on a new page.

Would there anything we can try for this?

Think I found a temporary fix. Downgrade to version 1.1.0 not ^1.1.0, since the caret indicates that it should either be 1.1.0 or later.
Please use the fork https://pub.dev/packages/youtube_plyr_iframe in the meantime.

It has nothing to do with Flutter nor Webview. The problem is url_launcher which was added in commit 3b6a053d37a76b5321deb1e54434a55014a59799

Edit: Pull Request for fix is out.

This bug happens on previous versions too. Tested on flutter-1.23-candidate.18 and flutter-1.24-candidate.10

Think I found a temporary fix. Downgrade to version 1.1.0 not ^1.1.0, since the caret indicates that it should either be 1.1.0 or later.

It has nothing to do with Flutter nor Webview. The problem is url_launcher which was added in commit 3b6a053d37a76b5321deb1e54434a55014a59799

Edit: Pull Request for fix is out.

So, a minor fix may have that broken. :-D

I've noticed that the player is opening on a browser on iOS. Should this be happening?

Same behavior here, would be great if the PR could be merged πŸ‘

@jonatadashi Hi sir, i see that u already fixed in in your forked repo, how can i use your (iframe) repo as dependency in my apps ya?

@jonatadashi Hi sir, i see that u already fixed in in your forked repo, how can i use your (iframe) repo as dependency in my apps ya?

You can add the package like this in your pubspec.yaml:

youtube_player_iframe:
    git:
      url: https://github.com/jonatadashi/youtube_player_iframe.git

But it's always a good idea to fork the repo before, as it's not the main repo and you have no idea of what will be added πŸ‘

@jonatadashi Hi sir, i see that u already fixed in in your forked repo, how can i use your (iframe) repo as dependency in my apps ya?

@jonatadashi Hi sir, i see that u already fixed in in your forked repo, how can i use your (iframe) repo as dependency in my apps ya?

You can add the package like this in your pubspec.yaml:

youtube_player_iframe:
    git:
      url: https://github.com/jonatadashi/youtube_player_iframe.git

But it's always a good idea to fork the repo before, as it's not the main repo and you have no idea of what will be added πŸ‘

Better to use the fork on pub.dev. https://pub.dev/packages/youtube_plyr_iframe

@Akiat @jonatadashi thanks for the replies, btw do you guys also find issue that fullscreen button didnt showed onn ios simulator? It does show up in android phone.
I already add showFullscreenButton: true, but it still not showing

Was this page helpful?
0 / 5 - 0 ratings