mootools / mootools-core

MooTools Core Repository
https://mootools.net
2.65k stars 510 forks source link

Added media events to "NativeEvents" object #2727

Open nbish11 opened 9 years ago

SergioCrisostomo commented 9 years ago

Nice!

Related: https://github.com/mootools/mootools-core/pull/2520

GCheung55 commented 9 years ago

@nbish11 Thank you for the contribution! Could you also add some tests as well? It will help the code base be more reliable with your changes.

Here is an example for writing tests. Please check out the Spec folder as well.

nbish11 commented 9 years ago

@GCheung55 I'm not very good at writing tests, but if you can link the original tests for the events already there (or a more specialized example of writing tests for events), I'll be happy to write some.

SergioCrisostomo commented 9 years ago

I would also like to see this being included, but looking deeper into this I suggest delaying this.

The problematic is that old browsers don't support this. So this would have to be included in a future MooTools version that has dropped old Browsers.

The spec could be something like this maybe, using native event dispatcher API, but I think some events like progress might have to be normalized inside MooTools because they work different in different browsers.

arian commented 9 years ago

@SergioCrisostomo you can't even normalize these events, because older browsers don't have video/audio support at all. Besides not all events that are currently in NativeEvents are supported by all browsers (input/paste), but it's still useful that MooTools directly redirects it to the native/browser events.