LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-03-2011, 01:30 AM   #1
zzyxx
LQ Newbie
 
Registered: Nov 2006
Posts: 11

Rep: Reputation: 0
How do I make Firefox run vlc with URL?


I have a server that delivers media via HTTP (or FTP). If I click on a link, it downloads to /tmp and then plays in vlc, but what I want is for it to run vlc and give it the URL so that it will play it as a stream. I am generating the HTML and I'm using thttpd for the server. If I do it manually (Copy Link Location, paste into vlc) it works fine, but I'd like click-and-play. I've Googled for hours and can't even see the topic addressed. This is possible, right?

(Lucid-64, XFCE, Firefox 4.0b11, thttpd, vlc 1.0.6)
 
Old 06-03-2011, 01:36 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,744
Blog Entries: 23

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
Hi,

If it's your (private) server, consider setting up IceCast...full details on install and setting up are on the site! Dunnow what distro you got, but have a peek in the repo, it's bound to be in there...

Happy listening

Thor
 
Old 06-03-2011, 02:35 AM   #3
zzyxx
LQ Newbie
 
Registered: Nov 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Thor_2.0 View Post
Hi,

If it's your (private) server, consider setting up IceCast...full details on install and setting up are on the site! Dunnow what distro you got, but have a peek in the repo, it's bound to be in there...

Happy listening

Thor
Thanks, but actually I was wanting to stream video.

But even with Icecast, what program would be reading it in the browser?
That's the problem I have is making it stream on the client side.
 
Old 06-03-2011, 03:55 AM   #4
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
Quote:
Originally Posted by zzyxx View Post
vlc 1.0.6)
that version is old! latest right now is 1.1.9
Also, you could install mozilla-vlc package. It's a plug-in, and might let you do play your videos while they download instead of waiting for the end of the download.

Another way of achieving what you want could be to download a playlist file that holds the URL for your media, instead of the media file itself. But you'll need to research what exact format vlc supports for this.

m3u would work if your media is mp3.

XSPF format could be what you want, not sure. http://en.wikipedia.org/wiki/XSPF mentions vlc
 
1 members found this post helpful.
Old 06-03-2011, 04:12 AM   #5
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
I checked http://en.wikipedia.org/wiki/XSPF that i mentioned above, and it works on first try on vlc 1.1.9
 
Old 06-03-2011, 09:26 PM   #6
zzyxx
LQ Newbie
 
Registered: Nov 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by 16pide View Post
that version is old! latest right now is 1.1.9
OK, but I don't get how upgrading to a newer version would help.
The problem is in getting Firefox to do the correct thing.

Quote:
Originally Posted by 16pide View Post
Also, you could install mozilla-vlc package. It's a plug-in, and might let you do play your videos while they download instead of waiting for the end of the download.
Nope. I already have that installed and it downloads to /tmp, then plays.

Quote:
Originally Posted by 16pide View Post
Another way of achieving what you want could be to download a playlist file that holds the URL for your media, instead of the media file itself. But you'll need to research what exact format vlc supports for this.

m3u would work if your media is mp3.

XSPF format could be what you want, not sure. http://en.wikipedia.org/wiki/XSPF mentions vlc
OK, but how would that make it stream? Will that give a playlist to vlc?
Would that not expect that the media to play was on the local machine?

I will investigate that though. Thanks.
 
Old 06-05-2011, 02:46 AM   #7
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
Quote:
Originally Posted by zzyxx View Post
OK, but how would that make it stream? Will that give a playlist to vlc?
Would that not expect that the media to play was on the local machine?

I will investigate that though. Thanks.
The idea is that getting the xspf file takes under a second (a few lines of xml). Then vlc gets it from the browser, analyses it, finds a http url in it, and then plays that http url while downloading it.

I tried it (my post above), and could start viewing my video immediately which is what I think you're looking for.

if your version 1.0.6 of vlc does not work with that xspf standard, then upgrade to 1.1.9

Last edited by 16pide; 06-05-2011 at 02:47 AM.
 
Old 06-05-2011, 11:50 PM   #8
zzyxx
LQ Newbie
 
Registered: Nov 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Smile [SOLVED] How do I make Firefox run vlc with URL?

Quote:
Originally Posted by 16pide View Post
The idea is that getting the xspf file takes under a second (a few lines of xml). Then vlc gets it from the browser, analyses it, finds a http url in it, and then plays that http url while downloading it.

I tried it (my post above), and could start viewing my video immediately which is what I think you're looking for.

if your version 1.0.6 of vlc does not work with that xspf standard, then upgrade to 1.1.9
Yes, I tried it and it works well enough. Not perfect, I'd still like to hand the URL to the program, but it works, it is quick as you say, and I don't think it will accumulate and bunch of crap in /tmp. So I will go with this method until I find the ideal solution.

Thanks much 16pide for the idea.
 
Old 06-06-2011, 12:24 AM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,985

Rep: Reputation: 4569Reputation: 4569Reputation: 4569Reputation: 4569Reputation: 4569Reputation: 4569Reputation: 4569Reputation: 4569Reputation: 4569Reputation: 4569Reputation: 4569
Firefox needs to have VLC registered as a protocol handler.

http://kb.mozillazine.org/Register_protocol
 
1 members found this post helpful.
Old 06-06-2011, 11:35 PM   #10
zzyxx
LQ Newbie
 
Registered: Nov 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Unhappy

Quote:
Originally Posted by dugan View Post
Firefox needs to have VLC registered as a protocol handler.

http://kb.mozillazine.org/Register_protocol
Thanks Dugan! That would be really great if it worked, but it doesn't.
Do I have to be running Gnome? I'm running XFCE but it runs Gnome compatibility libraries.

I did:
gconftool-2 -s /desktop/gnome/url-handlers/vlc/command '/usr/bin/vlc %s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/foo/enabled --type Boolean true
then restarted Firefox and tried
vlc://192.168.0.45:8080/path-to-my-file
and it replied:
Firefox doesn't know how to open this address, because the protocol (vlc) isn't associated with any program.
I also tried Opera which did the same thing.

I wonder what it takes to make it work, but thanks for the tip.
 
Old 06-07-2011, 02:47 AM   #11
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,520

Rep: Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664
In Opera go to "Preferences (Alt+p) > Advanced > Programs" and add vlc as a protocol.
 
Old 06-07-2011, 02:18 PM   #12
zzyxx
LQ Newbie
 
Registered: Nov 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by zzyxx View Post
Thanks Dugan! That would be really great if it worked, but it doesn't.
Do I have to be running Gnome? I'm running XFCE but it runs Gnome compatibility libraries.

I did:
gconftool-2 -s /desktop/gnome/url-handlers/vlc/command '/usr/bin/vlc %s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/foo/enabled --type Boolean true
then restarted Firefox and tried
vlc://192.168.0.45:8080/path-to-my-file
and it replied:
Firefox doesn't know how to open this address, because the protocol (vlc) isn't associated with any program.
I also tried Opera which did the same thing.

I wonder what it takes to make it work, but thanks for the tip.
Oh I see an error above. I did not replace foo with vlc in second line. Let me try again...
 
Old 06-07-2011, 11:00 PM   #13
zzyxx
LQ Newbie
 
Registered: Nov 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by zzyxx View Post
Oh I see an error above. I did not replace foo with vlc in second line. Let me try again...
Thanks ruario, and thanks again dugan.

Both of these work now. The Opera setting works, and after I typed the gconftool correctly, that worked too for Firefox.
It now invokes vlc with the URL.

The only problem is, vlc doesn't know how to deal with a URL that starts with "vlc://..." so not sure what to do.
It won't let me invoke a bash script, which I can use to change the vlc to http, so I may have to write a little program.
But that's a whole different problem.
This mission is accomplished.
 
Old 06-08-2011, 01:37 AM   #14
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,520

Rep: Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664
In that case U suspect the fix that dugan gave you would actually have been enough for Opera as well, since it passes off unknown protocols to the desktop environment but it doesn't hurt actually setting it within Opera. Also this would be the best way to do it for someone who ran Opera and a simple window manager, rather than a full desktop environment.
 
Old 06-09-2011, 12:18 AM   #15
zzyxx
LQ Newbie
 
Registered: Nov 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ruario View Post
In that case U suspect the fix that dugan gave you would actually have been enough for Opera as well, since it passes off unknown protocols to the desktop environment but it doesn't hurt actually setting it within Opera. Also this would be the best way to do it for someone who ran Opera and a simple window manager, rather than a full desktop environment.
I will say that Opera was easier to set up.
Ultimately I also want this to work with Macbook, so probably the XSPF will be the way to go there.
It think it will be easier to set up for a given browser to tell it handle .xspf rather than a protocol.
I'm glad I learned both ways to do it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Variable was exported to make FireFox run in a different folder, needs to be reset atari/ Linux - General 2 05-06-2010 06:02 PM
How can i make app to run without path like Firefox and others? QueenZ Linux - Newbie 11 02-16-2009 06:07 AM
How to Save RTSP URL's with VLC JonBL Linux - Software 1 11-11-2007 05:59 AM
firefox URL editing davidleroux1 Linux - Newbie 3 04-24-2005 03:43 AM
Situation with links to url with Firefox WhiteTornado Linux - Software 1 05-29-2004 11:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration