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

use flex-box to calculate time rail width #2261

Merged
merged 5 commits into from
Jun 16, 2017
Merged

use flex-box to calculate time rail width #2261

merged 5 commits into from
Jun 16, 2017

Conversation

marcobiedermann
Copy link
Contributor

Instead of calculating the time rail width via JavaScript, you could make use of the flex-box flex-grow property.
Because flex-box has pretty good support meanwhile, I think this would simplify some calculations which would make the overall plugin a bit faster.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 73.832% when pulling 0df4b73 on marcobiedermann:feature/time-rail into c4193e8 on mediaelement:master.

@rafa8626
Copy link
Contributor

rafa8626 commented Jun 4, 2017

Thanks for this PR. However, we have to support IE9+ and those browsers don't support flexbox. If you can restrict flexbox on IE9 and making sure your change will work on those version of IE without increasing the size of code a lot I will merge this. Any questions do not hesitate on contacting me.

@marcobiedermann
Copy link
Contributor Author

@rafa8626 Alright, thanks for your feedback.
My suggestion would be to drop IE9 support because according to CanIUse the global usage is ~0.2 %. I prefer providing a much more elegant solution for modern browsers.
I would not use some kind of browser support check because this would increase to performance an loadtime for browsers which do support flex-box.

If you still plan to support IE9, I would suggest keeping this change on hold an set a tag for a newer milestone.

@rafa8626
Copy link
Contributor

rafa8626 commented Jun 4, 2017

Sounds good to me. I'll create a separate branch for your change and keep it until I discuss this with John Dyer and we have an agreement on what we should support in the next release. Thanks

@rafa8626
Copy link
Contributor

rafa8626 commented Jun 4, 2017

FYI, I may not need a separate branch. I'll have an answer soon about browser support. So I'll keep this PR open while this happens. Thanks for this PR, since I also consider it very helpful

@marcobiedermann
Copy link
Contributor Author

Thank you Rafael. You are very welcome.
I've use your plugin a few days ago and it is really great so far. Keep it going :)

# Conflicts:
#	src/css/mediaelementplayer.css
@coveralls
Copy link

Coverage Status

Coverage remained the same at 73.832% when pulling f052ccc on marcobiedermann:feature/time-rail into 9465a45 on mediaelement:master.

@rafa8626
Copy link
Contributor

Ok I have the approval of going with flexbox for this. However can you actually turn the whole control bar to flexbox to reduce more code? If you have any other improvements that require flexbox please put them on this PR and I'll test them. Such good news!

@marcobiedermann
Copy link
Contributor Author

Alright, thanks for your feedback. I will work on this shortly. Which browsers will you support now on? So I can setup Autoprefixer

@rafa8626
Copy link
Contributor

rafa8626 commented Jun 10, 2017

I believe we'll be fine with IE11+, Chrome, Safari, FF, iOS 8+, android 4+, MSEdge. Even IE10 should be fine since it supports flexbox but let me know your thoughts.

@rafa8626
Copy link
Contributor

Any updates on this?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 73.832% when pulling e480c10 on marcobiedermann:feature/time-rail into 5ba8458 on mediaelement:master.

@marcobiedermann
Copy link
Contributor Author

@rafa8626 Sorry Rafael, I was quite busy this week.
I've replaced floats and transforms with flex-box where possible.
Tested this on Chrome, Safari and Firefox. Unfortunately I can not test this in IE.
Could you please check this on your side and give me feedback, if I have to adjust some things?

@rafa8626
Copy link
Contributor

No worries; thanks for keep working on this. I'll check this today on MS Edge and IE11 and I'll give you an update. Did you test this on Android and iOS?

@marcobiedermann
Copy link
Contributor Author

I've tested it on Apple iPhone simulator. iOS looks fine.

@rafa8626
Copy link
Contributor

Ok I'll take a look at Android and IE; I noticed that .mejs__time-rail stills has a fixed width. If I shrink the size of my window enough it cuts a little its siblings. Is it safe to remove the width?
screen shot 2017-06-15 at 8 00 28 am

@rafa8626
Copy link
Contributor

On IE11, Firefox, I see that there's a little black border on top of the Captions/Volume
screen shot 2017-06-15 at 8 03 06 am
screen shot 2017-06-15 at 8 06 27 am
Can you check this please?

left: -1000px;
margin: 3px 3px 0 5px;
position: absolute;
display: none;
Copy link
Contributor

@rafa8626 rafa8626 Jun 15, 2017

Choose a reason for hiding this comment

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

We can't use this because it affects accessibility when users tab to select captions/chapters. This must be reverted to the way it was; the only change that needs to be made is visibility: visible instead of hidden and the following lines must be removed:

.mejs__captions-button > .mejs__captions-selector,
.mejs__chapters-button > .mejs__chapters-selector {
    visibility: visible;
}

@rafa8626
Copy link
Contributor

I think I can take care of the line there. I just need to know if we can remove the width of the rail.

@rafa8626
Copy link
Contributor

rafa8626 commented Jun 15, 2017

Updating mejs__offscreen according to https://blog.rrwd.nl/2015/04/04/the-screen-reader-text-class-why-and-how/ solves it. Can you give it a try and I'll review this again, please?

@@ -1,7 +1,6 @@
/* Accessibility: hide screen reader texts (and prefer "top" for RTL languages).
Reference: http://blog.rrwd.nl/2015/04/04/the-screen-reader-text-class-why-and-how/ */
.mejs-offscreen {
clip: rect(1px, 1px, 1px, 1px); /* IE8-IE11 - no support for clip-path */
clip-path: polygon(0 0, 0 0, 0 0, 0 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -293,6 +295,9 @@ Reference: http://blog.rrwd.nl/2015/04/04/the-screen-reader-text-class-why-and-h
/* Start: Progress Bar */
.mejs__time-rail {
direction: ltr;
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
width: 200px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the width to ensure 100% flexibility on small screens

}

.mejs-captions-selector-label,
.mejs-chapters-selector-label {
cursor: pointer;
float: left;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is OK to leave in place

@rafa8626
Copy link
Contributor

rafa8626 commented Jun 15, 2017

I left all my comments. Let me know if you have any questions, but if those are addressed we will be covering every target and I will merge this. Thanks

@rafa8626
Copy link
Contributor

@marcobiedermann If you are OK I'll proceed to do the changes and merge this. A bigger testing is happening right now and I'd like to integrate this as part of the oncoming release

@marcobiedermann
Copy link
Contributor Author

@rafa8626 Sure, go ahead. Thank you very much for your feedback. I am currently at work and could a look at this after I am back home. But if you are going to handle this I am absolutely fine :)

@rafa8626 rafa8626 merged commit e480c10 into mediaelement:master Jun 16, 2017
@rafa8626
Copy link
Contributor

PR merged. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants