;

PDA

Click to See Complete Forum and Search --> : Remote SWF access ( playing ) local File


sudhibabu
08-27-2006, 10:36 PM
How a remote SWF file ( downloaded from internet ) , can play a locall FLV file in browser.

ie. local file is c:\test.flv

In Flash 8 , it automatically plays local file, but in Flash 9, it is not.


In more detail,

For example I have file http:www.a.com/test.swf where it has to play a local FLV file c:\test.flv


Please throw some light on it

Thanks in advance

cancerinform
08-28-2006, 12:33 AM
What are your exact publish settings?

sudhibabu
08-28-2006, 01:52 AM
Publish settings are:

LocalPlayBack : Access local files only ( I also tried with Access network only)

When I trace System.security.sandboxType , it returns remote.

so my remote SWF is not playing local flv file.

ie
ns.play(file:///c:/test.flv).

When I run locally, its working fine, but not on internet.

Thanks
Sudhi

cancerinform
08-28-2006, 08:02 AM
I tested a movie, which plays a video and set the settings to player 9 and AS2 and it works fine. The trace action for System.security.sandboxType gives me localTrusted. I also tested an AS3 example and had no problem playing local files.

sudhibabu
08-28-2006, 09:47 PM
Hi Cancerinform,

Thanks for your reply.

Actually I think you might have tested in browser as a LOCAL SWF file, ie in browser,you might have opened like C:/test.swf . So that System.security.sandboxType is localTrusted instead of remote .

But when we place that test.swf on web server, and accessing with http://x.com/test.swf System.security.sandboxType is remote. In this case, it is not playing local file when my code is like ns.play(file:///c:/test.flv)

This is really very critical for my project as I need to play FLV files in my swf , as I know FLV path on Client machines. I have messed up with this from last one week.

Thanks
Sudhi

Pugger
08-29-2006, 01:15 AM
Heres a link explaining how secuirty works: http://www.adobe.com/go/progAS3_security

By default, network SWF files may not cross-script local SWF files. However, authors can grant
permissions for network SWF files to cross-script local SWF files in the local-with-networking sandbox or
local-trusted sandbox by using the ActionScript
Security.allowDomain() method. A local SWF file in the
local-with-file-system sandbox is not allowed to grant such permissions, because this would make it
possible for the local SWF file and a network SWF file to cooperate in reading data from a local file system
and sending the data to a web server.

I don't think you can load a flv from a local machine if your swf is on a network server. This applies to mp3, png, jpeg, etc files.

Is putting them on the server not an option?

sudhibabu
08-29-2006, 04:02 AM
Is putting them on the server not an option?


Yes...when I upload those flv files to web server, than playback in my SWF there is no problem.

As you know the flv files are large in size usually ( for one minute video >2 MB) . So users has to wait until it uplaods to webserver server before they see playback.

Actually for me , those flv files are not necessary to save on server.What all I need is just to playback for my clients their local flv files in my SWF.


Below is the SWF , I am testing

http://www.exellen.com/pixcow/v2/fmx_pc_preview.swf

You can see two blue buttons downside. One is to webserver file , the other is to play local file which is located in C: directory( You need to place one FLV file in your c: directory with name test.flv name).


Thanks
Sudhi

Pugger
08-29-2006, 04:06 AM
I see. From what I understand, flash does not let a local flv be played from a swf on a server, so the only solution I can see is letting your clients download your flv player from your site. Then your clients, from their local machine can play their local flvs.

sudhibabu
08-29-2006, 04:28 AM
I see. From what I understand, flash does not let a local flv be played from a swf on a server, so the only solution I can see is letting your clients download your flv player from your site. Then your clients, from their local machine can play their local flvs.


Thanks Pugger for answering .

Actually my swf is alreaydy embed into my html page.That page contains different text and graphics along with swf.I need to playback those flvs in my html page which on webserver.

So I can not do it as a standalone application for my users.

Hope you understand. When I am using Flash 8 player plugin its working fine. But when I am using Flash 9 player it just ignores .

Thanks
Sudhi

Pugger
08-29-2006, 04:33 AM
You could always zip the html page and swf :).

But, hmm, just use flash 8. I tried to do the same thing you were doing with mp3 songs, but I couldn't figure out flash's security settings and in the end found a page that described it as not being allowed. Sadly can't find that resource again.

Hopefully a solution will come about as more and more people begin to use ActionScript 3.

Hope that helps.

cancerinform
08-29-2006, 06:50 AM
You can give your clients a projector file like I am doing now.

http://flashscript.biz/test/example.zip

The flv is on my server.

sudhibabu
08-29-2006, 10:36 PM
Thanks cancerinform and pugger . I will check it out,

sudhibabu
08-29-2006, 11:59 PM
Flash 9 palyer seems little strict on accesssing local files for remote swf( non-local swf to play local flv files. ).

Is there a way to let users trust my SWF ( like signed Active-x) and let permission to my SWF to allow local files.

I mean an explicit warning message like "This SWF is accessing local files . This may not be safe. DO you like to allow this operation ?"

if user allows it, it can playback local flv files.

rolando.lopez
09-27-2006, 01:52 PM
Sudhi,
I am in the same boat. I need to have a network swf file access an FLV that is on the user's computer. Have you found a way around this?

Thanks,
Rolando