Application of PHP to simulate RTMP client sending AMF message (Bullet screen launcher)
Source: Internet
Author: User
Use PHP to simulate RTMP client sending AMF message (Barrage launcher)
Use PHP to simulate RTMP client sending AMF message (Barrage launcher)
August 25, 2010
With the advent of Adobe's Open source of rtmp (real-time Messaging Protocol), various third-party flash multimedia servers have sprung up, renowned for their Red5.
However, the client program is rare, the reason is obvious: Flash plug-ins widely.
There are a small number of client tools designed to help people download streaming videos to the local hard drive, which is represented by Rtmpdump, a C language program based on Librtmp.
To exchange information in depth with FMS, not just one-way download, it is convenient to use the ready-made Rtmp client class library, today to introduce a PHP version of RTMP Client tool: Php-rtmp-client (http://code.google.com/p/ php-rtmp-client/).
Through to a well-known bomb screen video site simulation Flash plugin to send a bullet screen message to explain: "$uid", "MovieID" and "$vid", "Playtype" and "video", "Sortsina" and "new",) , ); Note the host address to change to acfun the actual address, if there is a change, please change $pageinfo = array (//currently does not change it does not matter, the monkey only to page in the domain to determine "page" = "http://220.170.79.105/html/ Ent/20100507/99 328.html ",//change to the page to send subtitles" flashref "=" Http://220.170.79.105/newflvplayer/pla yer1.swf ",// Change to the flash address of the page to which you want to send subtitles); $client = new Rtmpclient (); The host address and the second parameter are subject to the actual address $client->connect ("220.170.79.105", "flvplayer3/$vid", 1935, $data, $pageinfo); The connection is complete, below is the sending code $data 2 = Array (' username ' + $uid, ' mode ' + $mode, ' color ' = $color, ' fontsize ' =>$ FontSize, ' message ' = $msg, ' playTime ' and ' $stime, ' Times ' and $postdate,); $client->call ("Publicchat", $data 2); To send off multiple bullets please call this function directly multiple times for different {$date 2}, no need to establish a connection after I modified php-rtmp-client placed in http://code.google.com/p/cmzacfunmsg/
, you can get the complete source code through SVN.
Secretly tell you, this is the most cutting-edge technology of the screen transmitter, you can play the screen in real-time on the viewers watching video screens.
Disclaimer: The use of the results of this program, and I have nothing to do with the user at his own risk
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.