I'm working with spark video components, however the spark videoObject is null, when using a dynamic video source object it still null. Cameras are being detected properly, however when using a variable it's null, when using the Camera object directly usb camera is detected and videoobject still null... any ideas???
Now when using Camera.names all "cameras" are null, when playing a video from apache virtualhosts it plays well, this is so so weird...!
As requested, updated code:
import mx.controls.Alert;
import mx.events.FlexEvent;
import spark.components.VideoPlayer;
private var vidPlyr:VideoPlayer = null;
protected function winAppCreated(event:FlexEvent):void {
// Video Player
vidPlyr = new VideoPlayer();
vidPlyr.width = 320;
vidPlyr.height = 240;
// Video from apache virtualhost:
vidPlyr.source = "http://flex.test.capimg/JormaKaukonenCracksInTheFinish.flv";
addElement(vidPlyr);
var cameraTV:Camera = Camera.getCamera(Camera.names[0]);
var cameraUSB:Camera = Camera.getCamera(Camera.names[1]);
if (cameraTV) {
vidPlyr.videoDisplay.videoObject.attachCamera(cameraTV);
} else {
Alert.show("no TV card - " + Camera.names[0]);
// Alert shows: "no TV card - SAA7130 Analog TV Card"
}
if (cameraUSB) {
vidPlyr.videoDisplay.videoObject.attachCamera(cameraUSB);
} else {
Alert.show("no USB camera - " + Camera.names[1]);
// Alert shows: "no USB camera - USB2.0 Grabber"
}
}
This is a screenshot of running app.