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

fix: Add Default Aria-Label, Update Docs #1919

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Prop | Description | Default
`wrapper` | Element or component to use as the container element | `div`
`playIcon` | Element or component to use as the play icon in light mode
`previewTabIndex` | Set the tab index to be used on light mode | 0
`previewAriaLabel` | Set a custom ARIA label for the video preview element | `Play Video`
`config` | Override options for the various players, see [config prop](#config-prop)

#### Callback props
Expand Down
2 changes: 1 addition & 1 deletion src/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default class Preview extends Component {
onClick={onClick}
tabIndex={previewTabIndex}
onKeyPress={this.handleKeyPress}
{...(previewAriaLabel ? { 'aria-label': previewAriaLabel } : {})}
aria-label={previewAriaLabel}
>
{isElement ? light : null}
{playIcon || defaultPlayIcon}
Expand Down
2 changes: 1 addition & 1 deletion src/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const defaultProps = {
fallback: null,
wrapper: 'div',
previewTabIndex: 0,
previewAriaLabel: '',
previewAriaLabel: 'Play Video',
oEmbedUrl: 'https://noembed.com/embed?url={url}',
config: {
soundcloud: {
Expand Down
1 change: 1 addition & 0 deletions types/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface BaseReactPlayerProps {
playsinline?: boolean
playIcon?: ReactElement
previewTabIndex?: number | null
previewAriaLabel?: string
pip?: boolean
stopOnUnmount?: boolean
light?: boolean | string | ReactElement
Expand Down