feat: add placeholder get/setTextTrackStyle with style JSON schema #1104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature: Placeholder Support for Caption Styling Persistence
This PR adds two non-functional placeholder methods to the
Playerclass:getTextTrackStyle()setTextTrackStyle(style)The goal is to enable future support for persistent subtitle styling across videos — something Vimeo users frequently request.
Suggested API Behavior (once implemented):
{ "font": { "family": "Proportional Sans-Serif", "color": "#FFFFFF", "size": "100%", "opacity": "100%", "edgeStyle": "none" }, "background": { "color": "#000000", "opacity": "100%" }, "window": { "color": "#000000", "opacity": "0%" } }Developers would be responsible for persisting this style client-side (e.g. in cookies/localStorage). Vimeo would only need to expose the current value and allow setting it via postMessage.
Optional Future Enhancement
Emit a
'texttrackstylechange'event when the user changes subtitle style via the UI, so developers can respond or save it.This addition lays the groundwork for caption consistency without breaking changes. No styling logic is implemented — only safe stubs with inline
TODOs.Suggested
postMessageFormatIf supported in the future, the player iframe could emit style changes via:
This would allow consumers of the Player API to persist caption styles on their side:
No storage or UI changes are needed from Vimeo — just a simple message emit.
Final Note
I understand this feature would require internal support from the Vimeo iframe, but I hope this PR provides a clean starting point. It introduces no breaking changes and keeps all logic on the developer’s side — Vimeo simply needs to expose and optionally emit the current caption style.
I'd be happy to iterate further if the team sees potential in enabling this capability. Thank you for your consideration!