Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
karpov-kir committed Dec 17, 2024
1 parent dc574b7 commit d3b9cc5
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,25 @@ The same applies to the `customUi` object.
## Attach event listeners

```tsx
import { useMemo } from "react";
import { PlayerConfig, PlayerEvent } from "bitmovin-player";

export function MyComponent() {
const playerConfig: PlayerConfig = {
key: "<key>",
playback: {
muted: true,
autoplay: true,
},
events: {
[PlayerEvent.Play]: (event) => {
console.log("Play event fired", event);
const playerConfig: PlayerConfig = useMemo(
() => ({
key: '<key>',
playback: {
muted: true,
autoplay: true,
},
},
};
events: {
[PlayerEvent.Play]: event => {
console.log('Play event fired', event);
},
},
}),
[],
);

return (
<Fragment>
Expand Down

0 comments on commit d3b9cc5

Please sign in to comment.