Skip to content

Commit

Permalink
Make aspect-ratio configurable on <mux-player>
Browse files Browse the repository at this point in the history
  • Loading branch information
luwes committed Feb 4, 2022
1 parent 0274806 commit 282dc62
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/vanilla-ts-esm/public/mux-player.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</head>
<body>
<!-- Test attributes
style="aspect-ratio: 16 / 10"
primary-color="#5c6ac4"
secondary-color="#ecc94b"
playback-id="xLGf7y8cRquv7QXoDB02zEe6centwKfVmUOiPSY02JhCE"
Expand Down
1 change: 0 additions & 1 deletion packages/mux-player/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export function getChromeStylesFromProps(props: any) {
: {};

return stylePropsToString({
maxWidth: "100%",
...primaryColorStyles,
...secondaryColorStyles,
});
Expand Down
9 changes: 8 additions & 1 deletion packages/mux-player/src/styles.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
:host {
/* default aspect ratio, overwrite w/ e.g. style="aspect-ratio: 16 / 10" */
aspect-ratio: 16 / 9;
}

media-controller {
--media-control-background: transparent;
--media-control-hover-background: transparent;
--media-range-track-background: rgba(255, 255, 255, 0.5);
--media-range-track-border-radius: 3px;
--media-aspect-ratio: 16 / 9;
--media-aspect-ratio: auto;
width: 100%;
height: 100%;
}

.mxp-spacer {
Expand Down

0 comments on commit 282dc62

Please sign in to comment.