diff options
author | akuma06 <demon.akuma06@gmail.com> | 2020-05-05 15:34:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-05 15:34:41 +0200 |
commit | 1f63806c3f1e678f9a88124f577c22a34e0c5e5c (patch) | |
tree | b60c5fe6dcb8727afb4413c0ef5088331b8bedd0 /demo/src/js/demo.js | |
parent | 6cb822d56f39656dc079337c35316cdb824a397b (diff) | |
download | plyr-1f63806c3f1e678f9a88124f577c22a34e0c5e5c.tar.lz plyr-1f63806c3f1e678f9a88124f577c22a34e0c5e5c.tar.xz plyr-1f63806c3f1e678f9a88124f577c22a34e0c5e5c.zip |
Fixing "missing code in detail" for PlyrEvent type
When using typescript and listening for youtube statechange event, it is missing the code property definition inside the event (even though it is provided in the code).
By making events a map of key-value, we can add easily custom event type for specific event name. Since YouTube "statechange" event differs from the basic PlyrEvent, I added a new Event Type "PlyrStateChangeEvent" having a code property corresponding to a YoutubeState enum defined by the YouTube API documentation.
This pattern follows how addEventListener in the lib.dom.d.ts is defined.
Diffstat (limited to 'demo/src/js/demo.js')
0 files changed, 0 insertions, 0 deletions