VideoView vidView;
    MediaController mediaController;
    LinearLayout btn_download;
    UserService userService;

       userService = ApiUtils.getUserService();
       if(mediaController == null){
          mediaController = new MediaController(ColumnPipeInstallationActivity.this);
          mediaController.setAnchorView(vidView);
       }
    vidView.setMediaController(mediaController);
    Uri vidUri = Uri.parse(url);
    vidView.setVideoURI(vidUri);<----on create of activity video will start to play. Is it possible to get size of the file.
    vidView.start();}}



  在这里输入代码
     按钮的onClick是否可以将文件下载到设备?

最佳答案

您正在尝试获取content-length字段

如果P Sandesh Baliga的答案不起作用,请尝试this

关于java - 如何从网址获取视频文件的大小?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54034341/

10-10 17:09