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

Inline volumeMenuButton option #2378

Closed
wants to merge 9 commits into from

Conversation

mmcc
Copy link
Member

@mmcc mmcc commented Jul 18, 2015

This adds a new inline option to MenuButton that allows you to use MenuButton as a drawer of sorts. Old functionality is unchanged, although the styles now reside under .vjs-menu-button-popup.

To use, simply pass inline: true in the volumeMenuButton options. This will also default to a horizontal slider for obvious reasons.

videojs('vid1', { "playbackRates": [1, 2, 3], "controlBar": { "volumeMenuButton": { "inline": true }}});

There's an unrelated issue in IE8 where bubbling seems to be messed up. Everything works as far as this PR is concerned, but the bubbling issue is causing any click on the menu to count for a click on the mute button. We need to sort that out still, but I don't think this PR is the place for it.

preview

@pam
Copy link

pam commented Jul 18, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 1b28a9329a1cac2915aa84c7d7d3e6e1fd736045
Build details: https://travis-ci.org/pam/video.js/builds/71510224

(Please note that this is a fully automated comment.)

@heff
Copy link
Member

heff commented Jul 18, 2015

Very cool!

How do I test it? I tried:

"controlBar": { "volumeMenuButton": { "inline": true } }

and got

screen shot 2015-07-18 at 11 20 26 am

It'd be nice if we could just do volumeMenuButton": { "inline": true } at the top level of the player options. Now that we're passing playerOptions to children we could probably do that easily. Don't try to add that to this PR though.

@mmcc
Copy link
Member Author

mmcc commented Jul 19, 2015

@heff you also need to specify vertical: false.

"controlBar": { "volumeMenuButton": {"vertical": "false, "inline": true } }

@gkatsev
Copy link
Member

gkatsev commented Jul 19, 2015

Can inline: true imply vertical? I don't think there would be any case where you would want it to be inline and also vertical. And if you did, you could always set vertical to true to force it.

@mmcc
Copy link
Member Author

mmcc commented Jul 20, 2015

inline: true can imply vertical for the volumeMenuButton specifically, but keep in mind that the option is intended to be generic to any instance of MenuButton.

@gkatsev
Copy link
Member

gkatsev commented Jul 20, 2015

That's true. But the volumeMenuButton can default to vertical: false when inline: true. I'm not certain that we do want this, but it does seem to simplify the simple base case.

@pam
Copy link

pam commented Jul 20, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 4b6bcdf1935f071731d8133bf40c24d30c4cf9cc
Build details: https://travis-ci.org/pam/video.js/builds/71802376

(Please note that this is a fully automated comment.)

@mmcc
Copy link
Member Author

mmcc commented Jul 20, 2015

@gkatsev @heff I went ahead and made the switch to set vertical: false if inline: true is specified on an instance of VolumeMenuButton. Tests are currently failing because of the node-sass issue on Travis.

@@ -19,6 +19,12 @@ import VolumeBar from './volume-control/volume-bar.js';
class VolumeMenuButton extends MenuButton {

constructor(player, options={}){
// If an inline volumeMenuButton is used, we should default to using a horizontal
// slider for obvious reasons.
if (options.inline) {
Copy link
Member

Choose a reason for hiding this comment

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

Might as well move this inside the options.vertical === undefined check, so it's overridable.

@heff
Copy link
Member

heff commented Jul 20, 2015

A few more comments, not blockers. LGTM

@pam
Copy link

pam commented Jul 20, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 4e68e6fe64d1b313053ce3f13458f8d1c7bccbf0
Build details: https://travis-ci.org/pam/video.js/builds/71813262

(Please note that this is a fully automated comment.)

@pam
Copy link

pam commented Jul 21, 2015

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: ad810aeddd9f3729007be3c6932a0f2086b1e29f
Build details: https://travis-ci.org/pam/video.js/builds/72034158

(Please note that this is a fully automated comment.)

@pam
Copy link

pam commented Jul 22, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 34a38c3a6e8f6d9350e56e6ce433d2b5ea7517ed
Build details: https://travis-ci.org/pam/video.js/builds/72039643

(Please note that this is a fully automated comment.)

@pam
Copy link

pam commented Jul 22, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 70e0c4877ea40cb9d824a167d219a7bee0d6a681
Build details: https://travis-ci.org/pam/video.js/builds/72042593

(Please note that this is a fully automated comment.)

@mmcc mmcc changed the title Initial stab at inline volume Inline volume Jul 24, 2015
@mmcc mmcc changed the title Inline volume Inline volumeMenuButton Jul 24, 2015
@mmcc mmcc changed the title Inline volumeMenuButton Inline volumeMenuButton option Jul 24, 2015
@mmcc
Copy link
Member Author

mmcc commented Jul 24, 2015

Bumping this thread, I think this is good to pull in. @dmlap @gkatsev - thoughts?

@mmcc
Copy link
Member Author

mmcc commented Jul 24, 2015

Also to note, I've personally tested this in:

OSX: Chrome, Firefox, Safari
Windows: Chrome, Firefox, IE8, IE11

@pam
Copy link

pam commented Jul 24, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: a2c56a71107279168465facc27ec0654d3c43adb
Build details: https://travis-ci.org/pam/video.js/builds/72522493

(Please note that this is a fully automated comment.)

@pam
Copy link

pam commented Jul 24, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 7a842e2
Build details: https://travis-ci.org/pam/video.js/builds/72525471

(Please note that this is a fully automated comment.)

@heff
Copy link
Member

heff commented Jul 25, 2015

Nice, you ere able to fix IE8? LGTM

@mmcc
Copy link
Member Author

mmcc commented Jul 28, 2015

@heff Everything related to this PR is working in IE8, but we still need to loop back on the bubbling issue.

@mmcc mmcc closed this in e330e7b Jul 28, 2015
@heff
Copy link
Member

heff commented Jul 29, 2015

@mmcc can you create a new issue for the bubbling?

Sent from mobile

@mmcc mmcc mentioned this pull request Jul 29, 2015
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.

4 participants