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

Support for media events #2090

Closed
yocontra opened this issue Aug 26, 2014 · 6 comments
Closed

Support for media events #2090

yocontra opened this issue Aug 26, 2014 · 6 comments

Comments

@yocontra
Copy link
Contributor

Currently no media events are supported, which makes working with audio or video tags in react a pain in the ass

componentDidMount: function () {
    var audioElement = this.refs.audioObject.getDOMNode();
    audioElement.addEventListener('progress', this.updateProgress);
    audioElement.addEventListener('timeupdate', this.updateProgress);
    audioElement.addEventListener('ended', this.handleMediaEnd);
},
componentWillUnmount: function () {
    var audioElement = this.refs.audioObject.getDOMNode();
    audioElement.removeEventListener('progress', this.updateProgress);
    audioElement.removeEventListener('timeupdate', this.updateProgress);
    audioElement.removeEventListener('ended', this.handleMediaEnd);
}

There are also still many missing attributes for audio and video tags. I find it strange that these tags are completely unsupported - they should probably be removed from the list in the documentation to reduce confusion until they are properly supported.

@yocontra
Copy link
Contributor Author

Related: #1474

@syranide
Copy link
Contributor

@contra Be sure that you understand the current limitations of audio/video/etc in React: #870 (just so you don't go on ahead and face unexpected issues)

@yocontra
Copy link
Contributor Author

@syranide I haven't had any issues so far, I'm working on http://wearefractal.com/hymn/ for reference

@syranide
Copy link
Contributor

@contra If it or its (parents too!) siblings move/reorder the audio/video will stop playing, if that isn't a problem for you then great. :)

@jimfb
Copy link
Contributor

jimfb commented Jan 12, 2016

I think we support all these now. https://facebook.github.io/react/docs/events.html#media-events

@jimfb jimfb closed this as completed Jan 12, 2016
@yocontra
Copy link
Contributor Author

@jimfb I've waited a long time (issue open since 2014) to say this: thank you for adding support for video and audio tags.

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

No branches or pull requests

3 participants