Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

local media files


has anybody experience with installation of the JW FLV Player playing files that are stored locally, i.e. player and playlists are stored on he webserver but the files are stored locally.
This is the way I tried to make it work with a local file on my mac computer:

<?xml version="1.0" encoding="UTF-8"?>
<playlist version="0" xmlns = "http://xspf.org/ns/0/">
<trackList>
<track>
<location>file:///Users/schornoc/Documents/Dokumente_Reccoll/musikzimmer_todo/music2burn/1/2.mp3</location>
<image>http://www.musikzimmer.ch/pics/covers/albums/1.jpg</image>
<annotation>Track 2</annotation>
</track>
...

and on the PC respectively
<location>file:///f:/01_songs/1911/1.mp3</location>

Can anybody help?

21 Community Answers

JW Player

User  
0 rated :

i dont think that is possible at all for security reasons - else anybody could read any of your files from outside-
you need an online player to play online files - an offline player to play offline files...

please see the offlinemediaplayer and onlinemediaplayer on the demopage:

http://home5.inet.tele.dk/nyboe/flash/mediaplayer/

http://home5.inet.tele.dk/nyboe/flash/mediaplayer/onlinemediaplayer.htm
http://home5.inet.tele.dk/nyboe/flash/mediaplayer/offlineplayer.zip

JW Player

User  
0 rated :

thank you very much for your answer andersen.

what I don't understand is that with the local location-tag I use:
<location>file:///Users/schornoc/Documents/Dokumente_Reccoll/musikzimmer_todo/music2burn/1/2.mp3</location>
that I allow other users to read my files exept you have the same file on a mac computer in the same path and directory.
Therefore I don't see the security problem.

The quicktime plugin can play any local file in the browser. Why can't the flashplayer?

I've tried your local flashplayer but couldn't find the feature that is necessary for my application - it doesn't play playlists does it?

Thank you again
christian

JW Player

User  
0 rated :

the playlist and the player must be on the same server -
from the Supported Playlists page: http://www.jeroenwijering.com/?item=Supported_Playlists bc.. a playlist should always reside on the same server as the SWF file, due to security restrictions of the Flash Player. This can be solved if you own the domain on which the mediafiles reside. You then have to put a crossdomain.xml file in the root webfolder of that server. In this file, you can specifically allow sites to load data. An example is the crossdomain file from Youtube - http://youtube.com/crossdomain.xml
if you change the *height* of the offlineplayer it will show the playlist you load...

JW Player

User  
0 rated :

Allowing local file access for an online file is a *_HUGE_* security risk.

Here's why:

Let's say that local file access is allowed and you use mediaplayer.swf from my site to play your local files.

*_What you don't know is that my mediaplayer.swf is also secretly reading other files on your computer and sending them to my server.

Ta Da...


All your files are belong to me..._*

JW Player

User  
0 rated :

I see - sounds not very comfortable.

Thank you very much for your answer, Ajax!

JW Player

User  
0 rated :

Hi Andersen

Thank you for your information - this was very useful so far ...

>>if you change the height of the offlineplayer it will show the playlist you load...

Haven't got the time today for thorough exploration of your offlineplayer. For the moment I can load a playlist and it shows with the "|<" ">|" Icons in the bottom-bar of the player. So I'm glad to have the basic function I loked for.

But I didn't find a way of displaying the tracklist by changing the height of the player as you proposed. Did I get you wrong?

Christian

JW Player

User  
0 rated :

find this line: *theHeight=theDisplayheight+19;*
and add the height you want your playlist: theHeight=theDisplayheight+19*+100*;

JW Player

User  
0 rated :

I am developing an application and have hit a bump with the player, the flash player is locally hosted and needs to play a locally hosted playlist, but, it wont load. It detects its existance, but wont load it.

file://c:/blah/player.swf

wont read

file://c:/blah/blah/playlist.xml

JW Player

User  
0 rated :

Take a look at this code; it's for a standalone (offline) player with a playlist.

*http://www.jeroenwijering.com/?thread=6080#msg27251*

JW Player

User  
0 rated :

oy['yo'y

JW Player

User  
0 rated :

@andersen

Thanks a lot for the desktop implementation of the jw flv player. I had a problem using it, but now I know it isn't the player that was wrong ;-)

JW Player

User  
0 rated :

@Thijs - thanks for the heads up ! - it still works in IE, but it does indeed seem to be broken in O9 and FF3 flash10 too -
ill see if i can fix it - i dont have access to a mac - but if i can make it work in FF and O - there is hope it will work on mac too

JW Player

User  
0 rated :

@Thijs et al - *HUGE* trouble !

apparently we can forget about selecting local files for playing through HTML - even in a local JW-player im afraid !
it still works with playlist and hardcoded paths for single files though (both relative and absolute) - but selecting files are OUT -

the problem it would seem, is *not *the increased security of flash 10 - but increased security in FF3 and various others
and for all i have been able to gather from perusing the web - there is just no really viable way around this -
all methods i have been able to find - are way to complicated (meaning i couldnt make it work) or require lowering general security of the browser in a way that would not be recommendable...

it still works nicely with IE7 but it seems that IE8 will bring and end to that too !
it seem to be a rather big issue on the web as a search will show:
*http://www.google.com/search?hl=ena&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=html+input+type+file+full+path+mozilla*
and heres a discussion on bugzilla, not leaving much hope - *https://bugzilla.mozilla.org/show_bug.cgi?id=143220*
(i would have imagined it possible for the browsers to distinguish between local and online security issues - but considering the amount of devious energy the unnice people put into robbing schemes, i guess not)

this really saddens me - as this now disappearing possibility of local file selection for the player (crossbrowser) was one of the main reasons i started programming for the JW-player.

i will give it a few more tries (using flash maybe ?) but im not too optimistic, so the likelyhood is that ill remove the ofline player at the latest when IE8 is officially released - rendering the method just about completely obsolete...

JW Player

User  
0 rated :

So it would seem that the way to go would be to use a tiny, lightweight web server.

*http://en.wikipedia.org/wiki/Tiny_web_servers*

Just for the heck of it, I installed TinyWeb, which at 58,880 is about as small as you can go.
Installation: unzip TINY.EXE to the directory where your HTML files are and run or type in a command window:bc.. tiny.exe "c:\Program Files\LightTPD\htdocs" 9000



Browse to: *http://192.168.0.7:9000/PIP.html* (A PIP page with two JW FLV Media Players playing the bunny.mp4 picture-in-picture.) Under 10% CPU for the two videos including the browser and the server.

ZwebServer and shttpd work well also.

For a developer, I would go with LightTPD, because then you get FLV & H.264 streaming (no H.264 for Windows yet) and Fast-CGI for scripting. A couple of clicks to install LightTPD, a couple more clicks to install PHP, a little bit of configuring and you have a fast, streaming server. Anybody who needs the configuration for Windows just ask. It's also on the Internet.

JW Player

User  
0 rated :

@kLink - thank you very much for pointers ! - you are right ofcourse - that will be the only way to select local files soon..

running servers locally unfortunately introduces all the ususal platform/OS issues, and if i have to force my users to install programs i can just as well write a proper .exe with all the advantages (and the opposites) that brings...

further i have spend years specializing in clientside issues, making a sport of exhausting clientside possibilities - so just about the only thing i know about servers is that there is just SO much i dont know about servers...

for instance - doesnt running a server locally on a machine connected to the internet introduce further security issues ?
i do use firewalls that will alert me for both incomming and outgoing requests - but, havent much idea what all the ports mean

JW Player

User  
0 rated :

@andersen,

Running one of those tiny servers doesn't pose much of a security risk because you run it locally, on a port that is firewalled, so there is no access from the Internet. I have three of those tiny servers running on 9000, 9001, 9002. They are not accessible from the Internet because I didn't open those ports in my firewall.

Try one of them, I posted the command line for TinyWeb above, ZwebServer has a GUI for entering the doc root and port, and shttpd uses a config file. As a bonus, you get logging with TinyWeb and shttpd, which can be very useful for development. shttpd also runs scripts if you install PHP.

As I stated above, the best server for a developer is LightTPD because you get FLV and H.264 streaming. Or if you want real RTMP streaming (for FLV and soon MP4) install Red5, it's a standard Windows install, just a few clicks.

JW Player

User  
0 rated :

@kLink - thanks again ! - :D

JW Player

User  
0 rated :

ok, i have now tried to make a fileopener-plugin in flash actionscript - but, unfortunately with no success !
the actionscript FileReference is also stripped of the path and there seem to be no way to get around this restriction...
(and as the reason supposedly is security, it might be for the better)

note though - it is still possible to select and play local files as long as they are in the same folder as the player and page...

JW Player

User  
0 rated :

no, no - full hardcoded paths ofcourse will work ! - the issue is only that it is no longer possible in any but IE7 to get at the full path from <input type=file elements - so it is not possible to make local file players with file selection in .html any longer
for files outside of the directory where the player and page are - a rather unusual and special usage, admitted...
(and the reason is not flash 10 - but rather the browsers them selves - but flash actionscript also use the same restriction)

JW Player

User  
0 rated :

Just a thought: when I use "local swf" to access local XML files, I have to set the "compile switch" in Flash to be LOCAL ACCESS ONLY, and re-build the project. If all you have is the SWF player, and not the FLA/source code, then you can't change the switch.

Hope this helps,
Dan L

JW Player

User  
0 rated :

So you're saying:bc.. file: 'file:///C:/Program%20Files/LightTPD/htdocs/1408.flv',
doesn't work in Flash 10, but:bc.. file: '1408.flv',
does work if player.swf, page.html, and 1408.flv are in the same directory?

Well, that's not too much of a restriction. :)

This question has received the maximum number of answers.