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

Basic support for Events #19

Open
nicolaslevy opened this issue Dec 11, 2024 · 5 comments
Open

Basic support for Events #19

nicolaslevy opened this issue Dec 11, 2024 · 5 comments
Assignees

Comments

@nicolaslevy
Copy link

The goal is to implement the most common events for a video player to improve its interactivity and facilitate integration with applications. The implemented events should adhere to industry standards and cover the most frequent use cases. With this we will be able to interact with the player, and even build plugins based on the events the Player triggers :D

moqplayer.addEventListener('play', () => {
    console.log('Video started playing');
});

We can use HTMLMediaElement Events documentation as a reference: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#events

Basic Playback Events:

  • waiting: Fired when playback has stopped because of a temporary lack of data.
  • loadeddata: Fired when the first frame of the media has finished loading.
  • play: Triggered when the video starts playing.
  • pause: Triggered when the video playback is paused.
  • ended: Triggered when the video reaches the end.
  • (nonstandard) adaptation: Triggered when the player changes the rendered video or audio track. (see ShakaPlayer -> AdapationEvent )
  • (nonstandard) catalogupdated: Triggered when the catalog is updated. (see ShakaPlayer -> ManifestUpdatedEvent)

User Interaction Events:

  • volumechange: Triggered when the user adjusts the volume.
  • fullscreenchange: Triggered when the user enters or exits fullscreen mode.

Player State Events:

  • loadedmetadata: Triggered when the video metadata (duration, dimensions, etc.) has been loaded.
  • timeupdate: Triggered periodically as the video plays, providing the current playback time.
  • error: Triggered when an error occurs during video playback.
@Manuel-Barrabino
Copy link
Contributor

I will pick this one up!

@nicolaslevy
Copy link
Author

Zafer: Suscribedone, subscribestared can also be imploemeted

@englishm
Copy link
Owner

If we wanted to get really fancy we could look at adding events for things like SCTE-35 markers, as well.

@Manuel-Barrabino
Copy link
Contributor

pr here on @JoaquinBCh repo awaiting the merge of this pr

@nicolaslevy
Copy link
Author

Just saw @Manuel-Barrabino new PR for this issue #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants