Hello,
I'm trying to display videos (either FLV with On2 or H.264/AAC stuff)
in a loop. The idea is to fetch the first video by calling a Web
service (SOAP) and when the video is done, I attach the complete
event to a method that fetch the next video. It work well for the
first pass (first and second videos), but after the second video is
complete, my Flex app call the Web services two times in a row, so
instead of having the first video played back in full, it plays for a
fraction of a second, and the second video is displayed.
The code at startup:
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
backgroundColor=#00 layout=absolute
creationComplete=setTimers()
...
mx:WebService id=service
wsdl=http://localhost/cgi-bin/WebObjects/ServeurCalendrier.woa/-/ws/CalService?wsdl
useProxy=false showBusyCursor=false
mx:operation name=loadVideos
mx:request xmlns=
ordre
{ordre}
/ordre
/mx:request
/mx:operation
/mx:WebService
...
public function setTimers():void {
service.loadVideos.send(new Number(0));
currentState = 'Video';
}
The video is displayed in a state:
mx:State name=Video
mx:AddChild position=lastChild
mx:Repeater id=videoRepetition
dataProvider={service.loadVideos.lastResult}
mx:VideoDisplay id=boiteVideo
source={videoRepetition.currentItem.url}
complete=next(event.target.getRepeaterItem()) autoPlay=true /
/mx:Repeater
/mx:AddChild
/mx:State
And the method who is called on the complete() event:
public function next(anObject:Object):void {
service.loadVideos.send(anObject.ordre);
}
The Web service log:
juin 25 10:25:20 ServeurCalendrier[] (ERXNSLogLog4jBridge.java:40)
INFO NSLog - 1 : http://localhost/calendriers/videos/WOWODC_Keynote2.flv
juin 25 10:25:56 ServeurCalendrier[] (ERXNSLogLog4jBridge.java:40)
INFO NSLog - 2 : http://localhost/calendriers/videos/WOWODC_Keynote.flv
juin 25 10:26:41 ServeurCalendrier[] (ERXNSLogLog4jBridge.java:40)
INFO NSLog - 1 : http://localhost/calendriers/videos/WOWODC_Keynote2.flv
juin 25 10:26:41 ServeurCalendrier[] (ERXNSLogLog4jBridge.java:40)
INFO NSLog - 2 : http://localhost/calendriers/videos/WOWODC_Keynote.flv
So at 10:26:41, the Flex app is fetching both video #1 and #2, but #2
should have been fetched at 10:27:17, and I don't know why :-/ Is
this because it's the same video, and when I fetch them again, the
runtime thinks that the videos are in the complete() state?
---
Pascal Robert
http://www.macti.ca
http://www.linkedin.com/in/macti
Skype: MacTICanada
AIM/iChat : MacTICanada