Skip to content

Expected onPlaybackRateChange callback prop #1222

Description

@Yasamato

Current Behavior

No onPlaybackRateChange callback prop or something similar exists, passing a custom listener via e.g.

config={{
  "youtube": {
    embedOptions: {
      events: {
        "onPlaybackRateChange": (e) => newPlaybackRate(e.data)
      }
    }
  }
}}

will break all the other listeners definable: https://github.com/cookpete/react-player#callback-props

As react-player itself mentions as a warning in the console output:

Using embedOptions.events will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause

Expected Behavior

Have a onPlaybackRateChange callback prop for the providers that support it or do not break all the other listeners.
As YT, Wistia and file paths are also the only one (to my knowledge) that support the prop playbackRate and also have a onPlaybackRateChange event, I expected react-player to have a unified callback prop as well.

Other Information

YouTube: https://developers.google.com/youtube/iframe_api_reference#onPlaybackRateChange
Wistia: https://wistia.com/support/developers/player-api#playbackratechange
HTML: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/ratechange_event

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions