Ultrashock Forums > Flash > ActionScript
AS3 - The all new exciting FLV cue points challenge!

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
AS3 - The all new exciting FLV cue points challenge!
Old 2009-05-22

I have an flv file: http://www.stumpymoose.com/flvTest/videoCueTest.flv

..which has embedded cue points, both event and navigation, but I can't work out the AS to read them. See code below and imagine me staring blankly at a monitor for several hours.

First person to post a working solution to this problem wins an exciting prize* and much appreciation.


*Prize is a virtual prize. No cash value.


Code:
import fl.video.FLVPlayback;
import fl.video.VideoEvent;
import fl.video.MetadataEvent;

stop();

var video:Video=new Video(300,169);
addChildAt(video, 0);

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream=new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);


function onCuePoint(infoObject:Object):void {
	var key:String;
	for (key in infoObject) {
		trace(key + ": " + infoObject[key]);
	}
}

video.addEventListener(MetadataEvent.CUE_POINT,  testFunction );

function testFunction(evt:MetadataEvent):void {
	trace(evt.info.name);
}



function onStatusEvent(stat:Object):void {
	// trace(stat.info.code);
}

var meta:Object = new Object();
meta.onMetaData = function(meta:Object)
{
// trace(meta.duration);
};

var cueTest:Object = new Object();
cueTest.CUE_POINT = function(cueTest:Object)
{
	trace(cueTest);
};


ns.client=meta;

video.attachNetStream(ns);

ns.play("http://www.stumpymoose.com/flvTest/videoCueTest.flv");
postbit arrow 1 comment | 166 views postbit arrow Reply: with Quote   
Registered User
Mouldfish is offline
seperator
Posts: 13
2002-04-27
seperator

Ultrashock Member Comments:
Nutrox's Avatar Nutrox Nutrox is offline Super Moderator Nutrox lives in United Kingdom 17 Creative Assets 2009-05-22 #2 Old  
Code:
var myClient:Object = {};

myClient.onCuePoint = function( data:Object ):void
{}

myClient.onMetaData = function( data:Object ):void
{}

ns.client = myClient;
... or ...
Code:
function onCuePoint( data:Object ):void
{}

function onMetaData( data:Object ):void
{}

ns.client = this;
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: