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

Experimental support for video player #1081

Merged
merged 17 commits into from
May 16, 2024

Conversation

ggichure
Copy link
Collaborator

@ggichure ggichure commented Jan 24, 2024

Pull Request Description

Issue Being Fixed

Issue Number: #383

Screenshots / Recordings

video_player.mov

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

@micahmo
Copy link
Member

micahmo commented Jan 30, 2024

Here's a post I came across recently that could help with testing!

https://programming.dev/post/9309147

@hjiangsu hjiangsu mentioned this pull request Mar 11, 2024
3 tasks
@micahmo micahmo mentioned this pull request Apr 11, 2024
@hjiangsu
Copy link
Member

hjiangsu commented Apr 18, 2024

I know this is in draft at the moment, but I'd like to just chime in that there is the option to only add partial support for videos in this PR!

We can extend video player functionality in future PRs to support edge cases 😊

Additionally, I'm not sure if you've noticed, but I've added an extra type to MediaType for videos. All PostViewMedia should be able to distinguish if its a video by checking postViewMedia.media.first.mediaType == MediaType.video. This might help simplify implementation a bit!

@ggichure ggichure requested a review from micahmo May 11, 2024 11:09
@ggichure ggichure marked this pull request as ready for review May 11, 2024 11:09
@ggichure ggichure requested a review from hjiangsu May 11, 2024 11:09
Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

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

Hey, I just wanted to say, this is super awesome, nice work! I especially love all the new settings! I think this is going to be a big hit.

I left some comments on the code, and I also had some overall thoughts after testing.

  • It seems like the preview of videos with no image from Lemmy are completely blank. I think we should at least have some icon to stand in, like the web icon for URLs with no preview. However, now that we have an in-app video player, we can use a video icon instead of the globe icon.
  • Some videos like this one never play. If there's an easy way to figure out which videos we support and which ones we don't, we can show the latter ones in the browser.
  • From your demo, it looks like some videos play with a white background. Is there any way to make that black?

lib/core/enums/video_auto_play.dart Show resolved Hide resolved
lib/core/enums/video_playback_speed.dart Show resolved Hide resolved
lib/core/enums/local_settings.dart Outdated Show resolved Hide resolved
lib/l10n/app_en.arb Outdated Show resolved Hide resolved
lib/settings/pages/video_player_settings.dart Outdated Show resolved Hide resolved
lib/settings/pages/video_player_settings.dart Outdated Show resolved Hide resolved
lib/settings/pages/video_player_settings.dart Outdated Show resolved Hide resolved
lib/settings/pages/video_player_settings.dart Outdated Show resolved Hide resolved
lib/settings/pages/video_player_settings.dart Outdated Show resolved Hide resolved
pubspec.yaml Outdated Show resolved Hide resolved
@ggichure
Copy link
Collaborator Author

It seems like the preview of videos with no image from Lemmy are completely blank. I think we should at least have some icon to stand in, like the web icon for URLs with no preview. However, now that we have an in-app video player, we can use a video icon instead of the globe icon.

Resolved.

From your demo, it looks like some videos play with a white background. Is there any way to make that black?

Resolved

Some videos like this one never play. If there's an easy way to figure out which videos we support and which ones we don't, we can show the latter ones in the browser.

At the moment , I have no way of checking for this.

@hjiangsu
Copy link
Member

Once again, thanks for working on this! I'll be testing it out over the next few days to see if I can find any issues running it. I'll do a code review of it once I've tested it out 😄

@hjiangsu
Copy link
Member

Just did some quick testing on this and there are a couple of things I'd like to adjust, but they might be better suited for separate PRs given that this one is already quite large!

What are your thoughts on merging this in first, and then applying additional PRs in the future? @micahmo

@micahmo
Copy link
Member

micahmo commented May 15, 2024

I guess it depends on what you had in mind (whether the user experience will be poor without your suggestions, or whether they're more like enhancements). I think it also depends on whether you're planning a full release soon. But I'm totally fine with getting this in now. 😊

@hjiangsu
Copy link
Member

hjiangsu commented May 15, 2024

The main thing I had in mind was to adjust the logic to work alongside parsePostView and MediaView so that all the post parsing logic is centralized. By centralizing the logic to parsePostView, this might also help reduce the instances where we have this issue:

Some videos like this one never play. If there's an easy way to figure out which videos we support and which ones we don't, we can show the latter ones in the browser.

I did a quick code review and I think the core implementation of the video player (video player widgets, video settings, etc.) are good, so there shouldn't be many changes coming from there! Thanks again for implementing all those settings, especially for the first implementation 😁

And of course, @ggichure feel free to let me know if you'd prefer to work on my proposed changes (in which case, I can go into some more details about them) 😅

I think it also depends on whether you're planning a full release soon.

I'd like to get initial/experimental video support in for the next full release, but I don't have a timeline for when the full release will be. I don't think there is a rush to get a full release soon either since the current version should already be compatible with Lemmy 0.19.4!

Thoughts? @micahmo @ggichure

@micahmo
Copy link
Member

micahmo commented May 15, 2024

Agreed on all points! 😊

@ggichure
Copy link
Collaborator Author

@hjiangsu ,Sure, do go ahead with the proposed changes.

@micahmo
Copy link
Member

micahmo commented May 16, 2024

BTW, since this PR introduces new settings, keep in mind it'll have conflicts with #1348. I don't really care which ones goes first. 😊

@hjiangsu
Copy link
Member

I'll go ahead and merge this in first!

@hjiangsu hjiangsu merged commit ad01238 into thunder-app:develop May 16, 2024
1 check 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.

None yet

3 participants