header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
flashking
Points:60
Posts:0
Answered

5/22/2011 9:21:31 PM

Title: FLV Filepath to video / flvplayback component


Hi,

I have created a webcam video recorder using as3 / flash video component. Flv is getting recorded and at the same file is also getting created. Now, I would like to preview the recorded video to the user in the same webcam video recorder. To achieve this, I am creating a new netconnection / netstream and assigning the flv's path to video component's source in action script.

For setting, I have two options:
1] rtmp path e.g., "rtmp://127.0.0.1/videoRecorder/streams/"+strFileName+".flv";
2] Absolute file path .g., "C:/Streams/test.flv or //Streams/test.flv"

In Flash CS5, after hitting test, video is played back when absolute is used. Somehow rtmp doesn't work.
For rtmp, following error pops up: Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Play.StreamNotFound. Noticed one thing, when clicked on play button, the light near the webcam glows. Don't know why this is happening. I have set null to video before creating new netconn / netstream.

Now, when I tried executing the swf through browser, video doesn't seemed to be played back for both the options. Is there any permissions issue? How do I resolve this? I need to play back the video to users.

Tried creating a new fla, used flvbackplay component. Accessed the flv same way. Same issue here too. :(.

Also, what approach is recommended when deploying to production? Whats the best way to access the flv's from a file system?



1
bob_senior
Points: 1320
Posts:0
Accepted Answer
5/23/2011 2:26:29 AM



if you need to playback your flv file without using FMS server then you must use the http path like this : "www.yourWebsite.com/Streams/test.flv" . This will work fine if your flv file and player are both loaded from same website. else you need to use the policy file to allow access to flv files. Absolute file path will work for only local testing not online. Let me know if you got any problem implementing this.

2
flashking
Points: 60
Posts:0
5/23/2011 4:54:45 PM



Thanks for the response bob. I figured out that its an file access level issue.

To test it, I shared the streams folder and tried to access it from browser (//MYPC/streams/test.flv). I get "Forbidden: You don't have permission to access /streams/test.flv on this server" error.

Also, tried to access the flv using http://127.0.0.1:5080/videoRecorder/streams/test.flv. I get "HTTP Status 403 - Access to the requested resource has been denied" error. Red5 is rtmp server.

Thats when I try to access the flv from inside the swf, playback doesn't work.

You mentioned about accessing the flv via "www.yourWebsite.com/Streams/test.flv". I tried that and it works. But, I don't want users to download the flv and also it seems to be an security issue. Users should be able to access flv's via FLVPlayer only.

I tried all of the above testing locally.

How do we proceed for implementing policy file? Will it affect the performance? Any additional task to be performed, when moving my project to any hosting server? Because I am not sure how and what storage path/permissions will be there.

Thanks again for showing me the right way. Was scratching my head on this issue since yesterday.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 1+7 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions