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);

    }

}

kugua123Author
Participating Frequently
November 22, 2013

My problem is to place the video to the cue-point I named "xxx" when I click the mouse on a text working as a button.

The f4v video is encoded with knowned cue-points.

What function can get the time of my cuepoint and start the video at that time ?

the previous code did that for flv.

I have to use onXMPData, I guess.

kglad
Community Expert
Community Expert
November 21, 2013

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