Closed 2Pacalypse- closed 1 week ago
Thanks for the feedback!
The best source of truth is still the slotted media element, I recommend using that for determining playing state.
With the media.paused
and play
, playing
and pause
events you should have everything you need.
We purposely built Media Chrome like this, it doesn't try to be a full player. Hope this helps, let me know if it doesn't make sense. Cheers!
I'm sorry for a silly question and I'm not sure if I'm missing something, but it seems like it's needlessly hard to determine if the media is currently playing?
There is a
mediapaused
attribute that's set when the media is paused, obviously. So the naïve approach to determine if the media is playing to do!mediaElem.hasAttribute('mediapaused')
. However, this also returnstrue
sometimes during code initialization, I think?. So it seems like I have to combine themediapaused
attribute with also checking if themediacurrenttime
is larger than 0 or something.I feel like just having a
mediaplaying
attribute might simplify things a bit.