Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte[] data = null;
- dataPath = "url";
- String dataMsg = "Your video description here.";
- Bundle param;
- URL url;
- try {
- Log.v("dataPath", dataPath);
- url = new URL(dataPath);
- HttpURLConnection connection = (HttpURLConnection) url
- .openConnection();
- connection.setDoInput(true);
- connection.connect();
- input = connection.getInputStream();
- } catch (MalformedURLException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- // InputStream is = null;
- try {
- // is = new FileInputStream(dataPath);
- data = readBytes(input);
- param = new Bundle();
- param.putString("message", dataMsg);
- // param.putByteArray("video", data);
- param.putString("filename", "video");
- param.putString("contentType", "video/quicktime");
- param.putByteArray("video.mov", data);
- mAsyncFbRunner.request("me/videos", param, "POST",
- new WallPostListener());
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement