在Android应用程序中播放Rtmp流

时间:2014-05-22 16:34:09

标签: android stream rtmp

您好我已经按照this链接上的信息来播放rtmp流,例如" rtmp://178.33.241.201:1935 / teledunet / spacetoon"配置后,我没有得到任何构建错误或语法错误,但是当它在模拟器或实际设备上运行后,启动消息弹出窗口说"不幸的是应用程序已停止工作"请帮助我一件事请提供仅有关rtmp协议的解决方案,因为我对rtsp或http不感兴趣 提前谢谢你!

1 个答案:

答案 0 :(得分:-1)

查看此代码,它可能对您有帮助!

$cc->headers[] = "Host: www.teledunet.com";
$cc->headers[] = "Referer: http://www.teledunet.com/";
$html = $cc->get("http://www.teledunet.com/mobile/?con");
preg_match("/var aut='\?id0=(.*?)'/", $html, $timex);
$swf = "http://www.teledunet.com/mobile/player.swf?id0=".$timex[1]."&channel=".$tmp[1];
$tmxx = $tmp[1];
preg_match("|rtmp://(.*?)/$tmxx|", $html, $r);
if (empty($r[0])){
  $r[0] = "rtmp://5.135.134.110:1935/live";
}
echo "\r\nStart of ".$tmp[0]." in progress...\r\n";
$cmd = 'rtmpdump -q -v -r "'.$r[0].'" -W "'.$swf.'" -p     "http://www.teledunet.com/mobile/?con" -y "'.$tmp[1].'" | "'.$vlc.'" --meta- title="'.$tmp[0].' (Teledunet by Darby_Crash)" - '.$out.'';
shell_exec($cmd);