Solved

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

Posted on 2007-11-23
4
220 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
ID: 20340209
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
ID: 20340301
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
ID: 20340329
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
ID: 31410692
Superb, thank you so much!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IE 11 Flash Player issue 7 244
ActionScript 3 - Removing Duplicates in ArrayCollection 1 402
Video sharing with user login 3 209
Adobe Flash Player ActionScript error 6 66
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

829 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