header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Tapas Mishra
Points:0
Posts:0

8/2/2010 3:44:44 AM

Title: Red5 embedding in html problem


Hi,
I read
http://www.longtailvideo.com/support/jw-player/13/embedding-flash
and I also checked the Jwplayer

I was able to see the streaming video when I used the setup wizard from your website.
http://www.longtailvideo.com/support/jw-player-setup-wizard?example=204

The code generated did not worked.
I have read
http://www.longtailvideo.com/support/jw-player/13/embedding-flash
and the swfobject.js and player.swf are on same directory where the test.html page I created is present.

Following is the HTML code by the Setup Wizard.
Red5 is working on localhost.
Please see if some one can point out the error in it.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

	<title>JW Player for Flash</title>

	<style type="text/css">
		body { background-color: #fff; padding: 0 20px; color:#000; font: 13px/18px Arial, sans-serif; }
		a { color: #360; }
		h3 { padding-top: 20px; }
		ol { margin:5px 0 15px 16px; padding:0; list-style-type:square; }
	</style>
<script type='text/javascript' src='swfobject.js'></script>

</head>
<body><div id='mediaspace'>This text will be replaced</div>
 
<script type='text/javascript'>
  var so = new SWFObject('player.swf','mpl','470','290','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','avatar.flv');
  so.addVariable('streamer','rtmp://localhost/oflaDemo');
  so.write('mediaspace');
</script>


</body>
</html>








1
MaxFlash
Points: 600
Posts:0
8/2/2010 5:24:37 AM



hi first of all verify that you have a application directory with name "" present in webapps folder under red5 installation folder

C:\Program Files\Red5\webapps\oflaDemo

Then verify that they contain the xml and configuration files required to run the application.

In my case I used the installer from location

C:/Program Files/Red5/webapps/installer/index.html

to install the "oflademo" but it just creates the empty directory without the required server side files inside. And the application will not connect without them.

2
Tapas
Points: 0
Posts:0
8/2/2010 7:32:11 AM



I have checked in VLC and in browser http://localhost:5080/demos/ofla_demo.html
is present and I can see all the videos working and streamed.
All the directories that you mentioned are present.

3
Tapas
Points: 0
Posts:0
8/2/2010 7:33:58 AM



but the original problem I posted if you have some solution suggest me.

4
Warrior
Points: 420
Posts:0
8/2/2010 7:50:15 AM



its not the directories bu you should have the following files in the oflaDemo folder in red5 webapps
oflaDemo\web-inf\red5-web.xml
oflaDemo\web-inf\web.xml
oflaDemo\web-inf\red5-web.properties

and the classes that are required to run
oflaDemo\web-inf\classes

if all these are present then it should work

I never used VLC to test, VLC uses rtmp connection through RED5 to stream videos ?

If you have all these file then please zip and share them on http://2shared.com/. My red5 installer is not generating it . I would give you feed back after testing it on machine.





5
Wilbur
Points: 510
Posts:0
8/2/2010 7:51:12 AM



if your red5 installation is not working then check the following tutorial and follow the steps.
http://askmeflash.com/tutorial/7/red5-installation-and-setup-how-to

6
Tapas Mishra
Points: 0
Posts:0
8/2/2010 7:53:55 AM



Red 5 installation is working.All the above mentioned xml files and subdirectories are also present.

I can see in browser http://localhost:5080/demos/
all the demo applications are installed.
All the xml files and subdirectories as you people pointed out above are present.

7
Tapas Mishra
Points: 0
Posts:0
8/2/2010 7:55:47 AM



My Red5 installation is very properly working without any problem.
My problem is in an HTML page if I want the video which is getting served via Red5 then above code in my first post I have written and that has not worked.
I am using Jwplayer.
So what more should I check in?

8
Wilbur
Points: 510
Posts:0
8/2/2010 8:36:50 AM



of first confirm the following ,

1)that your flash file is loaded properly in the browser and you are able to see the player
2) the "avtar.flv" is placed in the /streams folder in oflademo folder on red5 server

I recommend you using a new application rather than using the oflademo application, some times there are updates in the server xml files with the red5 new releases and old files do not work.

Also you can verify your application first from with in a flash application by just creating a successful connection and ensure that it works, also you will be able to detect any connection failure and error thrown , after success in flash then try connecting using the player.

9
Tapas Mishra
Points: 0
Posts:0
8/2/2010 10:37:19 AM



I could not understand following in your reply
how do I test this ?
1)that your flash file is loaded properly in the browser and you are able to see the player


regarding 2nd point avatar.flv is placed in the streams folder.

I installed latest svn checkout of red5 and I am using Linux not windows.So built from the latest stable release.

>Also you can verify your application first from with in a flash application by just >creating a successful connection and ensure that it works, also you will be able to >detect any connection failure and error thrown , after success in flash then try >connecting using the player.
I am not clear on this part as I do not know programming flash.
Please elaborate a bit more.

10
Tapas Mishra
Points: 0
Posts:0
8/2/2010 10:38:39 AM



Also I can see all the other demo applications working properly and many other streams when I put any other flv in streams folder.
I have tested it via connecting through VLC (vlc as a client to RTMP server)
and checked in browser also.

11
Wilbur
Points: 510
Posts:0
8/2/2010 11:10:45 AM



regarding first point , I mean to say that In your html page you should be able to see the video player interface. If you are not able to see that , it means your swf file is not loaded. You are loading "player.swf" using that HTML code.

Also make sure "swfobject.js" is placed in the same folder of your html page

what happens here is that you use the player.swf which is a flash file and pass it the required parameters to function. This flash player first makes a connection with red5 server and then streams video. If you know flash development then you can make a connection test application in flash and see what is happening technically and what are the errors occurring when connecting the red5 server.


Also try after changing the streamer to following types

rtmp://localhost/oflaDemo/
rtmp://127.0.0.1/oflaDemo/
rtmp:/oflaDemo/
rtmp://oflaDemo/

12
Tapas Mishra
Points: 0
Posts:0
8/2/2010 11:19:27 AM



Ok if that is what first point was then in the HTML I was able to see the video player interface.
Also player.swf is in the same directory in which test html page is same is case for swfobject.

In fact I have tested the code which this page has generated
http://www.longtailvideo.com/support/jw-player-setup-wizard

13
Rayan
Points: 700
Posts:0
8/2/2010 11:37:11 AM



If your sample applications are working then to my understanding you must be doing some silly mistake like wrong name, path etc, you have linux server then the case of the name of anything should be exactly same.

you can also use this application to test the connection issue , this application is for fms and will also work for red5 as well. Put the server address and the application you are trying to connect.Run the test

http://www.jakehilton.com/?q=node/43

RTMP Port 1935 or RTMP Port 80 should not fail

14
Tapas Mishra
Points: 0
Posts:0
8/2/2010 12:31:26 PM



Following are the results

RTMPT (Tunneling) Port 1935 Failed 14.9s
RTMPT (Tunneling) Port 443 Failed 5.6s
RTMPT (Tunneling) Port 80 Failed 5.6s
RTMPT (Tunneling) Default Failed 5.6s
RTMP Port 443 Failed 0s
RTMP Port 80 Failed 0s
RTMP Port 1935 Success 0.1s
RTMP Default Success 0.1s

Te

15
Davis
Points: 780
Posts:0
8/2/2010 10:44:48 PM



Tapas, I just pasted the following code in html and then created a streams folder inside my SOSample directory and pasted the video.flv from the zip file. It worked fine with the following code.

<script type='text/javascript' src='swfobject.js'></script>
<div id='mediaspace'>This text will be replaced</div>
<script type='text/javascript'>  
  var so = new SWFObject('player.swf','mpl','470','290','9');  
  so.addParam('allowfullscreen','true');  
  so.addParam('allowscriptaccess','always');  
  so.addParam('wmode','opaque');  
  so.addVariable('file','video.flv');  
  so.addVariable('streamer','rtmp://localhost/SOSample');  
  so.write('mediaspace');  
</script> 

16
Tapas Mishra
Points: 0
Posts:0
8/2/2010 11:53:08 PM



I have installed SOSample by http://localhost:5080/install/
but how do I use SOSample

17
Tapas Mishra
Points: 0
Posts:0
8/3/2010 12:10:08 AM



Ok I checked http://localhost:5080/demos/BallControl.html
this is where I googled SOSample is.
But this is not working on my localmachine.
But on the Red5 server physically different than my laptop is.
I was able to see the SOSample working.

18
Tapas Mishra
Points: 0
Posts:0
8/3/2010 12:14:31 AM



Davis I tried exactly the same steps you said.It did not worked.
I checked the SOSample application working on LAN and in your code I replaced localhost by IP of machine.

19
Davis
Points: 780
Posts:0
8/3/2010 10:01:28 AM



well,you seems to have done everything correctly. I cant see any other problem, I think you player is connecting the application fine else will show error if application is not connected on server.

and if you have placed the video.flv file correctly in streams folder in SOSample then, i don't see any other problem.

verify all your filenames correctly for case. My system is windows 7 with red5 9 version

20
Tapas Mishra
Points: 0
Posts:0
8/3/2010 9:56:46 PM



Well I verified the filenames and I had placed the streams correctly in SOSample.
Logically even I feel the steps have been done correctly by now.
I tried similar things with another player called flowplayer and it did not worked.
Though when I go to JWplayer setup wizard website
http://www.longtailvideo.com/support/jw-player-setup-wizard
and I enter the parameters of the file for which I want to have the embedded javascript
the JWplayer website setup wizard is able to connect to my localhost streaming server.
For testing purpose I have setup one more instance of Red5 on Windows ,CentOS, and on local machine.
In each of the case the setup wizard from the website above was able to stream all the files.But my code was not able to do the same which I had copied and pasted from the setup wizard.

21
Friend
Points: 710
Posts:0
8/3/2010 10:41:20 PM



try disabling and antivirus,firewall ,antispyware and popup blockers they sometimes interfere with the internet connection and and drop the unknown kind of data, which may occur for rtmp case

22
Tapas Mishra
Points: 0
Posts:0
8/4/2010 1:22:33 AM



I do not have antivirus,firewall,pop blockers.

23
Tapas Mishra
Points: 0
Posts:0
8/5/2010 2:39:47 AM



Every thing worked and my problem got resolved.
The code on the first post of mine I have not kept it in Document Root of the webserver.
That was the only thing that was stopping things.
The website where I have to test all this is having heavy traffic so I could not disturb that web server I made a clone of entire setup and then this was the reason I had made all the html code in my home directory.

24
crystal
Points: 0
Posts:0
2/16/2011 2:25:11 PM



can anyone have colour id and colour room sources for red5 chat


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 3+4 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions