Sample HTML to embed UDP stream

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
RC4G
New Cone
New Cone
Posts: 8
Joined: 04 Feb 2016 19:13

Sample HTML to embed UDP stream

Postby RC4G » 04 Feb 2016 19:24

I'm a newb to utilizing the VLC plug-in to embed a a video stream within a web page so I'm trying to get sample code that will allow me to embed a multicast UDP stream within a web page for both Firefox and IE.

The multicast UDP network stream "udp://@239.20.0.21:5000" plays successfully in the windows VLC application although I have to set Deinterlace=Auto to display correctly.

I did a forum search and modified some sample code to create the following that works in Firefox but not IE (VLC player shows in page but does not play stream):

Code: Select all

<html> <title>VLC plugin test page</title> <body> <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="1280" height="720" id="vlc" </embed> <script> var vlc = document.getElementById("vlc"); vlc.playlist.add("udp://@239.20.0.21:5000", "CNN"); vlc.playlist.play(); vlc.video.deinterlace.enable("blend"); </script> </body>
How do I modify this code for the following:
1. Support both IE and Firefox browsers
2. Set play Audio Volume to a specific level, e.g. 25%
3. Embeds/activates appropriate plugin or ActiveX control (depending on client browser) without having to install full version of VLC on client workstation.

Thanks.

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: Sample HTML to embed UDP stream

Postby da2424 » 04 Feb 2016 20:35

1. Do you use the latest version of VLC plugin? Since v2.2.0, this code should work for both browsers.

2. Since the upcoming version v2.2.2, you can set it on this way:

Code: Select all

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="1280" height="720" id="vlc" volume="25" />
For older versions, you can set it on this way:

Code: Select all

<script type="text/javascript"> var vlc = document.getElementById("vlc"); vlc.audio.volume = 25; ....
Btw: You can find all available methods, properties and events here: https://wiki.videolan.org/Documentation:WebPlugin

3. This is not completely possible. It's necessary that the library axvlc.dll for Internet Explorer is already registered with regsvr32. But this will also work with the 7zip package, so it's not necessary to install VLC itself. I'm not sure what exactly is necessary for the firefox plugin, but as far as I know are there also some requirements, like registry entries and a specific path.

RC4G
New Cone
New Cone
Posts: 8
Joined: 04 Feb 2016 19:13

Re: Sample HTML to embed UDP stream

Postby RC4G » 04 Feb 2016 21:20

As I indicated originally it works fine for Firefox but you get nothing in IE.

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: Sample HTML to embed UDP stream

Postby da2424 » 05 Feb 2016 16:12

I did a forum search and modified some sample code to create the following that works in Firefox but not IE (VLC player shows in page but does not play stream)
What returns vlc.VersionInfo ?
What returns vlc.playlist.items.count after you added the stream?

matrix.black
New Cone
New Cone
Posts: 4
Joined: 31 Jul 2016 09:31

Re: Sample HTML to embed UDP stream

Postby matrix.black » 24 Aug 2016 06:22

how to show audio level in html coding?

markarkark
New Cone
New Cone
Posts: 1
Joined: 04 Sep 2016 00:53

Re: Sample HTML to embed UDP stream

Postby markarkark » 04 Sep 2016 01:51

I have an VLC player with a playlist I use for my small television station. It works great. I would like to copy my content to the internet, then use an online VLC player, create the same files and playlist. The scripts that I have seen have no menu, so I can't create a playlist. I can't find any information online and this is the only site I have been able to post on. Please help if you can. What I am wanting to do is have an online vlc player with the same folder and playlist. This way I could create it for my station and simply upload the playlist, it would then pull the video from the duplicate site and play. Any help would be appreciated.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 4 guests