I have vlc player embedded in html code, the video is playing fine, but I cannot get a javascript reference to the player and can therefore not acces the javascript API. I do get a reference to the html element, but it is lacking all of the properties/functions of the vlc API. As far as I can see I'm following the examples in the documentation for the WebPlugin.
I'm using firefox v 57.0.4 for Windows.
I have vlc v. 2.2.8 installed with the Mozilla addOn.
(I have Windows 10, if that may be of any interest)
This is my code:
Code: Select all
<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab" id="vlc">
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" src="http://www.html5videoplayer.net/videos/toystory.mp4" name="vlc" width="640" height="480" />
</object>
<script type="text/javascript">
function test(){
var vlc = document.getElementById("vlc");
console.log(vlc.VersionInfo);
}
</script>
<button onclick="test()">Run code</button>
I'm invoking the code by clicking a button only to make sure that the vlc player has really been loaded.
Ps. I have also tried to embed the player without the object element like this:
Code: Select all
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" src="http://www.html5videoplayer.net/videos/toystory.mp4" id="vlc" width="640" height="480" />
Greatful for help!