tags:

views:

262

answers:

1

Flex appears to have 2 video classes: Video and VideoDisplay. My question is when does it make sense to use one or the other?

What I can tell from initial glancing is that VideoDisplay responds to mouse events because it inherits from IntaractiveObject, but I'm not sure if it's a real difference, because Video seems to have a workaround for this in that you can add your own event listeners.

There's probably more to it, but this is the only difference I can see now. So my question for those who used these objects extensively, can you share your experience when you use one over the other.

A: 

You'll nearly always want to use VideoDisplay. Video isn't a UIComponent, it can't handle its own loading from URL, won't dispatch any Flex events, and you can't bind to any of the properties such as playHeadTime. Video is a very basic DisplayObject that's capable of displaying video data, and doesn't do much else. It's more of a building-block, that you'd only use if you wanted to do something funky, or are building a Flash (non-flex) app.

Sophistifunk
I've been reading though that VideoDislay is missing some features/methods, like attachStream or attachNetStream which are needed for advanced streaming with Flash Media Server for example. What's wrong with having a Video then wrapping it in a UIComponent to have both capabilities. Not sure if it's a valid idea or has many problems, but just wondering.
drummer
Sure, that's what VideoDisplay is, but it's wrapped up with some code for loading and streaming from a URL, so you don't have to do it. I haven't used FMS, but I'd be very surprised if Adobe didn't have support for it in their Flex components. It could be that VideoDisplay already works with FMS, or that there's an included .SWC with Flex components specifically designed to work with it, as there is for LCDS.
Sophistifunk