Skip to content

Commit

Permalink
feat: add PLAY event
Browse files Browse the repository at this point in the history
  • Loading branch information
martinstark committed Mar 2, 2023
1 parent a4484ca commit 98ac627
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ Can not trigger during a seek.

Can not trigger without a preceding buffering event.

### play

Playback has been requested

Cannot trigger before loaded.

### playing

Playback has started.
Expand Down
4 changes: 4 additions & 0 deletions src/media-event-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export enum FilteredMediaEvent {
BUFFERING = "buffering",
/** Buffering has ended */
BUFFERED = "buffered",
/** A request to start playing again has been made */
PLAY = "play",
/** The stream has started playing after loading completed
* OR the stream has started playing after the stream was previously paused */
PLAYING = "playing",
Expand Down Expand Up @@ -226,6 +228,8 @@ export const getVideoEventFilter = ({
...state,
playRequested: true,
};

callback(FilteredMediaEvent.PLAY);
};

const onPlaying = (): void => {
Expand Down

0 comments on commit 98ac627

Please sign in to comment.