解决方案 »

  1.   


    你可以查查,浏览器播放mp4,估计得html5或者使用第三方控件
      

  2.   

    HTTP协议网络传输都是以流的形式进行传输的,.MP4也是文件,首先你得把文件流缓存到本地,再进行播放。至于,怎么样通过HTTP协议,可以试试这个/**http下载*/  
    public static boolean httpDownload(String httpUrl,String saveFile){  
           // 下载网络文件  
           int bytesum = 0;  
           int byteread = 0;  
      
           URL url = null;  
        try {  
            url = new URL(httpUrl);  
        } catch (MalformedURLException e1) {  
            // TODO Auto-generated catch block  
            e1.printStackTrace();  
            return false;  
        }  
      
           try {  
               URLConnection conn = url.openConnection();  
               InputStream inStream = conn.getInputStream();  
               FileOutputStream fs = new FileOutputStream(saveFile);  
      
               byte[] buffer = new byte[1204];  
               while ((byteread = inStream.read(buffer)) != -1) {  
                   bytesum += byteread;  
                   System.out.println(bytesum);  
                   fs.write(buffer, 0, byteread);  
               }  
               return true;  
           } catch (FileNotFoundException e) {  
               e.printStackTrace();  
               return false;  
           } catch (IOException e) {  
               e.printStackTrace();  
               return false;  
           }  
       }