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

Native controls updates #2499

Closed
wants to merge 8 commits into from

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Aug 21, 2015

Previously, native controls were enabled by firing an event from the tech to the player. However, the player only bound events on the tech after the tech may have fired the event. Instead, the player will ask the tech whether controls are enabled or not. If the controls are enabled, it means we should be using native controls.
Also in this PR: when on iphones or native android browser, we should be using native controls.

Fixes videojs#2365.
Also, wrap the trigger in a setTimeout. This is because otherwise, the
player will never be able to hear this event since it happens in the
constructor of the tech and the player adds listeners after the tech has
been created.
@@ -501,6 +501,7 @@ class Player extends Component {

// Grab tech-specific options from player options and add source and parent element to use.
var techOptions = assign({
'nativeControlsForTouch': this.options_.nativeControlsForTouch,
Copy link
Member Author

Choose a reason for hiding this comment

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

pass the option to the tech

@pam
Copy link

pam commented Aug 21, 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: 1af6089
Build details: https://travis-ci.org/pam/video.js/builds/76673812

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

@heff
Copy link
Member

heff commented Aug 21, 2015

lgtm!

usingNativeControls wasn't meant to actually let you change the state, in case we want to simplify that and say you can only set native controls through player/tech options. It seems fine as it is though otherwise.

@heff
Copy link
Member

heff commented Aug 21, 2015

Could you add a description for this issue for people who come back to it later?

@gkatsev
Copy link
Member Author

gkatsev commented Aug 21, 2015

Yep, I'll definitely update the description. Trying to figure out the best way to force the native controls on by default only on the native android browsers (because they don't work right with our controls).
I'll double check to see whether we need to do the techCall('setControls', true); in the usingNativeControls function.

@pam
Copy link

pam commented Aug 21, 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: 28509f4
Build details: https://travis-ci.org/pam/video.js/builds/76678315

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

.video-js.vjs-error .vjs-control-bar {
.video-js.video-js.video-js.vjs-controls-disabled .vjs-control-bar,
.video-js.video-js.video-js.vjs-using-native-controls .vjs-control-bar,
.video-js.video-js.video-js.vjs-error .vjs-control-bar {
Copy link
Member Author

Choose a reason for hiding this comment

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

this is necessarily because otherwise, the .vjs-no-flex selector below ends up being more specific than this and sets the control bar's display to table. This avoids using !important or really strong css selectors.

Copy link
Member

Choose a reason for hiding this comment

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

I get the limitation here, but I don't think we should say this is an ok thing to do in the stylesheet. It's gonna result in uglier and uglier selectors, and I think we can do better.

  • I'd prefer important here over a triple class name. It is after all important that the controls be hidden when the controls are disabled.
  • We could try lowering some of the selector strengths and using strategic ordering over increasing class names.
  • We could hide the controls in additional ways to display, so you have to do more than just display:table to override it.

Copy link
Member

Choose a reason for hiding this comment

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

Another option to fix this specific issue would be to add a .vjs-flex class. Since that's the default behavior it could basically be a noop with no specific styles associated with it (because they're the default), but it would solve specificity problems in situations like this.

@gkatsev
Copy link
Member Author

gkatsev commented Aug 21, 2015

@heff updated.

@pam
Copy link

pam commented Aug 21, 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: 693ae2e
Build details: https://travis-ci.org/pam/video.js/builds/76687501

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

@pam
Copy link

pam commented Aug 21, 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: d9c0263
Build details: https://travis-ci.org/pam/video.js/builds/76688952

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

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.

5 participants