Friction Log: Post-Demuxed 2021 #75
Replies: 7 comments 3 replies
-
For the icon sizing comment, when I was looking at those early on I did notice that it didn't seem like they'd been "icon-ified" or whatever. I think I'd probably want to document an expectation of icons that have a height of |
Beta Was this translation helpful? Give feedback.
-
hoping my draft/WIP PR #74 will help with some of these mobile/styling issues |
Beta Was this translation helpful? Give feedback.
-
Adding this:
|
Beta Was this translation helpful? Give feedback.
-
Also @dylanjha we should do a high level diff of our demuxed branch vs main at some point to make sure we don't loose effort, even if we don't solve the issues in the exact same way. This will likely need to include some auditing of what we solved at the app layer. |
Beta Was this translation helpful? Give feedback.
-
Okay, I have now gone through re-building the demuxed player based on the work @cjpillsbury did in this branch #74 Note that the Mobile player✅ Considerably better UX (compare this screenshot to the screenshot above). Main improvement is the controls overlaid using the new slots Note that I still could have achieved this functionality with the old implementation, but the fact that media-chrome didn't have a default path for doing so meant that path had a lot of friction Desktop player (no change)✅ was able to leverage Application code diffHere is the diff in a gist file: https://gist.github.com/dylanjha/0add32352bf6575a50e618695830392e#file-media-chrome-style-fixes-diff Here is a PR to the compare (private link): https://github.com/demuxed/live.2021.demuxed.com/compare/main...dj/style-fixes Stats: ❯ g df --stat main components/
components/media-chrome.js | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------
components/player-loader.js | 6 +++---
2 files changed, 78 insertions(+), 107 deletions(-) The amount of custom CSS code I had went from 125 lines to 81 lines (35% decrease), not bad. I don't think "minimize the number lines of custom CSS" is necessarily a north star metric, but it is an indicator, and this iteration felt a lot better. I'll move the discussion to the PR for some more detailed feedback about the individual line by line changes. |
Beta Was this translation helpful? Give feedback.
-
Great friction log! I agree in general with the directions outlined.
lol, ouch. Makes sense. Using flex wrap actually firstly made it possible to put the progress range above the other controls with just ordering of the elements and 100% width on the range. (see the gif demo on the repo) The narrow mobile layout is really just unsolved.
By this we mean the progress handle doesn't move when you drag, despite it appearing to work otherwise, is that right?
I got a question in my talk about using non-svgs. Did you use SVGs for this? We should put together an example either way.
Makes sense. Christian and I had a conversation about making a slot for the control bar. Breaking change, but we should do it.
That's awesome, and also, did you need to do that? Any child of media-container should be hidden when not paused. Unless you were overriding how that worked.
That's cool and I hadn't thought of that. We should promote that somehow.
Yeah, we need someone to dig into how to make this easy. It gets complicated with icons and SVGs that bring their own padding. Sounds like there's already some ideas. How did you feel about creating two different control bars for mobile vs. desktop, from "Not an issue" to "too much duplication"? |
Beta Was this translation helpful? Give feedback.
-
Sorry, was that too harsh?? 😞
Yes, used SVGs, and @cjpillsbury has a "Demuxed" theme in progress
I think I needed to do that, I think I overrode that behavior but would have to revisit to understand exactly why.
Not an issue, honestly. The UI is so different for mobile/touch interfaces vs. desktop/mouse interfaces that it felt natural to build both of them independently. In fact, it felt way nicer writing 2 different sets of controls and just showing/hiding the whole thing with media queries compared to other players where I'm trying to shove all of them into a single control bar that tries to be responsive. |
Beta Was this translation helpful? Give feedback.
-
This is basically a brain dump of things we ran into when using media-chrome for Demuxed 2021. We can open up sub-discussions for the major pieces, but this is a sort of grab-bag of all kinds of things I ran into.
For context, this is what the VOD player looks like on mobile + desktop. The Live player was the same but missing a bunch of UI elements that don't make sense on live (time range, seek forward/back playback rate, things like that)
We used this branch of @cjpillsbury 's fork
Not mobile friendly
<media-control-bar>
, the mobile styling is busted. With any sensible amount of controls, I quickly run out of space. The control bar defaults to using flexwrap
on controls, which is find, but clearly feels like a band-aid to jimmy-rig a desktop-first solution into a mobile viewportmedia-chrome
did not give me any utilities for doing so, nor provided any examples<media-time-range>
(seek bar, scrub bar, progress bar, whatever you want to call it) on mobile does not work while the media is playing. It's unusable. This is probably the most significant bug. I believe the underlying reason is because the media element is triggering updates and the element is aninput type="range"
so it gets those updated values and keeps re-setting it's internal state. There have been discussions around other pros/cons to usinginput type="range"
(very few players in the wild that we looked at choose to go this route)Styling in general
slot=
for icons is beautiful. That felt really natural and easy<media-controller>
beingdisplay: inline-flex; flex-direction: column-reverse
felt wrong, I had to work around that default immediately.Container sizing
media-controller
with:position: relative; width: 100%; height: 100%; top: 0; left: 0
so it takes up the whole container. This feels like some boilerplate that can be cleaned up.Missing cc captions button
Missing airplay and chromecast controls
<media-control-bar>
we can add our own custom react components intertwined with the<media-*
UI elements. That felt like a superpower and not something that is easily done in other playersIcon sizing is wonky when using custom slots
Loading indicator
media-controller
should be able to detect the loading state of the media element. The React code we had for that was pretty trivial, we could call thecheckLoading
callback in a bunch of places liketimeupdate
,canplay
,waiting
,stalled
and we didn't run into any bugs with this.Missing documentation
slot=
s (I had to dig through source code to find this)--media--
CSS vars (I had to dig through source code to find this)a11y
keyboard shortcuts
working with
<mux-video>
-- very happy with that combo 💯125 lines of custom CSS
The biggest takeaway for me was the amount of custom CSS I had to write to even get a functional player on mobile. In total I had 125 lines of custom CSS. That feels like way too much.
Immediate Action Items:
Overall, I'm really excited with what we have here. And it feels like knocking out some of these bigger foundational blockers around positioning, styling and mobile will really make this a breeze to work with. 💖
Beta Was this translation helpful? Give feedback.
All reactions