Intranet Apache server, and multimedia

Hi,

I got myself a cheap Android tablet with the main purpose of watching
videos in bed or the sofa, instead of sitting at the computer. And
instead of saving the video to the flash card of the tablet, I serve it
from a machine running apache. It works nicely.

In /etc/apache2/httpd.conf.local I wrote (or rather, YaST wrote, and I
modified a bit):


Alias           /data/store   /data/store

<Directory /data/store/>

Options FollowSymLinks Indexes Includes
AllowOverride All

IndexOptions FancyIndexing \
ScanHTMLTitles \
NameWidth=*

order deny,allow
deny from all
allow from localhost .valinor 192.168.1.51 192.168.1.52 192.168.1.32
</Directory>

And I allow wwwrun access to the directory by using ACLs, instead of
giving the tree universal read rights, or changing the owner or group:


CAMINO=/data/store
find $CAMINO -type d -exec setfacl -m u:wwwrun:rx '{}' \;
find $CAMINO  -type f -exec setfacl -m u:wwwrun:r '{}' \;

It is like a way of adding “owners” or “groups”.

I also created a terribly simple web page. On
“/srv/www/htdocs/index.html” I have:


<html><body>
<h1>Welcome to AmonLanc</a></h1>
<h2>
<a href="/data/store/">[Data]</a> <br>
</h2>
</body></html>

The pages served are like this (auto generated by Apache, and trimmed a
bit for clarity):


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of /data/store/Sueltos</title>
</head>
<body>
<h1>Index of /data/store/Sueltos</h1>
<pre>
<img src="/icons/blank.gif" alt="Icon ">
<a href="?C=N;O=D">Name</a>


<a href="?C=M;O=A">Last modified</a>
<a href="?C=S;O=A">Size</a>
<a href="?C=D;O=A">Description</a>
<hr><img src="/icons/back.gif" alt="[PARENTDIR]">
<a href="/data/store/">
Parent
Directory</a>

-

<img src="/icons/movie.gif" alt="[VID]">
<a href="Salvados%2011x05.(laSexta).avi">
Salvados 11x05 Españoles por Suiza.avi</a>
2013-11-26 05:46  1.0G<hr>
</pre>
<address>Apache/2.4.6 (Linux/SUSE) Server at amonlanc.valinor Port
80</address>
</body></html>

It does work, with caveats.

In the tablet, when tapping on a video with Firefox, it asks me how to
complete the action; it offers a number of apps, and one of them is VLC.
VLC is started standalone, given the URL, and renders the video on the
fly without saving it locally (which is perfect, as some of the videos
are too big for FAT).

However, in Linux, I think it worked yesterday (I’m unsure), but not
today after a reboot of the client machine. Maybe it did not.

Firefox wants to display the video internally, with several plugins.
First xine, which fails. I disable it. Then it wants windows media
player. I disable it. Then mplayer something. I also disable it. Then,
when about the only plugin active is “vlc web plugin”, it works… but
inside Firefox… I would like it outside, stand alone vlc.

If on the plugin page I say “act to activate”, it asks to activate the
plugin it chooses. I can’t choose plugin, or none at all, standalone app.

If I disable VLC plugin, instead FF asks me to save or open with
application. If I tell it to open with vlc, it first downloads the full
video, then starts VLC with it. I do not want that at all.

What should be done so that Firefox starts vlc as a standalone app, same
as in Android, giving VLC the URL as a parameter, automatically?

I can copy the URL to the clipboard, start VLC, then paste the URL. That
does work. But it is a nuisance, not automatic.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

If I understand what you are asking… that you want to launch the standalone VLC, connecting to a remote URL…

From a command line, type

vlc *target *

“Target” can be a URL, path, filename, etc.

So, you will probably want to find a console app for your tablet to do this.

Some alternatives…
Create a shortcut to your tablet desktop configured with the command line above.
Create a playlist. Then after launching VLC, you can select the playlist which includes your URLs.
As for your idea of creating an Index page with URLs to your clips, it <might> work to embed the same command line in the webpage but would require testing to verify it doesn’t run afoul of a security issue launching a local app using a command from the Internet.

Note how using the “vlc” command is how you explicitly invoke the standalone VLC player, over-riding any browser or other settings. Should work with any network-enabled player.

HTH,
TSU

On 2014-09-26 20:36, tsu2 wrote:
>
> If I understand what you are asking… that you want to launch the
> standalone VLC, connecting to a remote URL…
>
> From a command line, type
>
> Code:
> --------------------
> vlc -target -
> --------------------

That is exactly what I do.

I just want to do that automatically from Firefox, with clicks, not cli.

Firefox in the tablet, does that. Several taps, not one, but works.

Firefox in Linux does not.

I want Firefox in Linux to do it, too.

It insists on opening the URL with a plugin, if found; if not found, it
offers instead to download the target, or download and start VLC on the
locally downloaded file. It does not offer to start “vlc target_url”


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Not sure this would help you but i have the package

gecko-mediaplayer

And i have some videos that is hosted by my home webserver vial lan. which plays the video via firefox and not download it. I don’t remember if all the video formats are supported though or is there is a size limit with the video file it can handle.

rpm -ql gecko-mediaplayer
/usr/lib64/browser-plugins/gecko-mediaplayer-dvx.so
/usr/lib64/browser-plugins/gecko-mediaplayer-qt.so
/usr/lib64/browser-plugins/gecko-mediaplayer-rm.so
/usr/lib64/browser-plugins/gecko-mediaplayer-wmp.so
/usr/lib64/browser-plugins/gecko-mediaplayer.so
.................................
.............................

It is a lot easier if your videos are coming from your tablet and you want to play it with you openSUSE box if you have kde install kdeconnect on both tablet and suse :slight_smile:

On 2014-09-27 01:26, jetchisel wrote:
>
> Not sure this would help you but i have the package
>
>
> Code:
> --------------------
> gecko-mediaplayer
> --------------------
>
>
> which plays the video via firefox and not download it.

It is installed (since May).

But you don’t understand.

I can play the videos via Firefox just fine, inside a window or tab of
Firefox, with several plugins. But I want they run outside of Firefox,
in any standalone player of my choice, called automatically by Firefox,
when I click on a video.

Firefox in Android does that. I want Firefox in Linux to do that too.

The server side problem is solved. The issue is Firefox, not Apache,
contrary to what I thought initially.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Configure XBMC?

On 2014-09-27 03:36, jetchisel wrote:
>
> Configure XBMC?

What for?

Sigh… :frowning:

I repeat: I want Firefox to do in Linux the exact same thing that it
does in Android. Period.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Right, sorry it is clear now :-), I have no sleep since shellshock saga started :expressionless:

On 2014-09-26 16:45, Carlos E. R. wrote:

I’ll try again to explain what I want.

I have a machine serving video files with apache (runs openSUSE).

On a Linux client machine, I can open a terminal, type:


vlc "http://amonlanc.valinor/data/store/Sueltos/a_video.avi"

and vlc dutifully obliges by opening a window and displaying the video
on the fly, with little network traffic.

Now, I want to speed up the procedure and have the same thing by
clicking on firefox on the link.

What Firefox does instead is:

a) if a suitable plugin is available, say VLC Web, xine plugin,
xine-player, gecko-mediaplayer, etc, I get a new or same tab, with an
icon on the center asking politely if I want to activate the plugin. I
click on it, and the video starts displaying inside that firefox tab.
It displays instantly, with little network usage. I can fullscreen it,
but it is firefox which is running:


> cer       7467  7.6  8.4 1463416 335928 ?      Sl   04:59   0:55 /usr/lib64/firefox/firefox
> cer       7851  6.4  2.2 1097680 90152 ?       Sl   05:10   0:05  \_ /usr/lib64/firefox/plugin-container /usr/lib64/browser-plugins/libvlcplugin.so -greomni /usr/lib64/firefox/omni.ja -appomni /usr/lib64/firefox/browser/omni.ja -appdir /usr/lib64/firefox/browser 7467 true plugin
> cer       7860  0.0  0.0 126528  3040 ?        Sl   05:10   0:00      \_ rccexternal

It is not the standalone vlc player which runs, with full controls.

b) If I disable all plugins capable of displaying a .avi file, then
firefox offers to download the file, or to “open with”. I can say open
with vlc, but what it does is download the full file (which takes long
and is a waste; it is saved to /tmp/something), and then it calls vlc to
open the local file (not the URL).

What I want is instead to click on the file, and get vlc called with the
URL as a parameter.

And this is what, as far as I can see, happens on my cheap Android
tablet. When I tap on the same link, I get a sort of pop up that says (I
have to translate from Spanish): “Complete this action with” and I get
some icons:


firefox     MX player      ES3 downloader
download

1Mobile Market           VLC


··············

only this time          always


I tap on “VLC” and “only this time” and VLC starts streaming and playing
the video, with little network usage. Perfect.

That is what I want to happen in the Linux Firefox, the same that the
Firefox in Android does: call an external application and pass it the
URL to handle. In other words, automatically call «vlc “URL”» when I
click on the link.

Maybe in Linux an addon is needed that adds an entry to the context menu
to offer that action :-?
Or another entry besides save as and open with.

Maybe Android does not have plugins and does it that way natively?


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Let see if I have understand you right and if I can give some input. Otherwise forget about this post :).

I have 3 Dreambox recivers (can receive cable, terrestrial or satelite signals depending on hw-config). They are running Linux yes.

When I have the webinterface up (in Firefox)of the Dreambox and want to stream the channel I simply click on the small TV (green circle). Not configured openSUSE ask whitch application I want to open “stream.m3u” file in. I choose ->always use VLC.

http://www.jodo.nu/pic/pic2/snapshot59.jpeg

Stream.m3u look like this:

#EXTM3U 
#EXTVLCOPT--http-reconnect=true 
http://192.168.0.6:8001/1:0:1:1B68:42:46:E070000:0:0:0:

The next time openSUSE dont ask but just open up vlc with the stream, notice the content in the top bar of vlc

http://www.jodo.nu/pic/pic2/snapshot60.jpeg

I dont have the details how its working but its more a “proof of concept” on your post I think.

regards

A plugin written in php maybe, or any other language that can do the same . lol!.

On 2014-09-27 09:26, jonte1 wrote:
>
> Let see if I have understand you right and if I can give some input.
> Otherwise forget about this post :).
>
> I have 3 Dreambox recivers (can receive cable, terrestrial or satelite
> signals depending on hw-config). They are running Linux yes.
>
> When I have the webinterface up (in Firefox)of the Dreambox and want to
> stream the channel I simply click on the small TV (green circle). Not
> configured openSUSE ask whitch application I want to open “stream.m3u”
> file in. I choose ->always use VLC.

I see.

Yes, this is a nice, alternate, way. It needs doing something on the
server, ie, generating those Stream.m3u files on the fly - something I
don’t know how to do.

As it is, I just use an Apache feature (mod_autoindex.c, I think) to
display plain directories full of files:

<Directory /data/store/>

Options FollowSymLinks Indexes Includes
AllowOverride All

IndexOptions FancyIndexing
ScanHTMLTitles
NameWidth=*

order deny,allow
deny from all
allow from localhost .valinor 192.168.1.51 192.168.1.52

</Directory>


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

On 2014-09-27 15:06, jetchisel wrote:
>
> A plugin written in php maybe, or any other language that can do the
> same . lol!.

Writing a plugin for firefox is out of my league…

I just hopped that someone knows of an existing one for firefox that
does it. :-}

(“it” is launching an arbitrary or specified program, and giving it the
URL as parameter).

Hum… just found one:

https://addons.mozilla.org/en-US/firefox/addon/url-relay/?src=search

+++······························
URL Relay is a Firefox addon for associating certain URLs with external
applications. If you click on a URL that matches a user defined pattern
the addon starts the associated external application and supplies the
URL as first argument.This is different from the builtin Firefox feature
under Edit/Preferences/Applications. With that you can only instruct
Firefox to download a file of a certain mime-time completely to a
temporary local location which is then supplied to an external
application.Possible use cases for URL relay are for example URLs of
audio/video streams, playlists or bittorent URLs. All cases where you
really want to directly open that URL with an external application
(think: media player like VLC, download manager, scripts or a bittorent
remote control app).The addon works fine. The configuration of patterns
for matching URLs is quite flexible.Currently, afaik, there is no other
addon that provides similar features. But there are several
feature-request bug reports on Firefox for such a functionality which
are open for up to a decade.Some currently missing bonus features that
would make this addon even more awesome: Give some (visual) feedback
when a URL is clicked and URL Relay executes an external app. Also an
indication of the exit status of the external app would be great.
······························+±

It is just it!

Now I have to locate more, and see which one is reputable.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

On the server side you mean ;). I t has been workin trough different versions of Firefox and opensuse. The web-server in Dreambox has deliver the same thing for many years. Actually sins 2004 what I can remember.

regards

  1. I assume a VLC plugin for FF should already exist that specifically launches the standalone VLC player and not the embedded VLC player (embedded in the webpage).

  2. Although I don’t have what you want setup, I find it hard to believe that FF tries so hard to launch an embedded player. But in any case, I’m sure the following should do what you want…

Open Firefox
> Preferences
> Applications tab
> Look for or search for the specific file type… then to the right you should see a default setting and a dropdown arrow, click on the dropdown arrow
> Instead of the likely plugin selection, select “Other” and browse to your VLC binary.

There you go…

TSU

On 2014-09-28 00:26, tsu2 wrote:
>
> 1. I assume a VLC plugin for FF should already exist that specifically
> launches the standalone VLC player and not the embedded VLC player
> (embedded in the webpage).

The only one I have seen is that “URL Relay” I mentioned before, which
I’m still considering. I have been busy otherwise…

…]

Ugh. The scarce instructions are in Japanese.
The setup is complex, you need to enter filters in something that looks
like regex.

The reviews are in English, and what they describe the plugin does is
what I want. That’s the information I based on…

I’ll have to remove the plugin, I have no idea how to set it up :-/

…]

Google found me the instructions and translated them:

> http://translate.google.com/translate?hl=en&sl=ja&u=http://www.osa-p.net/soft.html&prev=/search%3Fq%3D%22URL%2BRelay%22%2Bplugin%26client%3Dfirefox-a%26hs%3DA62%26rls%3Dorg.mozilla:en-US:official%26channel%3Dsb

…]

(thinking)

…]

I still don’t understand a word of it :frowning:

> 2. Although I don’t have what you want setup, I find it hard to believe
> that FF tries so hard to launch an embedded player. But in any case,

It does…

> I’m sure the following should do what you want…
>
> Open Firefox
>> Preferences
>> Applications tab
>> Look for or search for the specific file type… then to the right you
> should see a default setting and a dropdown arrow, click on the dropdown
> arrow
>> Instead of the likely plugin selection, select “Other” and browse to
> your VLC binary.

Does not work. Well, it does, but not the way I want: it first downloads
the entire file, then calls vlc to open it.

It does not directly call vlc with the URL as parameter. The difference
in resources is huge.

There are only two ways to do it in Firefox in Linux, besides that
plugin that I don’t know how to use:

Right click on the link.
Select “copy link location”.

  1. open vlc or xine or smplayer, and paste the URL onto it.
    or
  2. do the same on the command line


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)