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

Minimizing mode #258

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Minimizing mode #258

wants to merge 12 commits into from

Conversation

Rikveet
Copy link

@Rikveet Rikveet commented Apr 25, 2023

PIP MODE IN THE APP

Although pip mode was implemented for the Android app. It was missing the mini video mode which is available in the Twitch app.

This is a quality-of-life update to the app.

Feature implemented:

Twitch.App.mp4

Feature in the app:

Implemented.Feature.mp4

Changes made and How it is implemented:

  • To implement this feature I added a new custom route that allows you to overlay the route.
  • It is under the widgets folder named translucent_overlay_route.dart.
  • Added a miniVedioMode variable to the video store and regenerated the stores.
  • When the user drags down on the video, on_drag_end enables the mini-video mode.
  • While in mini video mode when a user taps on the video it goes back to the full screen.
  • Finally, while in mini video mode if the user drags horizontally it closes the video component(pops it).
  • Finally, before a new video is pushed to the navigator all the routes are poped till the current route.
  • This is used for all the routes that use VedioChat, I also implemented this for CategoryStreams to close any current running video before showing CategoryStreams.

Additional info:

This method does not interfere with the default pip mode for Android it still works even if the app is in mini video mode.

I have never worked with Flutter before so it is completely understandable to reject this feature update. I was unable to implement the hero widget animation for an additional sliding effect between full view and mini view.

Possible breaking change:

For some reason when I ran it. The SentryFlutter required DSN in its options as well. For now, I have added an empty string, as I don't know what this component of the app does. I highly recommend looking into it if you plan to use this code.
It can be found at main.dart line 50.

Replaced stream_card.dart navigator push route to the new one.
Updated the store to allow pip type mode in app similar to twitch app.
TODO: Fix multiple routes opening.
TODO: Implement changes for the other pages.
Implemented the method to close current vedio when categories is opened.
TODO: Add hero widget to allow layout transitions
@Rikveet Rikveet changed the title PIP mode for app Minimizing mode Apr 25, 2023
TODO: Fix vedio reloading during after switch
@tommyxchow
Copy link
Owner

Thank you for the PR, this looks very promising! I recently made some changes to the linting/formatting rules of the project so there are now a few conflicts, if you could fix those that would be great.

I have quite a bit on my backlog but will check it out fully soon enough and make a proper review.

@tommyxchow tommyxchow self-assigned this Apr 30, 2023
@tommyxchow tommyxchow added the new feature An addition that does not already exist label Apr 30, 2023
@tommyxchow tommyxchow removed their assignment Apr 30, 2023
Keeping the current code of vedioChat variable in channel.dart
@Rikveet
Copy link
Author

Rikveet commented Apr 30, 2023

  • Merged with main.
  • The only code conflict was the vedioChat variable in the channel.dart as I changed the logic of rendering it. I kept it as it is required for the feature to work.
  • There is a bug in which the switch from large mode to small makes it reload the video component, if you do not have turbo or subscribed to the channel it will show ads. I believe this is happening due to the rendering logic.
  • Over the next couple of days I will try and fix this bug.
  • As mentioned in the last commit I managed to add slide animation between the maximize and minimize mode.
  • I have also noticed a security risk, please join the Discord server so I can inform you.

@tonysathre
Copy link

Any chance of this feature being ported to iOS?

@Rikveet
Copy link
Author

Rikveet commented Jul 6, 2023

As far as I know, there should be no issue because it is in the app. This is not picture-in-picture mode that is only available on Andriod. This feature is the minimizing mode in the app so you can scroll for other streams.

@deminearchiver
Copy link

I think this feature should use an custom implementation of Dismissable with an AnimationController to add a nice animation, because without an animation it would look kind of unintuitive for users. I suggest you to look into DrawerController / showModalBottomSheet source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature An addition that does not already exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants