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
710 stars 823 forks source link

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

Open inc16sec opened 3 years ago

inc16sec commented 3 years ago

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. :)

english-aha-center commented 3 years ago

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

I'm on Flutter 1.22.5 • channel stable

snoopdoggy322 commented 3 years ago

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!

david4ahmed commented 3 years ago

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.

english-aha-center commented 3 years ago

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?

jonafeucht commented 3 years ago

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.

pablo-threadable commented 3 years ago

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

pablo-threadable commented 3 years ago

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?

Akiat commented 3 years ago

Same behavior here, would be great if the PR could be merged 👍

slorop41314 commented 3 years ago

@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?

Akiat commented 3 years ago

@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 👍

jonafeucht commented 3 years ago

@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

slorop41314 commented 3 years ago

@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