android - Upload Video to Facebook -
I am trying to upload a video to Facebook using the following code
Public empty upload videos (string videopath) {byte [] data = null; String data message = "Your video description is here."; String Notation = "Mobile .wmv"; Bundle ultimate; AsyncFacebookRunner mAsyncRunner = New AsyncFacebookRunner (API); InputStream = Faucet; Try {new file inputstream (VideoPath); Data = redoubout (is); Ultimate = new bundle (); Param.putString ("Message", Data Message); Param.putString ("filename", dataName); Param.putByteArray ("Video", Data); MAsyncRunner.request ("me / video", ultimate, "post", new fbRequestListener (), blank); } Hold (FileNotFoundException e) {e.printStackTrace (); } Hold (IOException e) {e.printStackTrace (); }} Public byte [] readBytes (InputStream inputStream) throws IOException {// It is spread by taking bytes to bytes which you have read the BitReeron OutputStream bytefuffer = new Bytereon Output Stream (); // This bytes is overwritten on each recurrence with the buffer size = 1024; Byte [] buffer = new byte [buffer size]; // We should know how the bytes were written to write the bytes buffer intra lane = 0; While ((len = inputstream.read (buffer))! = -1) {byteBuffer.write (buffer, 0, lane); } // And then we can return your byte array. Return byteBuffer.toByteArray (); } Apply public class fbRequestListener {} @ override public over zero (string feedback, object state) {// TODO auto generated method stub log D. ("Response", "" + response); } @ Override Public Recognition on IoExation (IO Execution E, Object State) {// To-Auto Object String Log D. ("Response", "" + E); } @Override Public Zero onFileNotFoundException (FileNotFoundException E, State Object) {// TODO Automatic Created Stub Log.d ("RESPONSE" "," + E); } @Override Public Zero onMalformedURLException (MalformedURLException e, State Object) {// TODO Automatic Created Method Stub} @Override Public Zero onFacebookError (FacebookError e, State Object) {// TODO Automatic Created Stub Log.d ("Reaction "", "+ E); }} But I am getting the following error message in response {"Error": {"type": "OAuthException", "message": "(# 352) Video file format not Is supported "}}
Can anyone help me? Thanks in advance for your help.
itemprop = "text"> look at this link
I tried all the stuff in this link It was mentioned but I was getting the same error, then I clear the Facebook context and make it again. And my problem was solved.now uploaded the video .. is working
Comments
Post a Comment