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

Youtube #960

Merged
merged 12 commits into from
Dec 2, 2023
Merged

Youtube #960

merged 12 commits into from
Dec 2, 2023

Conversation

fullstackctp
Copy link
Collaborator

@fullstackctp fullstackctp commented Nov 7, 2023

Added video position indicator #983 #982

Copy link
Collaborator

@kmahmood74 kmahmood74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Everywhere change your class names to have capital T i.e. YouTube and YouTubeNative etc.
  2. Have you tested your code with multiple YouTube player instances on the same screen?


abstract class YoutubeWeb {
factory YoutubeWeb() => getInstance();
void createWebInstance();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't make sense to call it createWebInstance when the native has to implement it as well.
Similarly it does not make sense to call this abstract class YoutubeWeb when you know native class has to implement it as well.

Just call it YouTubeBase

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fullstackctp think about using export instead of import and have a library, look at webview as an example. It seems cleaner, what do you think?

@@ -0,0 +1,7 @@
import 'package:ensemble/widget/youtube/native/youtube_platform_native.dart'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem right as you are always importing the native libraries. So the native will be imported even for web? is it import or export?

just look at lib/widget/webview/webviewstate.dart to see how it should be done

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix the issue where the youtubeplayer doesn't work sometimes on the ensemble web studio. This issue is actually an issue from the package side.
sarbagyastha/youtube_player_flutter#819

In the issue, it was said to load the WebYoutubePlayerIframePlatform(). This requires importing libraries that work on the web only.

The native library doesn't get imported for the web. It is actually done in the same way as the lottie widget.

export 'native/lottiestate.dart' if (dart.library.html) 'web/lottiestate.dart';

I have tested multiple youtube widgets in the same screen. It doesn't load the video in the player in web. That is why I added the videoList for loading the multiple video in a single player. This problem exists in the demo that they provided. https://sarbagyastha.com.np/youtube_player_flutter/#/


YoutubeWeb getInstance() => YoutubeNativeInstance();

class YoutubeNativeInstance implements YoutubeWeb {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't make sense for YoutubeNativeInstance to implement YoutubeWeb. Your code should be understandable and nicely written. This doesn't make sense

@kmahmood74
Copy link
Collaborator

kmahmood74 commented Nov 10, 2023 via email

@kmahmood74
Copy link
Collaborator

@fullstackctp does it fix the multiple youtube players on the page issue?

@kmahmood74
Copy link
Collaborator

@fullstackctp please create a ticket or multiple tickets and link here. All your commits must have the ticket as the commit comment

@fullstackctp
Copy link
Collaborator Author

@fullstackctp does it fix the multiple youtube players on the page issue?

Yes. The recent commit i just did fixes that

@fullstackctp please create a ticket or multiple tickets and link here. All your commits must have the ticket as the commit comment

I have added new tickets and linked to this PR.

@kmahmood74 kmahmood74 requested review from snehmehta and removed request for vusters and kmahmood74 November 24, 2023 19:01
@kmahmood74
Copy link
Collaborator

@snehmehta kindly review this as well. this is deeper into flutter than I am comfortable reviewing

@kmahmood74
Copy link
Collaborator

@snehmehta please review this

@kmahmood74 kmahmood74 merged commit a2f9d8e into main Dec 2, 2023
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants