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

feat: Airplay, Captions, and Cast button props #587

Merged
merged 31 commits into from
May 11, 2023

Conversation

AdamJaggard
Copy link
Contributor

Adds missing props for the Airplay, Captions, and Cast buttons.

With captions specifically, we have to decide on the prop type for getting and setting a subtitles list. This is currently a simple array of strings. This matches how we store and retrieve the data from the attribute and also makes interacting with the prop similar to how a dev would interact with the attribute directly.

The alternative is to accept TextTrack's (or objects that are a subset with only the data we need). Is this preferable? I can see this being simpler for the developer assuming they have TextTrack's at hand.

@vercel
Copy link

vercel bot commented May 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
media-chrome ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 11, 2023 9:52am
media-chrome-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 11, 2023 9:52am

@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Merging #587 (9b87af6) into main (1cf3579) will increase coverage by 0.09%.
The diff coverage is 62.93%.

@@            Coverage Diff             @@
##             main     #587      +/-   ##
==========================================
+ Coverage   77.84%   77.93%   +0.09%     
==========================================
  Files          42       43       +1     
  Lines        7438     7600     +162     
==========================================
+ Hits         5790     5923     +133     
- Misses       1648     1677      +29     
Impacted Files Coverage Δ
src/js/utils/element-utils.js 62.82% <50.00%> (-2.83%) ⬇️
src/js/media-captions-button.js 70.66% <62.68%> (-7.75%) ⬇️
src/js/media-airplay-button.js 77.61% <66.66%> (-2.39%) ⬇️
src/js/media-cast-button.js 75.00% <71.05%> (+2.58%) ⬆️

... and 4 files with indirect coverage changes

@AdamJaggard AdamJaggard marked this pull request as ready for review May 10, 2023 12:49
@AdamJaggard AdamJaggard requested review from a team and heff as code owners May 10, 2023 12:49
Copy link
Collaborator

@cjpillsbury cjpillsbury left a comment

Choose a reason for hiding this comment

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

fine for now but it seems like we're leaning towards an array of track-like objects. Feel free to update in this PR or merge and resolve as a followup.

Copy link
Contributor

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

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

Small non-blocker


// don't set if the new value is the same as existing
const newValStr = stringifyTextTrackList(list);
const oldValStr = stringifyTextTrackList(el.getAttribute(attrName) ?? '');
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: There's probably no need to stringify the attribute value as it's already stringified.

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

Successfully merging this pull request may close these issues.

4 participants