mallen
04-19-2008, 11:06 PM
I am trying to create my own custom video player. I have a working version that passes the flv file name in the URL using swfobject. Works fine with the standard FLVplayback component.
But now I am trying to combine this code with my custom FLV player. Can't seem to get it right. I know I have to get the string to connect to the NetStream. Or get my_FLVPlybk.contentPath = "../video/"+video; into a variable.
var video:String = flv;
var caption:String = flv;
my_FLVPlybk.contentPath = "../video/"+video;
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns :NetStream = new NetStream(nc);
my_FLVPlybk.attachVideo(ns);
my_FLVPlybk.play();
mcPause.onPress = function() {
ns.pause (true);
}
mcPlay.onPress = function() {
ns.pause(false);
}
playMovie();
But now I am trying to combine this code with my custom FLV player. Can't seem to get it right. I know I have to get the string to connect to the NetStream. Or get my_FLVPlybk.contentPath = "../video/"+video; into a variable.
var video:String = flv;
var caption:String = flv;
my_FLVPlybk.contentPath = "../video/"+video;
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns :NetStream = new NetStream(nc);
my_FLVPlybk.attachVideo(ns);
my_FLVPlybk.play();
mcPause.onPress = function() {
ns.pause (true);
}
mcPlay.onPress = function() {
ns.pause(false);
}
playMovie();