Skip to content

Commit

Permalink
feat: Migrate all attributes to lowercase ('smushedcase'). (#537)
Browse files Browse the repository at this point in the history
* feat: Migrate all attributes to lowercase ('smushedcase').

* fix: media-time-display wrong setter value.

* fix: typo in microvideo attribute name.

* fix: Clean up microvideo + example (discuss: camelcase + kebab vs. lowercase).

* test: Update tests to reflect new attribute names.

* revert nextjs changes.

* remove hardcoded declaration file (with react types) (at least for now).

* chore: minimal changes to media-playback-rate-button rates for TS fixes.

* fix: remove script to copy (no longer present) type declaration file on build.

* remove props from media-time-display and clean up media-container css formatting.
  • Loading branch information
cjpillsbury authored Apr 18, 2023
1 parent 8671210 commit fe9eadc
Show file tree
Hide file tree
Showing 43 changed files with 446 additions and 350 deletions.
18 changes: 9 additions & 9 deletions examples/vanilla/advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
width: 100%; /* prevents video to expand beyond its container */
}

media-airplay-button[media-airplay-unavailable],
media-fullscreen-button[media-fullscreen-unavailable],
media-volume-range[media-volume-unavailable],
media-pip-button[media-pip-unavailable] {
media-airplay-button[mediaairplayunavailable],
media-fullscreen-button[mediafullscreenunavailable],
media-volume-range[mediavolumeunavailable],
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down Expand Up @@ -57,16 +57,16 @@ <h1>Media Chrome Advanced Video Usage Example</h1>
src="https://image.mux.com/A3VXy02VoUinw01pwyomEO3bHnG4P32xzV7u1j1FSzjNg/thumbnail.jpg"
placeholder-src="data:image/jpeg;base64,/9j/2wBDABQODxIPDRQSEBIXFRQYHjIhHhwcHj0sLiQySUBMS0dARkVQWnNiUFVtVkVGZIhlbXd7gYKBTmCNl4x9lnN+gXz/2wBDARUXFx4aHjshITt8U0ZTfHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHz/wAARCAAUADADASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAECBAP/xAAdEAEBAAEEAwAAAAAAAAAAAAAAARECAxITFCFR/8QAGQEAAwADAAAAAAAAAAAAAAAAAAEDAgQF/8QAGBEBAQEBAQAAAAAAAAAAAAAAAAETERL/2gAMAwEAAhEDEQA/ANeC4ldyI1b2EtIzzrrIqYZLvl5FGkGdbfQzGPvo76WsPxXLlfqbaA5va2iVJADgPELACsD/2Q=="
></media-poster-image>
<media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
<media-loading-indicator slot="centered-chrome" noautohide></media-loading-indicator>
<media-control-bar>
<media-play-button></media-play-button>
<media-seek-backward-button seek-offset="15"></media-seek-backward-button>
<media-seek-forward-button seek-offset="15"></media-seek-forward-button>
<media-seek-backward-button seekoffset="30"></media-seek-backward-button>
<media-seek-forward-button seekoffset="30"></media-seek-forward-button>
<media-mute-button></media-mute-button>
<media-volume-range></media-volume-range>
<media-time-range></media-time-range>
<media-time-display show-duration remaining></media-time-display>
<media-captions-button default-showing></media-captions-button>
<media-time-display showduration remaining></media-time-display>
<media-captions-button defaultshowing></media-captions-button>
<media-playback-rate-button></media-playback-rate-button>
<media-pip-button></media-pip-button>
<media-fullscreen-button></media-fullscreen-button>
Expand Down
4 changes: 2 additions & 2 deletions examples/vanilla/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1>Media Chrome Basic Audio and Video Usage Example</h1>
></audio>
<media-control-bar>
<media-play-button></media-play-button>
<media-time-display show-duration></media-time-display>
<media-time-display showduration></media-time-display>
<media-time-range></media-time-range>
<media-playback-rate-button></media-playback-rate-button>
<media-mute-button></media-mute-button>
Expand All @@ -52,7 +52,7 @@ <h1>Media Chrome Basic Audio and Video Usage Example</h1>
src="https://image.mux.com/A3VXy02VoUinw01pwyomEO3bHnG4P32xzV7u1j1FSzjNg/thumbnail.jpg"
placeholder-src="data:image/jpeg;base64,/9j/2wBDABQODxIPDRQSEBIXFRQYHjIhHhwcHj0sLiQySUBMS0dARkVQWnNiUFVtVkVGZIhlbXd7gYKBTmCNl4x9lnN+gXz/2wBDARUXFx4aHjshITt8U0ZTfHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHz/wAARCAAUADADASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAECBAP/xAAdEAEBAAEEAwAAAAAAAAAAAAAAARECAxITFCFR/8QAGQEAAwADAAAAAAAAAAAAAAAAAAEDAgQF/8QAGBEBAQEBAQAAAAAAAAAAAAAAAAETERL/2gAMAwEAAhEDEQA/ANeC4ldyI1b2EtIzzrrIqYZLvl5FGkGdbfQzGPvo76WsPxXLlfqbaA5va2iVJADgPELACsD/2Q=="
></media-poster-image>
<media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
<media-loading-indicator slot="centered-chrome" noautohide></media-loading-indicator>
<media-control-bar>
<media-play-button></media-play-button>
<media-mute-button></media-mute-button>
Expand Down
16 changes: 8 additions & 8 deletions examples/vanilla/casting.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
width: 100%; /* prevents video to expand beyond its container */
}

media-airplay-button[media-airplay-unavailable] {
media-airplay-button[mediaairplayunavailable] {
display: none;
}

media-volume-range[media-volume-unavailable] {
media-volume-range[mediavolumeunavailable] {
display: none;
}

media-pip-button[media-pip-unavailable] {
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down Expand Up @@ -61,16 +61,16 @@ <h1>Media Chrome with Casting Example</h1>
src="./vtt/bbb-en-cc.vtt"
/>
</video>
<media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
<media-loading-indicator slot="centered-chrome" noautohide></media-loading-indicator>
<media-control-bar>
<media-play-button></media-play-button>
<media-seek-backward-button seek-offset="15"></media-seek-backward-button>
<media-seek-forward-button seek-offset="15"></media-seek-forward-button>
<media-seek-backward-button seekoffset="15"></media-seek-backward-button>
<media-seek-forward-button seekoffset="15"></media-seek-forward-button>
<media-mute-button></media-mute-button>
<media-volume-range></media-volume-range>
<media-time-range></media-time-range>
<media-time-display show-duration remaining></media-time-display>
<media-captions-button default-showing></media-captions-button>
<media-time-display showduration remaining></media-time-display>
<media-captions-button defaultshowing></media-captions-button>
<media-playback-rate-button></media-playback-rate-button>
<media-pip-button></media-pip-button>
<media-airplay-button></media-airplay-button>
Expand Down
16 changes: 8 additions & 8 deletions examples/vanilla/disabled.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
width: 100%; /* prevents video to expand beyond its container */
}

media-airplay-button[media-airplay-unavailable],
media-fullscreen-button[media-fullscreen-unavailable],
media-volume-range[media-volume-unavailable],
media-pip-button[media-pip-unavailable] {
media-airplay-button[mediaairplayunavailable],
media-fullscreen-button[mediafullscreenunavailable],
media-volume-range[mediavolumeunavailable],
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down Expand Up @@ -62,15 +62,15 @@ <h1>Media Chrome Disabled-Controls Video Usage Example</h1>
src="https://image.mux.com/DS00Spx1CV902MCtPj5WknGlR102V5HFkDe/thumbnail.jpg"
placeholder-src="data:image/jpeg;base64,/9j/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCAASACADASIAAhEBAxEB/8QAGgABAAIDAQAAAAAAAAAAAAAAAAMEAgUGCP/EACkQAAEDAgMIAgMAAAAAAAAAAAEAAgMEBgUREgcUITFSkZTRQaEiscH/xAAYAQACAwAAAAAAAAAAAAAAAAAABQIDBv/EAB0RAAICAQUAAAAAAAAAAAAAAAABAgMFERUxwfD/2gAMAwEAAhEDEQA/AOZh2P2k/LOhq/Lf7VuPYvZxLQ6iqgXchvrxn9rpY7ojYCBU0IJ5HU3h9rU3NcGJVcVNJh2K4fDPTztlbm5reGRDhnxIzBPwkUc9RJ6dDHaLYojj2HWYeeH1nmSe1OzYXZJ54fW+ZJ7VeWrbO4SPuedpI/IOnB/TgsxJh4yIuGYu+TvAH9UXnafItWJmuTy1oZ0t7JoZ0t7Ii0InGhnS3smhnS3siIA//9k="
></media-poster-image>
<media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
<media-loading-indicator slot="centered-chrome" noautohide></media-loading-indicator>
<media-control-bar>
<media-play-button disabled aria-disabled="true"></media-play-button>
<media-seek-backward-button seek-offset="15" disabled aria-disabled="true"></media-seek-backward-button>
<media-seek-forward-button seek-offset="15" disabled aria-disabled="true"></media-seek-forward-button>
<media-seek-backward-button seekoffset="15" disabled aria-disabled="true"></media-seek-backward-button>
<media-seek-forward-button seekoffset="15" disabled aria-disabled="true"></media-seek-forward-button>
<media-mute-button disabled aria-disabled="true"></media-mute-button>
<media-volume-range disabled aria-disabled="true"></media-volume-range>
<media-time-range disabled aria-disabled="true"></media-time-range>
<media-time-display show-duration remaining disabled aria-disabled="true"></media-time-display>
<media-time-display showduration remaining disabled aria-disabled="true"></media-time-display>
<media-captions-button default-showing disabled aria-disabled="true"></media-captions-button>
<media-playback-rate-button disabled aria-disabled="true"></media-playback-rate-button>
<media-pip-button disabled aria-disabled="true"></media-pip-button>
Expand Down
6 changes: 3 additions & 3 deletions examples/vanilla/media-elements/jwplayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
background-color: #000;
}

media-airplay-button[media-airplay-unavailable] {
media-airplay-button[mediaairplayunavailable] {
display: none;
}

media-volume-range[media-volume-unavailable] {
media-volume-range[mediavolumeunavailable] {
display: none;
}

media-pip-button[media-pip-unavailable] {
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down
6 changes: 3 additions & 3 deletions examples/vanilla/media-elements/videojs.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
background-color: #000;
}

media-airplay-button[media-airplay-unavailable] {
media-airplay-button[mediaairplayunavailable] {
display: none;
}

media-volume-range[media-volume-unavailable] {
media-volume-range[mediavolumeunavailable] {
display: none;
}

media-pip-button[media-pip-unavailable] {
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down
6 changes: 3 additions & 3 deletions examples/vanilla/media-elements/vimeo.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
background-color: #000;
}

media-airplay-button[media-airplay-unavailable] {
media-airplay-button[mediaairplayunavailable] {
display: none;
}

media-volume-range[media-volume-unavailable] {
media-volume-range[mediavolumeunavailable] {
display: none;
}

media-pip-button[media-pip-unavailable] {
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down
6 changes: 3 additions & 3 deletions examples/vanilla/media-elements/wistia.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
background-color: #000;
}

media-airplay-button[media-airplay-unavailable] {
media-airplay-button[mediaairplayunavailable] {
display: none;
}

media-volume-range[media-volume-unavailable] {
media-volume-range[mediavolumeunavailable] {
display: none;
}

media-pip-button[media-pip-unavailable] {
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/vanilla/mobile.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
margin-top: 20px;
}

media-airplay-button[media-airplay-unavailable] {
media-airplay-button[mediaairplayunavailable] {
display: none;
}

media-volume-range[media-volume-unavailable] {
media-volume-range[mediavolumeunavailable] {
display: none;
}

Expand Down
8 changes: 4 additions & 4 deletions examples/vanilla/responsive-attribute.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ <h1>Responsive Media Chrome Example</h1>
/*
* Hide unavailable buttons.
*/
media-airplay-button[media-airplay-unavailable],
media-fullscreen-button[media-fullscreen-unavailable],
media-volume-range[media-volume-unavailable],
media-pip-button[media-pip-unavailable] {
media-airplay-button[mediaairplayunavailable],
media-fullscreen-button[mediafullscreenunavailable],
media-volume-range[mediavolumeunavailable],
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down
8 changes: 4 additions & 4 deletions examples/vanilla/responsive-polyfill.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@
inset: 0;
}

media-airplay-button[media-airplay-unavailable],
media-fullscreen-button[media-fullscreen-unavailable],
media-volume-range[media-volume-unavailable],
media-pip-button[media-pip-unavailable] {
media-airplay-button[mediaairplayunavailable],
media-fullscreen-button[mediafullscreenunavailable],
media-volume-range[mediavolumeunavailable],
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down
8 changes: 4 additions & 4 deletions examples/vanilla/responsive.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ <h1>Responsive Media Chrome Example</h1>
/*
* Hide unavailable buttons.
*/
media-airplay-button[media-airplay-unavailable],
media-fullscreen-button[media-fullscreen-unavailable],
media-volume-range[media-volume-unavailable],
media-pip-button[media-pip-unavailable] {
media-airplay-button[mediaairplayunavailable],
media-fullscreen-button[mediafullscreenunavailable],
media-volume-range[mediavolumeunavailable],
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down
28 changes: 14 additions & 14 deletions examples/vanilla/standalone-controls.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,49 +46,49 @@ <h1>Standalone Controls Example</h1>
</media-controller>

<h2>Outside the control-bar element</h2>
<media-play-button media-controller="controller"></media-play-button>
<media-mute-button media-controller="controller"></media-mute-button>
<media-play-button mediacontroller="controller"></media-play-button>
<media-mute-button mediacontroller="controller"></media-mute-button>
<media-seek-backward-button
media-controller="controller"
mediacontroller="controller"
></media-seek-backward-button>
<media-seek-forward-button
media-controller="controller"
mediacontroller="controller"
></media-seek-forward-button>
<media-volume-range media-controller="controller"></media-volume-range>
<media-time-range media-controller="controller"></media-time-range>
<media-volume-range mediacontroller="controller"></media-volume-range>
<media-time-range mediacontroller="controller"></media-time-range>
<!-- It works for "display-only" components, too! -->
<media-time-display
media-controller="controller"
mediacontroller="controller"
remaining
show-duration
></media-time-display>
<media-captions-button
media-controller="controller"
mediacontroller="controller"
></media-captions-button>
<media-playback-rate-button
media-controller="controller"
mediacontroller="controller"
></media-playback-rate-button>
<media-pip-button media-controller="controller"></media-pip-button>
<media-pip-button mediacontroller="controller"></media-pip-button>
<media-fullscreen-button
media-controller="controller"
mediacontroller="controller"
></media-fullscreen-button>

<h2>Inside the control-bar element</h2>
<p>
Note: You only need to set the <code>media-controller=</code> attribute
Note: You only need to set the <code>mediacontroller=</code> attribute
on the <code>media-control-bar</code>. The media-controller will pass
the media state details to their child media-chrome elements
automatically.
</p>

<media-control-bar media-controller="controller">
<media-control-bar mediacontroller="controller">
<media-play-button></media-play-button>
<media-mute-button></media-mute-button>
<media-seek-backward-button></media-seek-backward-button>
<media-seek-forward-button></media-seek-forward-button>
<media-volume-range></media-volume-range>
<media-time-range></media-time-range>
<media-time-display remaining show-duration></media-time-display>
<media-time-display remaining showduration></media-time-display>
<media-captions-button></media-captions-button>
<media-playback-rate-button></media-playback-rate-button>
<media-pip-button></media-pip-button>
Expand Down
16 changes: 8 additions & 8 deletions examples/vanilla/state-change-events-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
width: 100%; /* prevents video to expand beyond its container */
}

media-airplay-button[media-airplay-unavailable] {
media-airplay-button[mediaairplayunavailable] {
display: none;
}

media-volume-range[media-volume-unavailable] {
media-volume-range[mediavolumeunavailable] {
display: none;
}

media-pip-button[media-pip-unavailable] {
media-pip-button[mediapipunavailable] {
display: none;
}

Expand Down Expand Up @@ -88,22 +88,22 @@ <h1>Media Chrome Advanced Video Usage Example</h1>
src="https://image.mux.com/DS00Spx1CV902MCtPj5WknGlR102V5HFkDe/thumbnail.jpg"
placeholder-src="data:image/jpeg;base64,/9j/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCAASACADASIAAhEBAxEB/8QAGgABAAIDAQAAAAAAAAAAAAAAAAMEAgUGCP/EACkQAAEDAgMIAgMAAAAAAAAAAAEAAgMEBgUREgcUITFSkZTRQaEiscH/xAAYAQACAwAAAAAAAAAAAAAAAAAABQIDBv/EAB0RAAICAQUAAAAAAAAAAAAAAAABAgMFERUxwfD/2gAMAwEAAhEDEQA/AOZh2P2k/LOhq/Lf7VuPYvZxLQ6iqgXchvrxn9rpY7ojYCBU0IJ5HU3h9rU3NcGJVcVNJh2K4fDPTztlbm5reGRDhnxIzBPwkUc9RJ6dDHaLYojj2HWYeeH1nmSe1OzYXZJ54fW+ZJ7VeWrbO4SPuedpI/IOnB/TgsxJh4yIuGYu+TvAH9UXnafItWJmuTy1oZ0t7JoZ0t7Ii0InGhnS3smhnS3siIA//9k="
></media-poster-image>
<div slot="centered-chrome" no-auto-hide>
<div slot="centered-chrome" noautohide>
<media-loading-indicator></media-loading-indicator>
</div>
<media-control-bar>
<media-play-button></media-play-button>
<media-seek-backward-button
seek-offset="15"
seekoffset="15"
></media-seek-backward-button>
<media-seek-forward-button
seek-offset="15"
seekoffset="15"
></media-seek-forward-button>
<media-mute-button></media-mute-button>
<media-volume-range></media-volume-range>
<media-time-range></media-time-range>
<media-time-display show-duration remaining></media-time-display>
<media-captions-button default-showing></media-captions-button>
<media-time-display showduration remaining></media-time-display>
<media-captions-button defaultshowing></media-captions-button>
<media-playback-rate-button></media-playback-rate-button>
<media-pip-button></media-pip-button>
<media-fullscreen-button></media-fullscreen-button>
Expand Down
2 changes: 1 addition & 1 deletion examples/vanilla/themes/demuxed-2021-theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
display: inline-flex;
}

*[slot='centered-chrome'] media-play-button:not([media-paused]) {
*[slot='centered-chrome'] media-play-button:not([mediapaused]) {
display: none;
}
}
Expand Down
Loading

1 comment on commit fe9eadc

@vercel
Copy link

@vercel vercel bot commented on fe9eadc Apr 18, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.