You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds `REFERENCE.md` files for Astro components. These match the existing
files in format, but with the Astro props. While doing this I noticed
that `MuxPlayer` is missing some of the props from `mux-player`, so I'll
add those to the types and references in another PR.
Copy file name to clipboardExpand all lines: packages/mux-player-astro/README.md
-193Lines changed: 0 additions & 193 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,199 +38,6 @@ import { MuxPlayer } from '@mux/mux-player-astro';
38
38
}}
39
39
/>
40
40
```
41
-
42
-
## With Styling
43
-
44
-
```astro
45
-
---
46
-
import { MuxPlayer } from '@mux/mux-player-astro';
47
-
---
48
-
49
-
<MuxPlayer
50
-
playbackId="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
51
-
style={{
52
-
display: 'block',
53
-
aspectRatio: '16/9',
54
-
backgroundColor: '#000',
55
-
}}
56
-
autoplay
57
-
muted
58
-
streamType="on-demand"
59
-
proudlyDisplayMuxBadge
60
-
/>
61
-
```
62
-
63
-
## With Themes
64
-
65
-
You can use one of the built-in themes by passing the theme name as a string to the `theme` prop:
66
-
67
-
```astro
68
-
---
69
-
import { MuxPlayer } from '@mux/mux-player-astro';
70
-
---
71
-
72
-
<MuxPlayer
73
-
playbackId="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
74
-
theme="classic"
75
-
style={{
76
-
display: 'block',
77
-
aspectRatio: '16/9',
78
-
}}
79
-
/>
80
-
```
81
-
82
-
Available themes:
83
-
-`classic` - Classic player theme
84
-
-`minimal` - Minimal player theme
85
-
-`microvideo` - Microvideo theme for short-form content
86
-
-`gerwig` - P, pretty, I, intelligent, N, never sad, K, cool
87
-
-`news` - News theme
88
-
89
-
Alternatively you can use a [Media Chrome theme](https://www.mux.com/docs/guides/player-themes#media-chrome-themes) by passing the theme name as a string and including the theme `<template>` element with that ID in your page:
90
-
91
-
```astro
92
-
---
93
-
import { MuxPlayer } from '@mux/mux-player-astro';
94
-
---
95
-
<template id="tiny-theme">
96
-
<media-controller>
97
-
<slot name="media" slot="media"></slot>
98
-
<media-control-bar>
99
-
<media-play-button></media-play-button>
100
-
</media-control-bar>
101
-
</media-controller>
102
-
</template>
103
-
<MuxPlayer
104
-
playbackId="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
105
-
theme="tiny-theme"
106
-
/>
107
-
```
108
-
109
-
## With Event Handling
110
-
111
-
To add event listeners to the component you can use [a client-side script](https://docs.astro.build/en/guides/client-side-scripts/). You can get the correct types for the player element by importing `MuxPlayerElement` from `@mux/mux-player-astro` and casting the element to that type.
112
-
113
-
```astro
114
-
---
115
-
import { MuxPlayer } from '@mux/mux-player-astro';
116
-
---
117
-
118
-
<MuxPlayer
119
-
id="my-player"
120
-
playbackId="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
121
-
/>
122
-
123
-
<script>
124
-
import type { MuxPlayerElement } from '@mux/mux-player-astro';
125
-
126
-
const player = document.getElementById('my-player') as MuxPlayerElement;
0 commit comments