Play flv file on FMS - apache-flex

I have per-recorded .flv file, Now I want to play this video on Flash Media Server.I created a folder name "sampleApplication" in my directory C:\Program Files\Adobe\Flash Media Server 3\applications\ directory. Now I write code to make connection
netConnection.connect("rtmpt://localhost:1935/sampleApplication");
netConnection.addEventListener(NetStatusEvent.NET_STATUS, checkConnection);
In checkConnection listener I check that my connection is perfectly working and then i code to play the video
netStream = new NetStream(netConnection);
vid = new Video(300, 300);
vid.attachNetStream(netStream);
videoPlayer.addChild(vid);
netStream.play("sample");
video is not going to be played...
what is problem..Urgent help required?
Thanks in advance!!

Try put your sample.flv to C:\Program Files\Adobe\Flash Media Server 3\sampleApplication\streams\_definst_\ folder

Related

Download file and open it without saving it in downloads folder

We try to download a file from the web server (.NET 5 / MVC) and open it automatically on the client side with the specific appliation without saving the file on the local disk. In our case we download a CAD file (*.dwg) and open it with DWG TrueView.
The file gets downloaded and application will be started as well. But every time we click on a file in out web application, the browser save a copy of the file in the downloads folder.
What is the correct approach to solve this problem?
Citrix does the same with ICA files - once I tell the browser it should open ICA files, it will not save the files on the disk.
This is roughly how the code looks like:
public FileStreamResult DownloadFile()
{
var fs = new FileStream("myFilePath....", FileMode.Open, FileAccess.Read);
return new File(fs,"application/octet-stream","myFile.dwg");
}
We also tried all sorts of content-types without success.

How to play m3u8 using AVplayer at local

i try to save .m3u8 & .ts file on local ,then using AVplayer to play it, but player always loading fail. Have any way to play it , or i have to set small http server on device to put the file then play it?
Thanks all
Yes, you'll need to setup a http server to server the file. check cocoahttpserver
Or, you can try to convert the .ts file to .mp4, with TS2MP4
I personally suggest using CocoaHttpServer, it's just simple.

Read file without exclusive lock

What is the best way to read image when simultaneous requests try to access the same image file?
Basically I have created tiff viewer in asp.net. It displays thumbnails of all tiff pages and upon click loads full image below. But when I try to read big tiff file (40+ MB), some thumbnails shows up and some throw access denied error. I hope I am clear enough to explain the problem.
you should open the Stream in this way:
using (Stream s = new FileStream(fullFilePath,
FileMode.Open,
FileAccess.Read,
FileShare.ReadWrite))
{
// here use the stream s
}
in this way you open for read and still other processes will be able to read the file as well and only one process, not yours, could eventually acquire the write rights.
see here as well: How do I open an already opened file with a .net StreamReader?

Flex build use local files

I have a very stupid problem. I'm using Flash Builder (Flex) 4.
My application displays a video using VideoDisplay component and some images.
The video filename is always named video.mp4 and the images are inside a folder called "real/".
The video file and the real folder are in the SAME location of the .swf built.
The video source in the code is set like this:
videoDisplay.source = 'video.mp4';
and the images, loaded dynamically, are like:
img.source = 'real/' + imageFilename;
In development, I put this video and real folder inside the Flash Builder folder called bin-debug: I can correctly display the video and see the images.
In the release version, when you export and build the release, I have tried to put this video file and the folder inside the folder bin-release, I open the index.html generated, but nothing, the video and the images are not loaded!
Is there any problem with the sandbox? I don't think so because it is in the same local folder!
Do I have to setup anything in the compiler? Some param?
use URLRequest to load the external files
new URLRequest("c:\folder\video.mp4"));

Downloading files

I am using asp.net/C#. I have a url to a folder on a remote server. In that folder are images that are all .jpgs. I don't know the names of the files, just that they are all .jpgs. How do I download all the .jpg images using asp.net/C# to a folder on my local hard drive.
Just to clarify. I am pulling files from a remote server and I am saving them to my local machine. I was given a web URL and told that the files I needed to pull down every night where .jpg image files. That's all I was told. I have no idea how I can get a list of files on a remote server with just the url to the folder.
Thanks
If it's a web URL, you'd have to depend on the web server giving you some sort of list of files. The format of the list could be almost anything.
Put it this way: using a browser or anything else, how would you as a human find out all the filenames?
Just to clarify, are you writing code on the server which has the files? If so, you can find out what files are present using Directory.GetFiles. What do you want the user to have to do at the local side?
If you could make your question a bit clearer it would really help.
Here is some concept code to work with
DirectoryInfo di = new DirectoryInfo("M:\MappedDrive");
FileInfo[] rgFiles = di.GetFiles("*.aspx");
foreach(FileInfo fi in rgFiles)
{
Response.Write("<br>" + fi.Name + "");
}

Resources