I am having a problem in CaptionDisplay class used to add captions for a video.
In my project I have to show many videos in a flvPlayback component, and every video have their own caption xml file.
The caption file is working fine for the first video but when the video is changed the caption doesn’t work, here is the code snippet I have used:
In the root I put this code:-
var initObj:Object = new Object();
initObj.font = “_sans”;
initObj.embedFonts = false;
initObj.textSize = 16;
initObj.textColor = 0xFFFFFF;
initObj.textShadowColor = 0x000000;
initObj.backgroundColor = 0x000000;
initObj.backgroundAlpha = 60;
initObj.overlay = true;
var CC=new CaptionDisplay(_root.tv,initObj);
var ccbtn_ref=new CaptionButton(_root.controls_mc.cc_mc,CC);
CC.source = “test.xml”;
And when the video is completed then I call a function, in which I change the contentPath of the flvPlayback and also put this code :
‘_root.CC.source = “test2.xml”;’
but this way the next video keep playing but the caption is not shown for the second video.
I also tried to make a new CaptionDisplay object every time a video is changed for the same flvPlayback component. But doing that way the flvPlayback goes to “loading” state and never recover from that state.
Any help will be most welcome.
Thanks in advance,