Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Feature Request - showTopMenu() #12

Closed
taw1313 opened this issue Mar 19, 2021 · 4 comments · Fixed by #15
Closed

Feature Request - showTopMenu() #12

taw1313 opened this issue Mar 19, 2021 · 4 comments · Fixed by #15
Assignees
Labels
enhancement New feature or request

Comments

@taw1313
Copy link

taw1313 commented Mar 19, 2021

Due to Youtube's top menu, the fullscreen controls are hidden under the top menu on some phones ( most IOS )...
If we had a showTopMenu() I could then control the duration the top menu is displayed after transitioning the play state.
Which might help staying within Youtube's TOS.

@jonafeucht
Copy link
Owner

jonafeucht commented Mar 23, 2021

Haven't tested this, but you could try to delay hideTopMenu().

@taw1313
Copy link
Author

taw1313 commented Mar 23, 2021

Haven't tested this, but you could try to delay hideTopMenu().

Thank you for your response.
I am using a timer to hideTopMenu() and it works to HIDE the top menu. 

hideTopMenu() that woks Example:

class ManageTopMenu extends StatelessWidget {
  ManageTopMenu();
  @override
  Widget build(BuildContext context) {
    return YoutubeValueBuilder(
      builder: (context, value) {
        if (value.playerState != PlayerState.playing) {
          Timer(Duration(seconds: 5), () {
            context.ytController.hideTopMenu();
          });
        }
        return Container();
      },
    );
  }
}

But after you hide the top menu it is never displayed again for the life of the controller ( until it is destroyed). I need the ability to display or show ( un-hide ) it again during play state transitions for a few seconds and then I can hide the top

What I need to be able to do is something like this...

class ManageTopMenu extends StatelessWidget {
  ManageTopMenu();
  @override
  Widget build(BuildContext context) {
    return YoutubeValueBuilder(
      builder: (context, value) {
        if (value.playerState != PlayerState.playing) {
           **context.ytController.showTopMenu();**           
           Timer(Duration(seconds: 5), () {
              context.ytController.hideTopMenu();
           });
        }
        return Container();
      },
    );
  }
}

@jonafeucht jonafeucht self-assigned this Mar 23, 2021
@jonafeucht jonafeucht added the enhancement New feature or request label Mar 23, 2021
@jonafeucht jonafeucht linked a pull request Mar 23, 2021 that will close this issue
@jonafeucht
Copy link
Owner

Alright, published new version with showTopMenu() included.

Could you check if that's what you requested? youtube_plyr_iframe: ^2.0.1

@taw1313
Copy link
Author

taw1313 commented Mar 23, 2021

Alright, published new version with showTopMenu() included.

Could you check if that's what you requested? youtube_plyr_iframe: ^2.0.1

Quick test on an Android and iOS it worked as expected.
perfect
thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants