VLC and javascript
Posted: 20 Feb 2012 01:43
I have been trying to use the VLC plug-in in javascript (specifically in the Mozilla browser). There are two things that the user is going to initiate via a button/link click: take snapshot and start/stop record.
I have not been able to find the javascript API in order to do this though. First of all, is it even possible?
The following HTML will be generated dynamically when the user clicks to open up the stream:
I have tried several things so far that have not panned out. I also am unable to find any documentation online that shows good examples. It seems like these two functions would be part of the basic functionality. Any help would be appreciated thanks.
I have not been able to find the javascript API in order to do this though. First of all, is it even possible?
The following HTML will be generated dynamically when the user clicks to open up the stream:
Code: Select all
<html>
<head>
<script type="text/javascript">
function snapshotClicked() {
// take a snapshot
var player = document.getElementById('video: my video');
}
function videoClicked() {
// maybe do something...but for now not.
}
function recordClicked() {
// start recording
var player = document.getElementById('video: my video');
}
function stopRecordClicked() {
// stop recording
var player = document.getElementById('video: my video');
}
</script>
</head>
<body>
<div id="embeddedVideo">
<embed type="application/x-vlc-plugin" version="VideoLAN.VLCPlugin.2"
name="video" id="video: my video" autoplay="yes" loop="yes"
target="movie4.mpg"
width="75%" height="75%" onfocus="javascript:videoClicked();" />
</div>
<div id="snapshotButton">
<a href="javascript:snapshotClicked();">SNAPSHOT!!</a>
<a href="javascript:recordClicked();">Record</a>
<a href="javascript:stopRecordClicked();">Stop Record</a>
</div>
</body>
</html>