Flex 4: VideoDisplay can play MP3 files? - apache-flex

Is it possible to play MP3 files using the VideoDisplay or VideoPlayer components?
Thank you.

Actually, yes they can play MP3 files. I've just got it working by simply passing the path of the MP3 to a VideoPlayer component instance.
Although I wouldn't recommend using a video component to solely play audio files, I agree that it's sometimes appropriate to play a sound file in a video display component. In my case I have a mixed list of audio and video media items and want a unified preview area and playback/scrub controls.

Why would you use a video component to play a sound file? Either way, you should probably google before posting here. This is how you do it:
var snd:Sound = new Sound(new URLRequest("smallSound.mp3"));
snd.play();

Related

embed swf with action script 3 in flex

I'm very new in flash and flex and my first task is to be able to embed an SWF made in adobe cs4 using actionscript 3... the problem is I'm not able to embed it in Flex, it is weird though that if for example i add a sound to the swf file to be embedded in flash i'm able to hear the sound but it is not showing up (not visible) in the flex generated swf file
One other thing is if i try to set the flash swf to be embedded to use actionscript 2 then it gets shown in the flex generated swf but if i really need to be able to use actionscript 3 so no use for that
What is your code for embedding it ?
I suggest you to take a look at SWFLoader. Here is some code and samples:
http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html
thanks for the answer, i was able to figure it our after some time, it really doesn't matter if i use an image or swfloader to load the embedded swf, the problem is i cannot really directly call a function of the embedded SWF from the embedding SWF, what i had to do was dispatch events so that flex can communicate with flash and vice versa,,, this page was very useful for me http://flash.fincanon.com/archives/152

using multimedia files in asp.net in background

let's say i want to play an mp3 song in the background of the website alog the user's travesal between the different pages...
is is possible?
I would not recommend doing this, it will annoy users and possibly alienate your users without sound. The easiest way is to have another frame play the music. Another way is to have a popup come up and play the music [which stays up between pages].
Within a single frameless page? I can't think of any possible straightforward solution.
Off my head, the altenatives are:
1. frames (parent frame plays the audio, child frame holds the site pages)
2. pop-up window which plays the audio
3. a single page which puts in page content via ajax and loads into the main container while the audio is played outside the container
4. use flash and puts in content via actionscript into the flash display panel
Personally, I would not recommend any of the above :P
Multimedia is the best way to enhance the user interface of any application. In .NET there is many ways to play an Audio using any .NET technology supporting languages. One of the simple way to acheive is Multimedia Control Interface, shirtly we call it as MCI, wrapping high-level system components, such as Windows Media Player to play our audio files.
visit this link.. to get more information.. about it
http://vivekthangaswamy.blogspot.com/2006/11/using-cnet-play-multimedia-files-using.html

.NET : How to Create thumbnail from flash

Is there any way where i can create a thumbnail image from a flash movie file(flv /swf) [NOT FROM A VIDEO File ] in ASP.NET ? Any samples of implementation ?
you can use ffmpeg to create thumbnails of the flash video
For .flv you can use ffmpeg to convert parts of the video (e.g. one frame) into an image (sequence)
I've used it as command-line application by calling Process.Start(), but there is at least one wrapper for .NET (I haven't tested it myself):
http://www.codeplex.com/ffmpegdotnet
For .swf I don't know any way to achieve this without some Adobe tool.
for flv it can be done easily, as others mentioned ...
for swf, it depends HIGHLY on the swf ... if the swfs visual appearence is determined by code, there is no other way than to embed a flash player in you app and either let the flash player make the snapshots, encode them as JPEG/PNG, and send them somewhere using TCP or LocalConnection (a flash<->flash communication connection, which can be used with C# as well) or try to somehow grab its output buffer yourself ... the first possibility should be no more than 10-20 lines of actionscript code ... don't know about the latter ...
other than that, you might use an external command line converter ... there are a few floating around the web ...
greetz
back2dos
Take a look at this article, it should point you in the right direction. It uses SharpFFmpeg to extract thumbnail images from movie clips from a variety of formats.
the only way to get an image, is to use a full flash client that starts playing and allows you to capture the first frame.
I would take a close look at flirt (they actually have an example that renders pngs)
Maybe some of the other flash libraries may be of help ( swfdec gnash swift tools gplflash)
Gnash is probably the best choice since its the most mature project out there, but i do not know how easy it is to integrate into command line tools or into your own projects.
We have been working on this in my company, and we got a proof of concept working pretty fast (but the project we made it for is on hold right now). I am not able to share the code, but I can give you some pointers.
It is not pure ASP.NET, but maybe you can still use it. We made a windows service that can be called from ASP.NET.
Basicly you install the flash plugin on the server, the windows services can then simply open the swf through the swf ActiveX component and then you can grap a picture of the whole thing. It works pretty well, notice that you do not have to actually render the ActiveX component on screen to capture the picture.
Check out this post. It does not tell you everything but I guess it provides the ground work required for it. You probably have to figure out how to get the object tag out of the flash-html you are trying to download from a web page. After that you'd have to figure out when to capture the frames. Its a long ride however. You don't need the asp.net part. Just concentrate on the windows project part. Hope this helps. :)

Is it possible to use imagemagick as library reference from Adobe AIR?

I'm trying to load preview thumbnails of high resolution images and the application needs to be able to load 100 hi rez images at one time. The only way i know how to do this is if I use the Loader class and I have to load the ENTIRE file and then scale down the image and use the data as an image preview.
what i'd like to do is use imagemagick (or some other efficient image manipulation lib) to compress the image and return that result (without saving it as a file first... that would be optimal) back to my AIR application so that i can use it as a preview. This would be AWESOME.
Thanks in advance.
CommandProxy by Mike Chambers. Look it up (http://www.mikechambers.com/blog/2008/01/17/commandproxy-net-air-integration-proof-of-concept/). This nifty trick allows you to have a conversation between AIR and non-AIR apps.
Still have questions? Let us know.

How do I display a PDF in Adobe Flex?

Looking for a way to display a PDF in Flex. I'm sure there are several ways. Looking for the easiest to maintain / integrate / most user friendly. I'm guessing it's possible to display a browser window in the app and render it, but if it goes off of IE / FireFox it's not acceptable for this project.
Thanks...
This looks like a nice PDF viewer for flex http://www.devaldi.com/?p=212
We just did a large AIR app that used PDF quite a bit - make sure you save yourself some heartache and write some code to check the acrobat version or that it's even installed - if they don't have it you won't get an error, just a blank HTML control.
I know, it sounds obvious, but still...
Sorry to say so, but convertion PDF to kind of swf of flash things... doesn't that kill the PDF thoughts ?
I mean, PDF should be electronic paper right ? When creating a SWF file out of it, you just destroy that. No more editing, no more filling out a form.
The strange thing is, that PDF is an Adobe product... and Flex (Flash Builder) is a Adobe product.
Two products that Adobe wants to be world dominator off. But combining PDF into Flex... is not standard.
Check out: http://www.swftools.org/ for tools to convert your PDF to SWF, speifically pdf2swf- http://www.swftools.org/pdf2swf.html
Check out Share on Acrobat.com, there you can upload PDFs and make them embedable Flash files (sort of like YouTube for documents). Should be possible to load those into Flex. Not an ideal solution, but unfortunately you need to convert the PDF to an SWF somehow to be able to load it into a Flex application. I don't know of any good tools that do this. If someone else knows please share.
If you target AIR you can load a PDF into a HTML view, but that doesn't work when running in the browser (the HTML component is only available in AIR).
in Adobe Digital Edition, Adobe Load PDFs into flash (if you check the main file .exe you can see it), without any convert. therefore i think it is possible to do.
i decompiled it and found lot of classes related to pdf but i can't run it after recompiled it :(
if you solve this problem you should focus the Adobe Digital Edition product.
Oh sweet, this is an air app. I'll go with the HTML view. I can't convert them to SWF because the client will be uploading the files.
if AIR Application,
use HTMLLoader().

Resources