Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Any way to disable it on startup? #10

Open
inside83 opened this issue Jan 25, 2021 · 7 comments
Open

Any way to disable it on startup? #10

inside83 opened this issue Jan 25, 2021 · 7 comments

Comments

@inside83
Copy link

inside83 commented Jan 25, 2021

I've implemented the plugin but the context menu is opened by default when a video starts.
How to make it closed by default and opened on right click only?

Also, how to style it to look like on the demo image, with semi-transparent background?

Thanks

@joaopaulovieira
Copy link
Owner

Hi @inside83! I can't reproduce this behavior, this still occurs? I created one demo page using the latest version of the plugin, can you reproduce the reported behavior on this page?

About the custom style, you can use the rgba function to add one opacity into the background-color property. Just configure the option contextMenu.customStyle.listwith your background-color.

One example:

var playerElement = document.getElementById("player-wrapper");

var player = new Clappr.Player({
  source: 'http://clappr.io/highline.mp4',
  poster: 'http://clappr.io/poster.png',
  height: 360,
  width: 640,
  // playback: { controls: true }, // use this config when test with the @clappr/core
  plugins: [ContextMenuPlugin],
  contextMenu: {
    menuItems: ['copyURL', 'copyURLCurrentTime', 'loop', 'playerVersion'],
    extraOptions: [
      {
        name: 'test',
        label: 'Test Label',
        callback: function() {
          console.log('A Absolutely awesome extra context menu item action');
        }
      }
    ],
    customStyle: {
    list: {
        'background-color': "rgba(" + 0 + "," + 0 + "," + 0 + "," + 0.3 + ")",
      },
      items: {
        'color': 'yellow'
      }
    }
  }
});

player.attachTo(playerElement);

@inside83
Copy link
Author

Hey @joaopaulovieira
Thank you for the swift reply.
That neat trick with rgb works 👍😀
I'm using
https://cdn.jsdelivr.net/npm/clappr@latest/dist/clappr.min.js
not
https://cdn.jsdelivr.net/npm/@clappr/player@latest/dist/clappr.min.js
like you in the demo because, unfortunately, chromecast plugin doesn't work with the latest Clappr version

But even If I switch to clappr/player and disable chromecast plugin, the context menu is still, by default, open.

Your demo seams to be ok though 🤷‍♂️

@inside83
Copy link
Author

inside83 commented Feb 5, 2021

PLugin reference should go under 'core', right?

@joaopaulovieira
Copy link
Owner

Yes. I'll try to test on the older versions of Clappr and let you know if I discover anything

@inside83
Copy link
Author

inside83 commented Feb 8, 2021

Please do, it's super annoying.
Thank you 🙏

@joaopaulovieira
Copy link
Owner

Can you tell in which environment (Clappr version/O.S/Browser and version/Running with any specific framework) you reproduce this behavior? Because I tested it on old versions of Clappr and I still couldn't reproduce the problem x.x

@inside83
Copy link
Author

inside83 commented Feb 9, 2021

You can't? 😳
I'm testing on Chrome 88 / Windows 10
Could I send you my setup and link in private please?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants