Listen to and relay play and pause events on media element #1104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Short description of changes:
Added automatic listening to the
"play"
and"pause"
events of the provided media element. In the current implementation, I can only control audio playback from within the context ofwavesurfer.js
. In the application I'm building, I want to have the media element be the single source of audio playback control, allowing thewavesurfer.js
instance to be a single part of a group of visualizations rather than the main controller.Breaking in the external API:
None that I am aware of
Breaking changes in the internal API:
None that I am aware of
Todos/Notes:
I don't know if this has any unexpected consequences but it worked perfectly for me with this simple change when running
wavesurfer.js
with the{backend: "MediaElement"}
configuration.Related Issues and other PRs:
N/A