I use this code in my php file, I use Xsplit for streaming and it's working fine. I'm also using a counter that tells me how many viewers are watching the stream.
</style>
</head>
<body>
<div class="counter_simple" >
<span>number of viewers:</span> <strong id="idOnlineVisitors1">0</strong>
<script type="text/javascript">
(function()
{
var settings = {
handler: 'counter/server/php/handler.php',
container: 'idOnlineVisitors1'
};
var ouc = new WtOnlineUsersCounter(settings);
ouc.Init();
})();
</script>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th><div id="cam1" >
<p >you need FLASH PLAYER!</p>
</a>
<script type="text/javascript">
var file = 'test';
var streamer = 'rtmp://xxx.xxx.xxx.ip/flvplayback';
var s1 = new SWFObject('player.swf', 'player', '640', '480', '9', "#FFFFFF");
s1.addParam('allowfullscreen', 'true');
s1.addParam('allowscriptaccess', 'always');
s1.addParam('quality', 'high');
s1.addParam('bgcolor', '#FFFFFF');
s1.addParam('fgcolor', '#000000');
s1.addVariable('streamer', streamer);
// s1.addVariable('thumbsinplaylist', 'true');
//s1.addVariable('playlist', 'over');
s1.addVariable('skin', 'nemesis.zip');
s1.addVariable('file', file);
s1.addVariable('scroll', 'true');
s1.addVariable('enablejs', 'true');
s1.addVariable('autostart', 'true');
s1.addVariable('bufferlength', '10');
s1.useExpressInstall('expressInstall.swf');
s1.write('cam1');
</script>
my flvplayback.lua file
application=
{
description="FLV Playback Sample",
name="flvplayback",
protocol="dynamiclinklibrary",
mediaFolder="/var/www/media",
aliases=
{
"simpleLive",
"vod",
"live",
"WeeklyQuest",
"SOSample",
"oflaDemo",
},
validateHandshake=false,
keyframeSeek=false,
seekGranularity=1.5, --in seconds, between 0.1 and 600
clientSideBuffer=12, --in seconds, between 5 and 30
--generateMetaFiles=true, --this will generate seek/meta files on application startup
--renameBadFiles=false,
--[[authentication=
{
rtmp=
{
type="adobe",
encoderAgents=
{
"FMLE/3.0 (compatible; FMSc/1.0)",
},
usersFile="/etc/crtmpserver/conf.d/users.lua"
},
rtsp=
{
usersFile="/etc/crtmpserver/conf.d/users.lua"
}
},--]]
acceptors =
{
{
ip="0.0.0.0",
port=6666,
protocol="inboundLiveFlv",
waitForMetadata=true,
},
{
ip="0.0.0.0",
port=9999,
protocol="inboundTcpTs"
},
--[[{