Listening for cue points?
I keep getting error messages and don't know why?
I am trying to listen for cue point. What am I doing wrong?
Also, do I really need to have the NET_STATUS listener attached to both the NetConnection and NetStream?
Thanks a lot for any help!!!
var myVideo:Video = new Video();
addChild(myVideo);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myVideo.attachNetStream(ns);
ns.play("myVid.flv");
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
ns.addEventListener(MetadataEvent.CUE_POINT, cuePointHandler);
function cuePointHandler(infoObject:MetadataEvent):void
trace("cuePoint from cuePointHandler");
trace("Cue point name is: " + eventObject.info.name);
trace("Cue point type is: " + eventObject.info.type);
What error do you get?
Yes, you should have NET_STATUS on both NetConnection and NetStream.
Also I don't see that you assign client to anything - connection and stream's events/methods are invoked on client. Especially you need it for listening for cue points. So, at least you need a line:
ns.client = this;
I think you mix unmixable here. I believe MetadataEvent.CUE_POINT is dispatched by FLVPlayback class. You do not use it. To read cue points from the stream you need to provide onCuePoint method in your code (again, it will work ONLY if you point to the client):
function onCuePoint (infoObject:Object):void {
trace("cuePoint from cuePointHandler");
trace("Cue point name is: " + eventObject.name);
trace("Cue point type is: " + eventObject.info);
trace("Cue point parameters Array is: " + eventObject.parameters);
I would move NetStream instnatiation to a function that is called when NetConnection is successfull. From Adobe help:
private function netStatusHandler(event:NetStatusEvent):void {
switch (event.info.code) {
case "NetConnection.Connect.Success":
connectStream();
break;
case "NetStream.Play.StreamNotFound":
trace("Stream not found: " + videoURL);
break;
private function connectStream():void {
ns = new NetStream(connection);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
ns.client = new CustomClient();
var video:Video = new Video();
video.attachNetStream(ns);
ns.play(videoURL);
addChild(video);
Similar Messages
-
How to hear audio while scrubbing for cue points?
There don't appear to be any video control functions in AME in the Export Options dialog. How can I play and pause the video? How can I insert cue points if I can't hear any audio?
You do all this while still in PP.
-
I have a flv which im loading in from another location (ie
its not embeded), and Im trying to create a loop point using cue
points.
I have 3 cue points: begining, loop_point, end
Basically when the playhead reaches the "end" cuepoint, I
want it to jump back to "loop_point"
Can anyone help? I have a deadline for monday to get this
finished!Pewee2000,
> Oh sorry I get what you mean now. Yeh I imported without
> player and used seperate componants from the flv custom
> playback UI panel to control the movie.
Okay, I'm not exactly clear on what you just said, so I'm
going to
proceed as if you're using the FLVPlayback Component. Here's
the scoop on
using ActionScript. Just about everything is an object.
Objects are simply
"things" that behave a certain way. Movie clips are objects,
buttons are
objects ... FLVPlayback Component instances are objects --
you get the idea.
:) Objects are defined by something called classes. Think of
a class as a
given object's blueprint. You'll genearally see up to three
categories in a
class: properties, methods, and events. Properties are
characteristics an
object has, such as a movie clip's width and height. Methods
are things an
object can do, such as movie clip's ability to gotoAndPlay()
some frame.
Events are things an object can react to, such as a mouse
click.
In your case, the FLVPlayback events include a cuePoint
event. You can
see detailed information -- often including sample code --
for all the
properties, methods, and events of the FLVPlayback class by
looking up the
phrase "FLVPlayback class" in the Components Language
Reference right in the
built-in Help documentation. Component classes are listed in
this
reference, and normal classes are listed in the ActionScript
2.0 Language
Reference. In the AS Language Reference, the three categories
are combined
in each class entry, but for some reason the Components
Language Reference
separates them. But you'll see 'em when you look up the
class.
You'll want to take things slow and start with a *simple*
example.
Assuming you've added cue points through the Component
Inspector panel, your
FLV will honor those cue points during playback. Start your
journey by
looking up the cuePoint event in the "Event summary" section
for the
FLVPlayback class.
You'll see this:
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
// insert event-handling code here
my_FLVplybk.addEventListener("cuePoint", listenerObject);
... which may look scary if you're not a coder, but it works
like this:
first, a variable named listenerObject is delcared as a
generic Object
isntance. This object is your "ambassador" for the
FLVPlayback instance,
which features the cuePoint event. You assign a function to a
new cuePoint
property of your generic object. This function will be
executed when any
cue point occurs. Finally, you use the addEventListener()
method to
"subscribe" your FLVPlayback instance to the generic object,
listenerObject.
Now you're "listening" for cue points.
In the above example, the instance name for your FLVPlayback
instance
must be my_FLVplybk -- but you can make it whatever you like,
as long as the
ActionScript matches the instance name.
Where it says "// insert event-handling code here," you may
want to use
a trace function ...
trace("Here's a cue point!");
... just to prove to yourself that it works. Read up in the
documentation,
and you'll see that the eventObject object received by the
function contains
valuable information about the FLVPlayback instance that
dispatches the
cuePoint event. You can trace eventObject.target, for
example, and get a
reference back to your FLVPlayback instance.
trace(eventObject.target);
That reference would let you refer to the FLVPlayback
instance and
invoke FLVPlayback methods on it, such as your various seek
options for
looping.
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design." -
Handling Flash video cue points in Javascript
Can any kind person give me any pointers on how to get Javascript in an HTML page containing an FLV video to listen for cue points in the video? I understand how to get the cue points in, but most people only seem to want to handle the cue point events within Flash. I want to use Javascript to display a different text in a page element at each point. Does the method vary depending on what player you're using? How about when it's the standard Flash playback component? Does there need to be any special Actionscript in the SWF containing the FLV?
Thanks
FredThanks Rob, will do.
For anyone else looking into this issue there are some links to the ActionScript documentation on this StackOverflow post and an explanation of how to use ExternalInterface halfway down the page in this Adobe Devnet tutorial.
Presumably you'd first import the ExtenalInterface class into your Flash with
import flash.external.*;
And then add an ActionScript event listener which sends the ID of each cue point out to the Javascript using the ExternalInterface.call() method:
ExternalInterface.call(methodName:String, [parameter1:Object]) -
End of FLV advance? Cue points
Hi there.
Have been playing around with cue points in MX2004pro to get
my swf movie to advance once the FLV that it loaded was at its end.
However, MX2004pro gets really confused if you use the display
component in instances in different scenes to call different videos
with their own cue points. (you can delete them and then they just
always exist when you're on the component again. No reference to
the 2nd and 3rd component's action script for cue points in script
editor etc.) Only got the first one to work and its cue points work
fine, but the others are hopeless. Is there any other way to
advance & play the timeline once a FLV reached its end apart
from cue points?>>Is there any other way to advance & play the
timeline once a FLV
reached its end apart from cue points?
Yes, you can use the onStatus event of the NetStream object
to know when
play has stopped.
Dave -
Cue points bug...
I just finished a long interactive presentation using Cue
Points
(Thanks Dean, your insight on PeakLE6, saved the day!) and I
found a
bug that might interest other developers. When calling the
Cue Point
(CP) vía "Wait for Cue Point" on the Time Channel it
freezes sometimes
if the CP has been named as a number and that number is the
same as the
one that the Time Channel uses (e.g. 1.1; 2.2, etc.) Director
quits.
CP is a great tool to synchronize audio (speech) with frames
and
hopefully this little glitch gets fixed on V. 12
Hope it helps!
BTW, has anyone tired CP using Soundbooth with Director?
JuanJuan wrote:
> I just finished a long interactive presentation using
Cue Points
> (Thanks Dean, your insight on PeakLE6, saved the day!)
and I found a
> bug that might interest other developers.
HI Juan,
Good to hear I helped you. I may try recreate that bug you're
mentioning.
Could you contact me offline, and maybe I can get a sample
file with this
issue so can make sure it is reported to Adobe?
> BTW, has anyone tired CP using Soundbooth with Director?
I have tried using Soundbooth. It saves cue points in a
format to be used
with Flash. It does not create Director compatible cue
points.
regards
Dean
Director Lecturer / Consultant / Director Enthusiast
http://www.deansdirectortutorials.com/
http://www.multimediacreative.com.au
email: [email protected] -
Cue points - listener vs event?
I'm a little over my head here...
I have a movie that loads an external flv. In the flv I have
a cue point at
the very end to mark the end of the movie. Once the flv is
done playing,
I'd like to advance to the next frame.
There are a few posts here and there and I'm not sure if I'd
be better
testing for the end cue point with a listener or if it could
be an event.
Any help would be appreciated.
I'm using Flash 8 Pro/PCDavid,
>> There are a few posts here and there and I'm not
sure
>> if I'd be better testing for the end cue point with
a
>> listener or if it could be an event.
Cue points are events, no matter how you handle them. There
are three
basic categeories of object functionality: properties
(characteristics),
methods (things the object can do), and events (things the
object can react
to). An "end" cuepoint is something your video object reacts
to, so it's an
event. How you *handle* (that is, manage) this event depends
on how the
object was written. Some objects, such as Button, TextField,
and MovieClip
instances require event handlers. Some require event
listeners.
I blogged on this just the other day, so for what it's
worth, take a
look here ...
http://www.quip.net/blog/2006/flash/event-handlers-listeners
Hope that helps.
David
stiller (at) quip (dot) net
Dev essays:
http://www.quip.net/blog/
"Luck is the residue of good design." -
Hi there,
I'm a total newb to this forum, so hello adobe premiere community! I'm perplexed by Adobes documentation on Premiere (and I'm sure I'm not the first ) anyway on the live documents page below:
http://livedocs.adobe.com/en_US/PremierePro/3.0/help.html?content=WS9390BED7-9466-46ea-A0E A-3240F1AFC36C.html
it states that:
“The cue point data in the Chapter field of a sequence marker in Adobe Premiere Pro will be encoded as Flash XML. For the XML protocol required, see Flash Help.”
Which is great…except this information doesn’t exist seemingly in either the Premiere documentation or Flash either for that matter, but as I’m interested in working with the chapter/marker area in Premiere – should I really be told to go off and search the documentation for another application, probably not! What would have been useful would have been a code snippet saying you do it like this, but of course, that would make things too easy!
Basically, I understand that in After FX you can add Flash marker information specifically for interpretation when exporting to Flash Video (i.e. name, type and parameters etc) and it suggests that you can do the same above in Premiere CS3 using some kind of concatenated string in the chapter area…it just doesn’t tell you how anywhere seemingly – WHY ADOBE!
Currently when I export markers as cue points based on the advice in the page above, anything I put in the chapter section to force Premiere to create a cue point is converted to a string, which becomes the cue point ‘name’.
This cue point name is then automatically appended to the ‘time’ the marker was inserted at and is always encoded as type ‘navigation’, with no obvious means of adding ‘parameters’ into the equation.
So (finally) does anyone know if you can insert this information into the chapter area for correct interpretation by flash (i.e. thus allowing you to choose between either 'navigation' or 'event' types, and pass as many 'parameters' as you wish etc) or are you just limited to supplying a name, and it being automatically set to the navigation type with no parameters?
I’m sorry for this long essay but at least the issue is well defined for you to answer, honestly any help you can provide what so ever would really be most appreciated!
Best regards,
Kat
PS – I have utterly no knowledge of XML either just in case you were wondering – and my only interest in XML is getting this basic information encoded into the FLV file from Premiere Pro CS3! Please help, pretty please with daisy’s!!!Hi dradeke,
Thanks for your reply, which is indeed useful as clearly Adobe have made this task easier and less obscure in CS4 by adding simple interface functionality, however I'm stuck with using CS3 for the moment. Its not majorly a problem as the video material in question can be exported uncompressed then setup with cue points using the Flash encoder as an alternative (i.e. or even After FX CS3 also) which both provide the same features as Premiere CS4 seemingly. It is just that it would be much easier to be able to drop in simple markers whilst working with Premiere CS3, as this is what we are going to be using primarily, I just wondered if anyone knew how to invoke this in CS3 - its possible you can't, the documentation is vague at best!
However I really appreciate your response and help, thanks -
Using lingo for returing cue points of a sound
Hello all
for returning a list of cue point of a sound ,it is written
in the book that we should use the following lingo
put the cuePointNames of member "mySound"
realy I have a sound member which have cue points ,but I
don't know where to use this lingo ,and where I will see the result
thank you very much for your attention ,sincerely yours
MohsenA "put" statement will place the result of the statement into
the bottom
half of the message window. You can open the message window
from the
Windows menu. In the top half of the message window you can
type any
single line function call or command and see the result in
the bottom
half. You can also use the put command from anywhere in your
movie to
see the result. This is an extremely useful debugging tool.
You can find
more on the message window and its uses in the online help.
Once you have a list of the cuePointNames you can use them to
test the
sound file that you are currently playing. You can use the
isPastCuePoint() function. Look at the syntax for that
function in the
online help.
It is far simpler to use the sound channel property,
elapsedTime. Look
at the online help information for Sound Channel to find more
information on controlling and monitoring sound playback.
Rob
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
412-243-9119
http://www.macromedia.com/software/trial/ -
Using external XML to add and set parameters for AS cue points.
Hi there. I am trying to use external xml to set cue point
times (for video), titles, and other parameters. I have everything
set up, except getting the proper data from the xml file to set the
parameters for my cue points. I am researching hard and learning
quickly - at this point, I need help. Thanks!Anyone?
Still working on this if anyone has advice. Still haven't
been able to figure out how to put xml data in the right place:
addASCuePoint(//data from xml here to set name and time of
cue point - HOW??//);
Thanks! -
FLV/Mp3 Cue Points for Accessing Frame Labels on the Main Timeline in Flash 8
Hello,
In Flash MX2004, creating cue points for syncing locations on
flv and mp3 files to locations on the main timeline included:
1) Dragging a media component onto the stage
2) Entering file path, frame label name, and time code
information in the component inspector
3) Creating the frame label names on the main timeline, and
4) Enabling the Media Labeled Frame Cue Point Navigation
Behavior
Flash 8 documentation details a considerably different
process of creating cue points. While it discusses how to create
cue points in the flv, I have not been able to locate how to enable
linking locations in flv and mp3 files with frame labels on the man
timeline. It appears that there would need to be ActionScript
necessary to accomplish this that is not available in the docs.
Please advise what ActionScript/process would enable this
function.
Thank you!
James
[email protected]I usually start off solving problems with the livedocs, as I
recommend for anyone. The following link will take you to the
NetStream.onCuePoint handler. This is what you need.
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context= LiveDocs_Parts&file=00002561.html
You can have this code on the main timeline. When the
cuepoint is hit, it will invoke this event handler and inside is
where your gotoAndPlay( ) should go.
Your other question about the text will get activated by the
same handler. Just have a conditional statement (if, switch, etc.)
to differentiate between the two events. The text itself can be
mask inside a movieclip.
Does this help? -
Revision: 11238
Author: [email protected]
Date: 2009-10-28 12:45:35 -0700 (Wed, 28 Oct 2009)
Log Message:
Cue point sample improvements and added a work around for FM-171 to the TemporalFacet class.
Ticket Links:
http://bugs.adobe.com/jira/browse/FM-171
Modified Paths:
osmf/trunk/apps/samples/framework/CuePointSample/src/CuePointSample.mxml
osmf/trunk/framework/MediaFramework/org/osmf/metadata/TemporalFacet.asRevision: 11238
Author: [email protected]
Date: 2009-10-28 12:45:35 -0700 (Wed, 28 Oct 2009)
Log Message:
Cue point sample improvements and added a work around for FM-171 to the TemporalFacet class.
Ticket Links:
http://bugs.adobe.com/jira/browse/FM-171
Modified Paths:
osmf/trunk/apps/samples/framework/CuePointSample/src/CuePointSample.mxml
osmf/trunk/framework/MediaFramework/org/osmf/metadata/TemporalFacet.as -
Exporting subtitles for Flash cue points
I want to not just create subtitles, but use them in Flash video and other cue-point supported applications for distribution on the web. Is there a way to export my subtitles created in DVDSP to a standard stf or other document? Or do I have to use external software and then export for Flash, DVDSP, etc? If I have to use a third party, which one works best? I've seen many in the Apple Downloads section...
Thanks,
Chris.Hi Sigmundo,
At work ( disturb media ) we've finished a karaoke flash project. I haven't used Soundbooth then, we had limited time, so I wrote a few handy commands for flash that took care of the job. Hopefully we will be able to document that, right an article and share the commands as a packed extension.
I've learned Soundbooth over the weekend and FLVCuePoints was one of the highlights. I've used FLV
and everything worked out fine. I didn't know the Media(Flash Video) Encoder allows you open an xml
file and insert cuepoints at that stage.
Anyway,
About F4V, Lee Brimelow has a more detailed post about the cue points bug here:
http://theflashblog.com/?p=748
HTH,
George -
Actions for flv event cue point
I have an flv playing back from component in a nested
timeline (an actionscript 2 proj) and I want at the end of the
video to gotoAndPlay the label"vidend" in the this timeline. I
embedded the the event cue point called "end" on the last frame of
video when I encoded it in my new CS3.I placed the following on the
first frame of the nested timeline... The video plays fine but does
not trigger the action. Any suggestions???...I 've found reams of
info on navigation events but this is the result of everything I
could find on the adobe site and I still not there.
I'd really appreciate any direction anyone can give me.
//leave this as is
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
//change this info..."end" is the name that you called your
cuepoint when
//you embedded it into the video
if(eventObject.info.name == "end"){
//tell your movie what you want it to do once your cuepoint
has been hit
this.gotoAndPlay("vidend");
//_root.SessionPlay.mov_loadcard.gotoAndPlay("vidend");
//my_FLVPB is the name of your video on the stage, the rest
stays as is
my_FLVPB.addEventListener("cuePoint", listenerObject);I have an flv playing back from component in a nested
timeline (an actionscript 2 proj) and I want at the end of the
video to gotoAndPlay the label"vidend" in the this timeline. I
embedded the the event cue point called "end" on the last frame of
video when I encoded it in my new CS3.I placed the following on the
first frame of the nested timeline... The video plays fine but does
not trigger the action. Any suggestions???...I 've found reams of
info on navigation events but this is the result of everything I
could find on the adobe site and I still not there.
I'd really appreciate any direction anyone can give me.
//leave this as is
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
//change this info..."end" is the name that you called your
cuepoint when
//you embedded it into the video
if(eventObject.info.name == "end"){
//tell your movie what you want it to do once your cuepoint
has been hit
this.gotoAndPlay("vidend");
//_root.SessionPlay.mov_loadcard.gotoAndPlay("vidend");
//my_FLVPB is the name of your video on the stage, the rest
stays as is
my_FLVPB.addEventListener("cuePoint", listenerObject); -
I have set a cue point in my FLV at 58 seconds. Can someone
tell / show me
how I can add a pause to the video when it reaches that first
cue point. I
have it set (intially) called break and it is set to 'Event'.
Thanks. I am an eager noobie to Flash video and actionscript.NetStream events have nothing to do with cue points.
onCuePoint method belongs to NetStream client. So, you will need
something like this:
client.onCuePoint = pointListener;
function pointListener (cuePoint:Object):void {
trace(cuePoint.name + " " + cuePoint.time);
In a nutshell NetStream events are fired when changes occur
in video delivery (buffer, start, pause, etc.) - not video content.
More information:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetStream.html
As for your code, your syntax is not correct.
You wrote: vid.addEventListener(NetStatusEvent.NET_STATUS,
"myFirstCuePoint");
If you listener function is myFirstCuePoint you need to
write:
vid.addEventListener(NetStatusEvent.NET_STATUS,
myFirstCuePoint); - no quotes.
Also, I don't use FLVPlayback - it has it's own methods and
events. What I wrote pertains to the cases when NetSream and
NetConnection are used stand alone.
Maybe you are looking for
-
HT1296 my computer no longer sees my iphone 5
My computer no longer shows my iphone 5 as a devise?
-
Moving iphoto 6 library to imac 5k
Please let me know how to move/import the iPhoto 6 photo library to imac 5K? thanks,
-
Quick way of changing duration of multiple still images.
Hello I'm putting together a slideshow of 76 images. In the browser they have defaulted to 10 sec duration and I need to get it down to 2. Is there a way of changing them all in one go or do I need to go through and change each one individually? Many
-
IP-Fast Reroute with MPLS remote LFA tunnels
I have a simple ring network with 4 3600Xs with IP/MPLS 10 gig backbone between all units (with OSPF running in the core). Per the 3600 design guide I turned on IPFRR under OSPF for fast reroute of traffic around faults. I have a l3vpn on the 3600s
-
Cursor bug in 10.8.2
I have a very strange problem. I like my cursor to travel fast on the screen. Compared to 10.6.3 , my Moutain Lion runs slower. So I set up the speeed to fastest and it does the trick, but next time I restart it is slow again. When I go to the settin