VLC plugin HTML embed using Javascript - network caching

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
guso11
New Cone
New Cone
Posts: 6
Joined: 04 Feb 2013 15:29

VLC plugin HTML embed using Javascript - network caching

Postby guso11 » 04 Feb 2013 15:43

Hi everyone,

i'm trying to embed a video stream into an html file. I found a way that works using VLC plugin and Javascript that looks like this:

<embed type="application/x-vlc-plugin"
name="102"
autoplay="yes" loop="yes" width=100% height="505"
target="rtsp://root:1234@10.0.50.101/axis-media/media.amp" />

forget about "root:1234" which is just a way to login into the streaming webcam without a prompt. This solution works.
But the thing is i get 2-3seconds delay while watching. I'm using an RTSP H264 stream.
So i googled a lot to find a way to reduce real-time delay and found this solution:

<script>
var vlc = document.getElementById("vlc");
vlc.playlist.add("rtsp://root:1234@10.0.50.101/axis-media/media.amp", "live",
":network-caching=150");
vlc.playlist.play();
</script>

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2"
width="640"
height="480"
id="vlc"
</embed>

but what i see is just an istance of a video player and it's all black like if the video stream is not on.
Do you have any suggestion? where am i wrong?

cheers!

guso11
New Cone
New Cone
Posts: 6
Joined: 04 Feb 2013 15:29

Re: VLC plugin HTML embed using Javascript - network caching

Postby guso11 » 04 Feb 2013 15:47

the short question is: "how can i reduce streaming delay using vlc-plugin and Javascript on html pages" ? thanx

guso11
New Cone
New Cone
Posts: 6
Joined: 04 Feb 2013 15:29

Re: VLC plugin HTML embed using Javascript - network caching

Postby guso11 » 04 Feb 2013 17:57

UPDATE:

i managed to make this code work by inverting the order of blocks of code like this:

<body>

<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2"
width="640"
height="480"
id="vlc"
</embed>

<script>
var vlc = document.getElementById("vlc");
vlc.playlist.add("rtsp://root:1234@10.0.50.101/axis-media/media.amp", "live",
":network-caching=150");
vlc.playlist.play();
</script>

</body>


but there's another problem now:

this code works on win7 using VLC 2.0.5 and on ubuntu 12.04 LTS using VLC 2.0.5, but under windows i actually get rid off streaming delay instead on ubuntu 12.04 it looks like ignoring the option ":network-caching=150" and keeps having the 2-3seconds annoying delay.

any ideas?
thanx

guso11
New Cone
New Cone
Posts: 6
Joined: 04 Feb 2013 15:29

Re: VLC plugin HTML embed using Javascript - network caching

Postby guso11 » 05 Feb 2013 11:34

ok guys there's another update:

the last code i posted WORKS on ANY browser under windows 7, which means the delay disappeared. All good.
But i want to use this html code under ubuntu 12.04. on ubuntu the delay is still present, like if the network caching parameter is ignored.
I think this is a bit weird cause vlc is something opensource and related to linux, but it works better on windows, than on the penguin??? crazy!

Is there anyone who can help me please?
thank u

guso11
New Cone
New Cone
Posts: 6
Joined: 04 Feb 2013 15:29

Re: VLC plugin HTML embed using Javascript - network caching

Postby guso11 » 07 Feb 2013 12:25

Hi everyone!

first of all, i'd like to thank u for the HUGE amount of replies posted. You were just soooo helpful.
second: i managed to get to the solution.
As I'm happy to help anyone who can have my same issue in the future, i'll tell you how i solved it.

Firefox comes already with some basic plugins; you can view them by File>Add ons.
The thing is, on ubuntu there is a VLC plugin which is related to Totem. This is not the correct plugin to use. You need to disable it in the Add ons page.
Then you need to install the correct VLC plugin called "VLC Plugin" from here
http://addons.videolan.org/index.php?xcontentmode=903
restart Firefox and the code already provided in the previous post will work without any delay.

On windows there is no such a Totem plugin (of course) so browsers already have VLC plugin installed, and that's why everything worked already with Bill's OS
Cheers!

yushalee10
Blank Cone
Blank Cone
Posts: 14
Joined: 05 Mar 2013 13:29

Re: VLC plugin HTML embed using Javascript - network caching

Postby yushalee10 » 29 Mar 2013 00:43

Hi, I'm trying to get all this up on my webpage. I followed a few other directions, and of course Im having issues. I need a simple html embed code so that the client computer can get the plugin needed to view the video feed. I've done everything else and can view it on my own computer but when I go to another computer which does not have vlc installed, the browser says there is no plug in available to view the stream. Any ideas?

guso11
New Cone
New Cone
Posts: 6
Joined: 04 Feb 2013 15:29

Re: VLC plugin HTML embed using Javascript - network caching

Postby guso11 » 12 Apr 2013 10:30

Hey man,

without VLC installed you cannot play anything of course!


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 4 guests