;

PDA

Click to See Complete Forum and Search --> : Playing rtmp protocol video in KoolMoves


sortie88
07-29-2008, 11:16 PM
I've been playing .flv files with no problem like this

myvidobject.netStream.play(http://url.com/vid.flv);

but can't get rtmp to work using:

myvidobject.netStream.play(rtmp://url.com/vid.flv);


I imported a .flv object and named it "myvidobject".

Anyone here able to use rtmp?

sortie88
07-30-2008, 04:48 PM
Here's what I think is part of the solution but I need to know how to do this in Koolmoves.

1. I try this : flv.netStream.play(rtmp://url.com/directory/vid.mp4)

2. But I need to break this up and access the NetStream and NetConnection
objects to format the rtmp and make it use the correct server port which I am hearing it port 443.

3. I'm seeing info that says connect to the directory and not the video at
first with :

flv.netConnection.connect("rtmp://url.com/directory")

Then play the video name as : flv.netStream.play("vid.mp4")

But nothing I try works and it's probably because I don't understad how to use these netconnection and netStream object in koolmoves.

No code I copied worked and I couldn't write any that worked.

If someone can explain how to get at all the properties of these objects in
koolmoves then I may be able to figure this out.

Thanks

blanius
07-30-2008, 08:16 PM
the letters before :// really are there to tell a browser of other program what protocol to use, it seems unlikely to me that you'll be able to do this. Since it's probably not a KM related issue you could try posting in the flash video forum, http://board.flashkit.com/board/forumdisplay.php?f=66

sortie88
07-30-2008, 08:31 PM
the letters before :// really are there to tell a browser of other program what protocol to use, it seems unlikely to me that you'll be able to do this. Since it's probably not a KM related issue you could try posting in the flash video forum, http://board.flashkit.com/board/forumdisplay.php?f=66

This is the solution for AS3 or AS2 :

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect("rtmp://rtmp.myserver.com/path/folder");
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("my_video");


How do I do that in Koolmoves 6.0?

That code does nothing if I try it in koolmoves.

These rtmp files are playing fine in examples I've seen that were made with adobe flash with AS3.

Thanks

Chris_Seahorn
07-30-2008, 10:05 PM
That code does nothing if I try it in koolmoves.



Nor should it. KM6 is AS1.

On the bright side....KM7 is NOT KM6 :)

sortie88
07-30-2008, 10:32 PM
Nor should it. KM6 is AS1.

On the bright side....KM7 is NOT KM6 :)

On the not so bright side; a guy owes me money for this player but I think I need KM7 if I ever want to collect. :yikes:

w.brants
07-31-2008, 01:05 AM
You should be able to make things work with KM also.
Unfortunately I have no experience at all with Flash Media Server.
What's different compared to Flash is that the actual Video object is embedded in a MovieClip when you import a flv file.

blanius
07-31-2008, 08:45 AM
did you try converting it to AS1


var connection_nc = new NetConnection();
connection_nc.connect("rtmp://rtmp.myserver.com/path/folder");
var stream_ns = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("my_video");

sortie88
08-02-2008, 02:22 PM
did you try converting it to AS1


var connection_nc = new NetConnection();
connection_nc.connect("rtmp://rtmp.myserver.com/path/folder");
var stream_ns = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("my_video");

Yes, I tried it so many ways that I'm sure I invented AS4 and AS5 in the process. :)

I'm missing some knowledge because I was not able to play a regular http video that way either.

The only way I personaly can get a video to play is to import a .flv;
lets name it "inflv" then just enter only these lines of code:

inflv.netStream.play(some.flv);
inflv.netStream.setBufferTime(0.2);

And that works great except for when I try to play rtmp://some.flv

Maybe I don't understand the attachVideo part.

I tried "inflv.attachVideo(stream_ns);" but didn't work.
So I thought maybe I need this also "inflv = new Video();".
Still didn't work.
Then I tried to make the inflv a symbol; but Koolmoves doesn't allow a flv
to be a symbol.

I wouldn't try all that if I really new how it was supposed to work.

Has anyone personally used the netConnection code above to play a video in Koolmoves? If so then can you tell me what part I'm missing.
I think the code will work but I'm probably not setting up the objects correctly.

necromanthus
08-04-2008, 08:58 AM
I'm missing some knowledge because I was not able to play a regular http video that way either.

Has anyone personally used the netConnection code above to play a video in Koolmoves?

Yes. Check out all the FLV players on http://necromanthus.com (including those embedded into NecroForum)

Now comming back to FMS (2 or 3) and RTMP.
The AS1 approach using Adobe Flash (8,9 or 10 beta) is the following:
Be sure the Flash Media Server is installed & running, create a single keyframe movie, insert a Video object (flv1) and set this script in the main timeline:

netConn = new NetConnection();
netConn.connect("rtmp://localhost/vod/");
netStream = new NetStream(netConn);
flv1.attachVideo(netStream);
netStream.play("sample");
stop();

That's all.

The above script does NOT work in KoolMoves, because the Video object is not full supported:
1) You cannot insert an empty Video object.
You have to import an external FLV in order to get a Video object.
Unfortunately, every time you do that, the following (invizible) piece of code is included in that keyframe:
var netConn = new NetConnection();
netConn.connect(null);
var netStream = new NetStream(netConn);
flv1.attachVideo(netStream);
netStream.setBufferTime(5);
netStream.play("whatever.flv");
2) You cannot use netConn.connect("some URL here").
Only netConn.connect(null); is supported.

I'm sure the Video object is going to be improved in the upcoming KM version(s).
:cap:

sortie88
08-04-2008, 12:17 PM
Yes. Check out all the FLV players on http://necromanthus.com (including those embedded into NecroForum)

Now comming back to FMS (2 or 3) and RTMP.
The AS1 approach using Adobe Flash (8,9 or 10 beta) is the following:
Be sure the Flash Media Server is installed & running, create a single keyframe movie, insert a Video object (flv1) and set this script in the main timeline:

netConn = new NetConnection();
netConn.connect("rtmp://localhost/vod/");
netStream = new NetStream(netConn);
flv1.attachVideo(netStream);
netStream.play("sample");
stop();

That's all.

The above script does NOT work in KoolMoves, because the Video object is not full supported:
1) You cannot insert an empty Video object.
You have to import an external FLV in order to get a Video object.
Unfortunately, every time you do that, the following (invizible) piece of code is included in that keyframe:
var netConn = new NetConnection();
netConn.connect(null);
var netStream = new NetStream(netConn);
flv1.attachVideo(netStream);
netStream.setBufferTime(5);
netStream.play("whatever.flv");
2) You cannot use netConn.connect("some URL here").
Only netConn.connect(null); is supported.

I'm sure the Video object is going to be improved in the upcoming KM version(s).
:cap:

Thanks!

That is what I was thinking but I didn't know for sure. I had already decided that if I was going to do this I would have to use adobe flash.

I'm still trying to figure adobe flash out.:scared:
It's been 3 days so far.
After downloading Koolmoves and going to your site, I built a FLV player in
less than an hour!!

I like using Koolmoves over adobe; it just makes the whole process smoother
and easier at least for a beginer.

The ease of getting things done in Koolmoves is not exagerated at all.
KM7 is probably going to be "the bomb"!

necromanthus
08-04-2008, 12:53 PM
Thanks!

After downloading Koolmoves and going to your site, I built a FLV player in
less than an hour!!

I like using Koolmoves over adobe; it just makes the whole process smoother
and easier at least for a beginer.

The ease of getting things done in Koolmoves is not exagerated at all.

KoolMoves is getting better and better with each release.
But do not forget the most important "feature": $49 vs $699
:smoov:
cheers

sortie88
08-04-2008, 03:20 PM
the following (invizible) piece of code is included in that keyframe:
var netConn = new NetConnection();
netConn.connect(null);
var netStream = new NetStream(netConn);
flv1.attachVideo(netStream);
netStream.setBufferTime(5);
netStream.play("whatever.flv");
2) You cannot use netConn.connect("some URL here").
Only netConn.connect(null); is supported.

I'm sure the Video object is going to be improved in the upcoming KM version(s).
:cap:

What if you changed that code to this :



var netConn = new NetConnection();
netConn.connect(KMOVERRIDEHTTP);
var netStream = new NetStream(netConn);
flv1.attachVideo(netStream);
netStream.setBufferTime(5);
netStream.play("whatever.flv");



Then the action script in Koolmoves to play other than http would be :


KMOVERRIDEHTTP = "rtmp://domain.com/folder";
flv1.netStream.play(eachvid);
KMOVERRIDEHTTP = null;



Can someone make this change and compile a special KM version just for me? :mrt:

Hmmmmmm? Where is the "praying to all Gods at once" icon when I need it.

w.brants
08-05-2008, 12:27 AM
Are there any free streams I could use to try to get it working or is it required to have FMS myself ?

sortie88
08-05-2008, 03:28 AM
Are there any free streams I could use to try to get it working or is it required to have FMS myself ?

I was given a couple of links to test but they are adult material.
I can send them to you on PM if you can use them.

They are the actual links I've been trying to play.

necromanthus
08-05-2008, 05:16 AM
Where is the "praying to all Gods at once" icon when I need it.

Here is a workaround (tested with FMS 3).
Have FUN.
:angel:

sortie88
08-05-2008, 02:08 PM
Here is a workaround (tested with FMS 3).
Have FUN.
:angel:
AHHHHHH! MANNNNNNN!

Why didn't you wait until I posted my solution so I could feel smart.:)

We both got to the same point a little different so there is still one issue.
It works as long as rtmp is only shown in that player.
If switching between http and rtmp I think it's going to require that two
imported flv files be embeded in two different .swf files.
So when swithing from http to rtmp the .swf with the player init will
be removed and the other swf loaded. I haven't tried that yet so
I'm not claiming that's a fix.

For some reason I didn't get my code to work in the main action script
so I put code in the impoted flv. I notice the loop in your solution so
that may have been why I didn't get it to work your way.

This is what I gotto work:

import some.flv

Select the imported flv which should be named "flv1".

Right click flv1

Select "edit movie clip frames"

Select actionscript

add this exact action script to flv1.


myurl = _proto;
var mynetConn = new NetConnection();
mynetConn.connect(myurl);
var mynetStream = new NetStream(mynetConn);
flv1.attachVideo(mynetStream);
mynetStream.setBufferTime(5);


close and go up to main movie.



select action script


Enter this exact main action script :

flv1._proto = "rtmp://somedomain.com/";

playme = function() {
clearInterval(playit);

flv1.mynetStream.play("mp4:videonamenoextension");
}

playit = setInterval(playme,33);
stop();


Save and play.


I'm playing h.264 high definition mp4 in my solution. :hubba:

This was actually quite exciting especially when I got it to play and I just knew someone was going to post it before me. hehehe.

sortie88
08-05-2008, 02:54 PM
If switching between http and rtmp I think it's going to require that two
imported flv files be embeded in two different .swf files.
So when swithing from http to rtmp the .swf with the player init will
be removed and the other swf loaded.

Forget about that, it's not needed.

I just make a new netconnection when the http switches to rtmp etc...
and that works.

For some reason I don't have the picture anymore just the sound.
Just a bug in all the changes I was making for sure. Probably left
some bad code in somewhere and need to take it out.

sortie88
08-05-2008, 05:15 PM
FINAL SOLUTION:

Don't put any action script in the imported flv(as I did before)
Just put this player code in the main action script :

flvfile = the video url to play
tubecgi = flv1 that was imported



lcflvfile = flvfile.toLowerCase();
lcext = lcflvfile.indexOf("http://");

if (lcext < 0)
{

rtmpurl = flvfile.split("/");
rtmpvidname = rtmpurl.pop();
rtmpfiletype = rtmpvidname.split(".");
rtmpext = rtmpfiletype[1];
rtmpvid = rtmpfiletype[0];
rtmpdirectory = rtmpurl.join("/");
tubecgi.mynetConn = new NetConnection();
tubecgi.mynetConn.connect(rtmpdirectory);
tubecgi.mynetStream = new NetStream(tubecgi.mynetConn);
tubecgi.tubecgi.attachVideo(tubecgi.mynetStream);
tubecgi.mynetStream.setBufferTime(5);
vidout = rtmpext + ":" + rtmpvid;
tubecgi.mynetStream.play(vidout);

}
else {
tubecgi.mynetConn = new NetConnection();
tubecgi.mynetConn.connect(null);
tubecgi.mynetStream = new NetStream (tubecgi.mynetConn);
tubecgi.tubecgi.attachVideo(tubecgi.mynetStream);
tubecgi.mynetStream.setBufferTime(5);
tubecgi.mynetStream.play(flvfile);


}



Notice the tubecgi.tubecgi.attachVideo().

I kept messing that up by using only tubecgi.attachVideo().