Solved

getting an flv to PLAY to a certain point not SEEK to a certain point

Posted on 2007-11-23
4
217 Views
Last Modified: 2010-05-18
Hello, can someone give me some sample code on how to get an flv to play to a certain point when one button is clicked and then play to another point when another is clicked etc...

Cheers
0
Comment
Question by:Sideas
  • 2
  • 2
4 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
Comment Utility
If you are using FLVPlayback component then it is easily achievable using FLVPlaybackInstancename.seekSeconds("enter value in seconds here");

below is code showing how an FLV can be playback directly from 4 second position after loading.

/**

 Requires:

  - FLVPlayback component on the Stage with an instance name of my_FLVPlybk

*/

import mx.video.*;

my_FLVPlybk.autoPlay = false;

var listenerObject:Object = new Object();

listenerObject.ready = function(eventObject:Object):Void {

    my_FLVPlybk.seekSeconds(4);

    my_FLVPlybk.play();

};

my_FLVPlybk.addEventListener("ready", listenerObject);

my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

Open in new window

0
 
LVL 2

Author Comment

by:Sideas
Comment Utility
Cheers for the quick answer, but I mean FROM 0 seconds TO 4 seconds, not from 4 seconds onwards...
I dunno if I'm explaining it too well!
0
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 500 total points
Comment Utility
then you need to use cuePoint event of FLVPlayback component

here is the sample code:
/**

 Requires:

  - FLVPlayback component on the Stage with an instance name of my_FLVPlybk

*/

import mx.video.*;

my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

// create cue point object

var cuePt:Object = new Object(); //create cue point object

cuePt.time = 4;

cuePt.name = "end_time";

cuePt.type = "actionscript";

my_FLVPlybk.addASCuePoint(cuePt);  //add AS cue point
 

var listenerObject:Object = new Object();

listenerObject.cuePoint = function(eventObject:Object):Void {
 

        if(eventObject.info.name == "end_time")

        {

             my_FLVPlybk.stop();   

        }

}

my_FLVPlybk.addEventListener("cuePoint", listenerObject);

Open in new window

0
 
LVL 2

Author Closing Comment

by:Sideas
Comment Utility
Superb, thank you so much!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now