FLVPlayback previous Cuepoint issue


i creating flv player supports dual language captions flashvars telling player caption xml file xml file contains interactive information player.  looking way find previous cuepoint (which set in captions xml), can display caption whenever player pauses (and hides player's buttons) display math problem user must answer correctly before video proceeds.  have gotten work far except cannot captionstext text field display caption previous cuepoint since when player pauses, not on cuepoint caption in it.

there 2 buttons (one english , spanish), that, when clicked, display caption current cue point.  tried using setcaption(currentcuepoint - 1);, returns value of cuepoint doesn't have caption associated it.

i need simple way of determining current cuepoint's number , there, going previous cuepoint , getting text display.

 

i pasting of code below reference.  appreciated...!!!!

 

<moviecaptions>

<languages>

<language code="non" name="no captions"/>

<language code="eng" name="english"/>

<language code="spa" name="spanish"/>

</languages>

<caption cuepoint="1.000">

<non> </non>

<eng>now let's try find answer these.</eng>

<spa>ahora vamos tratar de encontrar la respuesta de estos.</spa>

</caption>

<caption cuepoint="4.000">

<non> </non>

<eng>if have 1 red square plus red square, how many red squares in have?</eng>

<spa>si tenemos un cuadrado rojo más otro cuadrado rojo, ¿cuántos cuadrados rojos en tenemos en total?</spa>

</caption>

</moviecaptions>

 

function captionsxmlloadedhandler(eventobj:event):void {

     var captionsxml=new xml(eventobj.currenttarget.data);

     captions=captionsxml.children();

     languages=captionsxml.children()[0].children();

     checklanguages();

     setcuepoints();

     esp_mc.addeventlistener( mouseevent.click, _onespclick );

     cc_mc.addeventlistener( mouseevent.click, _onccclick );

}

function checklanguages():void {

     var i:int=0;

     var arr:array=new array();

     each (var prop:xml in languages) {

          var languagedata:xml=prop;

          arr.push(languagedata.@code.tostring());

          i++;

     }

     if (arr.indexof("eng")<0) {

          cc_mc.visible=false;

     }

     if (arr.indexof("spa")<0) {

          esp_mc.visible=false;

     }

}

 

function setcuepoints():void {

     var i:int=0;

     each (var prop:xml in captions) {

          var captiondata:xml = prop;

          player.addascuepoint({name:i.tostring(), time:number(captiondata.@cuepoint)});

     i++;

     }

}

function cp_listener(eventobject:metadataevent):void {

     currentcuepoint=eventobject.info.name;

     setcaption(currentcuepoint);

     currentcuepointtime=eventobject.info.time;

}

function setcaption(cp:number):void {

     captiontext.text=captions[cp][selectedlang];

}

private function _onccclick( p_event:mouseevent ):void {

     captiontext.visible=false;

     cc_background.visible=false;

     if (cc) {

          cc=false;

     } else {

          cc=true;

          es=false;

          selectedlang="eng";

          setcaption(currentcuepoint);

          captiontext.visible=true;

          cc_background.visible=true;

     }

}

private function _onespclick( p_event:mouseevent ):void {

     captiontext.visible=false;

     cc_background.visible=false;

     if (es) {

          es=false;

     } else {

          es=true;

          cc=false;

          selectedlang="spa";

          setcaption(currentcuepoint);

          captiontext.visible=true;

          cc_background.visible=true;

     }

}



More discussions in Adobe Animate CC - General


adobe

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい