mediaelement / mediaelement-plugins

Plugins for the main mediaelement project
405 stars 137 forks source link

Audio description in a11y not working for external YouTube videos #199

Open digitas-git opened 3 years ago

digitas-git commented 3 years ago

Using the a11y plugin for adding audio description I recognized, that it works fine if I don't use videos rom YouTube. The button for audio description is added but there is no effect clicking it.

It seems that the EventListeners for playing, pausing, timeupdate etc. added to the player.node are working fine for "local" videos, but that for YouTube videos the player.media (that is the wrapper for the iframe tag and the video tag) needs these eventListeners. Changing t.node.addEventListener to t.media.addEventListener makes the plugin work also for YouTube videos. Also the timeupdate event and the volumechange event have to be modified because t.node.currentTime or t.node.volume are unknown for YouTube videos.

I will add a pull request for this and link it here.

Edited: Pull request is here: https://github.com/mediaelement/mediaelement-plugins/pull/200