我正在制作一个应用程序,我想在 facebook 上发布视频。当我尝试这样做时,我收到了这个错误:
Facebook Error: (#100) Requires extended permission: video_upload or Requires extended permission: publish_actions
这是代码:
mUploadButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
byte[] data = null;
AssetFileDescriptor fileDesc = getResources().openRawResourceFd(
R.raw.movie);
String dataPath = fileDesc.toString();
String dataMsg = "Your video description here.";
String dataName = "movie.mp4";
Bundle param;
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
InputStream is ;
try
{
is = fileDesc.createInputStream();
// is = new FileInputStream(dataPath);
if(is != null)
data = readBytes(is);
param = new Bundle();
param.putString("message", dataMsg);
param.putString("filename", dataName);
param.putByteArray("video", data);
mAsyncRunner.request("me/videos", param, "POST", new SampleRequestListener(), null);
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
}
});
请告诉我问题是什么以及如何解决。