Skip to main content
thebobwolf
Inspiring
December 1, 2015
Question

FLV Player button to seek to next cue point (or previous)?

  • December 1, 2015
  • 2 replies
  • 2271 views

Hello all,

I have a FLV player on my stage linked to a .flv with embedded cue points. (added and exported in an older version of Media Encoder)

I have added the following code, which pauses the player at each of the embedded cue points

import fl.video.MetadataEvent;

player.addEventListener(MetadataEvent.CUE_POINT, fl_CuePointHandler_3);

function fl_CuePointHandler_3(event:MetadataEvent):void

{  player.pause();

}

I would dearly love the back and next buttons on the Skin to have the ability to skip to the next or previous Cue points but they seem to just skip to small increments of time instead.

I can live with custom buttons on the stage that will give the user ability to seek to the next or previous Cue points. Can any one help me with what code would go on these buttons please.

Thanks in advance. 🙂

This topic has been closed for replies.

2 replies

thebobwolf
Inspiring
December 2, 2015

Thanks for these links Rezun8, I had spent several days before this post reading all these and more on how to use AS3 to work with Cue points in Flash.

It will come as no surprise to you that I'm no coder..... I couldn't find anywhere that described exactly what I need to do, and where to put code in a step by step tutorial type guide though. I need to be walked through it, otherwise it's like trying to understand a plate of spaghetti... usually I can get the info I need to do things through Lynda.com or a tutorial from you tube but this time I couldn't find it anywhere. I guess with the industry move away from Flash I should be looking at controlling Video with HTML5...

kglad
Community Expert
Community Expert
December 1, 2015

you can only seek to parts of the flv that's been downloaded.  other than that, there should be no problems if your seek() is correct.

what code are you using that's failing, especially when seeking to previously played (and therefore downloaded) cue points?

thebobwolf
Inspiring
December 1, 2015

Hi Kglad, Thanks for your response.

What code should I put on a button that would skip to the previous embedded Cue Point?

Thanks

kglad
Community Expert
Community Expert
December 1, 2015

function prevCuePointF(e:MouseEvent):void{  // assuming mouseevent calls

player.findNearestCuePoint(player.totalTime,'all');

}