javascript - How can I use the React media synthetic event listener on an audio element? -


facebook/react lists "media events" on page:

https://facebook.github.io/react/docs/events.html

i trying execute function on pause/play , i'm trying:

      <audio                              id="globalaudio"                  onplay={this._onplay}             onpause={this._onpause}>        </audio>          

but functions aren't firing. i'm aware can add event listener like:

let ga = document.getelementbyid("globalaudio");         ga.addeventlistener("play", this._onplay);                ga.addeventlistener("pause", this._onpause);              

but i'm wondering how use syntheticevent talk in above link, or if there other convention followed react listening events these.

i needed upgrade react. still using version had listed in todo list tutorial.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -