Skip to main content
Participating Frequently
November 21, 2013
Answered

How to find a cuepoint in a f4v video (it worked with a flv video) ?

  • November 21, 2013
  • 2 replies
  • 1863 views

I used the following AS3.0 code in my project, linking a video (.flv) and images :

When I click on the text Titre0 I want the video go to the cuepoint "1".

Titre0.addEventListener(MouseEvent.CLICK, fl_ClickToSeekToCuePoint_0);

function fl_ClickToSeekToCuePoint_0(event:MouseEvent):void

{

    var cuePointInstance:Object = my_FLVPlybk.findCuePoint("1");

    my_FLVPlybk.seek(cuePointInstance.time);

    this.gotoAndStop(1);

    diapo.value = 1;

}

It works with a flv video, not with a f4v.

This topic has been closed for replies.
Correct answer kglad

OK :

new test

0 [object Object]

1 [object Object]

2 [object Object]

3 [object Object]

4 [object Object]

5 [object Object]

6 [object Object]

7 [object Object]

8 [object Object]

9 [object Object]

10 [object Object]

11 [object Object]

12 [object Object]

13 [object Object]

14 [object Object]

15 [object Object]

16 [object Object]

17 [object Object]

18 [object Object]

19 [object Object]

20 [object Object]


you can use:

var cuepointA:Array = [];

my_FLVPlybk.addEventListener(fl.video.MetadataEvent.CUE_POINT,cueF);

btn.addEventListener(MouseEvent.CLICK,fl_ClickToSeekToCuePoint_0);

function fl_ClickToSeekToCuePoint_0(event: MouseEvent): void {

my_FLVPlybk.seek(cuepointA[0]);

}

function cueF(e:fl.video.MetadataEvent):void{

cuepointA.push(e.info.time);

}

2 replies

kugua123Author
Participating Frequently
November 21, 2013

Hello, thanks for your track, I thought it was that, but I don't know the syntaxt...

kglad
Community Expert
Community Expert
November 21, 2013

Titre0.addEventListener(fl.video.MetadataEvent.METADATA_RECEIVED,f);

function f(e:MetadataEvent):void{

    for(var s:String in e.info){

        trace(s+": "+e.info);

    }

}

kglad
Community Expert
Community Expert
November 27, 2013

trace(cuepointA[0]; gives 39.44 afer the first cuepoint.

It is the time in seconds of that cuepoint "1".

How can I get the complete array of the name and time of all cuepoints to go directly to a particular cuepoint ?


the trace will reveal the time of all cuepoints that have been played at the time you click your button.

kglad
Community Expert
Community Expert
November 21, 2013

use the metadata function to see what cuepoints (if any) are in your f4v.