On my page, I've a MediaElementPlayer created for a <video>
element using $('#video-id').medialementplayer(options)
. This element is hidden (using display: none
) and turned into a modal dialog using jQuery UI.
I'm trying to bind the open/close event on this dialog to start/pause the palyer. The script handling the $(...).dialog(options)
is separated from the script handling the $(...).medialementplayer(options)
and don't have access to the created MediaElementPlayer
.
If I was purely using HTML5 video element, I could retrieve the player using $('video', dialogContentElement).get(O)
, but since I'm using MediaElement.js I can't rely on this method to retrieve the actual player.
Does MediaElement.js provide a way to retrieve the existing MediaElementPlayer (or MediaElement) instance for a <video>
or <audio>
element? Or do I've to manage my own player registry?