Support "default captions enabled/showing" #137
Replies: 3 comments 4 replies
-
I understand the aforementioned shenanigans a little better now, thanks. :) From a purely design perspective, an attribute on the controller itself I think is the right answer. Ideally we're not creating a pattern where devs have to look at different buttons to understand why the player is behaving in a certain way with no user interaction. It sounds like, though, adding default-on to the button may be the more pragmatic solution considering where we went with the captions button already. I can get on board with that. Taking a quick stab at the first option, if we were to add logic to the addtrack listener to handle this, is the main complication knowing which track to turn on as I have some open questions on the feature, that apply to either case.
In retrospect, I could make an argument that |
Beta Was this translation helpful? Give feedback.
-
That's the main reason it's easier/more reliable (with the current implementations) to add the attr to the
Our original discussions for the current implementation were forward looking to a "subtitles/captions menu" component. If we want to "promote" these things to
I think that's a reasonable approach, but it does mean more discussion on working through these details. |
Beta Was this translation helpful? Give feedback.
-
Since this is not explicitly called out in the informal discussion, regardless of any of these details, we will want to be clear on what "default captions enabled/showing" means. I think the two most reasonable interpretations are:
It may be worthwhile to loop @dylanjha in on this one just to clarify if he had any specific thoughts on what this requirement should entail from the Mux Player side. |
Beta Was this translation helpful? Give feedback.
-
For the Open Elements Mux Player, we want to support automatically having closed captions/subtitles on by default. Currently, this behavior is tied to implementation details in
<media-captions-button/>
, for 2 reasons:no-subtitles-fallback
) belongs to<media-captions-button/>
, which determines whether or not subtitles should be considered when applying default captions enabled/showingtextTrack
to show is also "owned" by<media-captions-button/>
.Additionally, the slotted media's available
textTrack
s will likely be asynchronous for HLS/DASH content, both due to details of "tech"/"playback engines" such as hls.js and due to the fact that they can/often are delivered within the manifest/playlist itself. This is automatically accounted for based on the defined behavior of<media-controller/>
(and may be further improved by #134 if "UNKNOWN" availability is supported).Because of these details and in order to future-proof any potential changes in Media Chrome, Mux Player will need to duplicate some logic (or other workarounds) to wait for
textTracks
availability and then dispatch a click event from the<media-captions-button/>
instance (to ensure identical behavior).Having some kind of support of "default captions enabled/showing" feels like a reasonable Media Chrome feature, not just because of the specific needs from Mux Player, as these considerations would be a high burden/barrier for non-experts and it doesn't seem like an outlandish feature.
My initial proposal was to add a simple boolean attribute to
<media-captions-button/>
, in part because of the aforementioned considerations. That said, I'm open to any proposal that captures the relevant details and provides a reliable solution.Beta Was this translation helpful? Give feedback.
All reactions