LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-29-2010, 02:37 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
Looking for a "better" way to have the browser launch an external media player


I'm working on an internal website for my company. I need a way for a user to click on a link & launch an external media player.

I'm currently doing it by making up a mime type called "application/bash", setting each user's firefox to open content of "application/bash" with bash, then simply writing a command to the "file" that's downloaded (i.e. a bash script)... so when the user clicks the link, their browser sends the content to bash, bash runs the script which calls the media player, and the media player plays.

This works fairly well, but it feels super hacky, not to mention the security risks involved, especially considering the file to open is url encoded in the request (i.e. in the GET). (I do take care to check that the file requested exists before packaging up the bash script for download & that it doesn't contain any funky characters like ';' but still).

With all that said, is there a more "legitimate" way to get the browser to launch an external application? While security is always a concern, it's a little less of a concern in this case as this is an internal site - only viewable from within the building, so I can let a few things slide if need be (though I'd rather not).
 
Old 04-29-2010, 11:28 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Create playlist files and set the browser to associate the playlist with the media player.
The format of the playlist differs according to media player.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Chromium doesn't save "default browser"+ Desktop isn't "snappy" ohadbasan Arch 1 01-25-2010 08:07 PM
External hd - "HP Personal Media Drive" Endoro Linux - Newbie 2 11-13-2009 09:16 AM
"unable To Launch Mozilla Browser In Root?" majji.hari Linux - Newbie 1 12-15-2007 11:18 AM
/media lists "cdrom" and "cdrom1" jerrybasham MEPIS 4 04-17-2007 04:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:56 AM.

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