这是我将视频直播到 Facebook 的程序
请求后,响应代码为 200,但 Facebook 应用程序未启动实时录制。
我在网上查看我的 Facebook 墙,我找不到任何新的直播视频。
我也从回复中得到了一个网址
rtmp://rtmp-api.facebook.com:80/rtmp/xxxxxxx?ds=1&s_l=1&a=AaaDtiXrR_cranYA
而且我尝试用vlc打开这个url,但是这个url打不开
如何将视频直播到 Facebook
accessToken=AccessToken.getCurrentAccessToken();
if(accessToken==null)
{
Intent intent = new Intent(getApplicationContext(),LoginActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
return;
}
String fbUserId=Profile.getCurrentProfile().getId();
try {
new GraphRequest(
accessToken,
"/"+fbUserId+"/live_videos",
null,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
Log.v("0",response.getRawResponse());
}
}
).executeAsync();
} catch (Exception e) {
e.printStackTrace();
}