473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to download streaming video

Any possible way to make a application streaming video downloader like youtube downloader .

i googled and tried the code 100 kb file stored and stopped then not properly downloaded.

Expand|Select|Wrap|Line Numbers
  1. private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
  2.  
  3. // decode the url     
  4. String result = java.net.URLDecoder.decode(enurl.getText(), "UTF-8");
  5.  
  6.  URL u = null;
  7. InputStream is = null;  
  8.  
  9.      try {
  10.               u = new URL(result);
  11.               is = u.openStream(); 
  12.               HttpURLConnection huc = (HttpURLConnection)u.openConnection();//to know the size of video
  13.               int size = huc.getContentLength();                 
  14.  
  15.           if(huc != null){
  16.               String fileName = "FILE.mp4";
  17.               String storagePath="F:/";
  18.  
  19.               File f = new File(storagePath,fileName);
  20.  
  21.               FileOutputStream fos = new FileOutputStream(f);
  22.               byte[] buffer = new byte[1024];
  23.               int len1 = 0;
  24.               if(is != null){
  25.                  while ((len1 = is.read(buffer)) > 0) {
  26.                        fos.write(buffer,0, len1);   
  27.                  }
  28.               }
  29.               if(fos != null){
  30.                  fos.close();
  31.               }
  32.           }                     
  33.      }catch (MalformedURLException mue) {
  34.             mue.printStackTrace();
  35.      } catch (IOException ioe) {
  36.             ioe.printStackTrace();
  37.     } finally {
  38.                try {                
  39.                  if(is != null){
  40.                    is.close();
  41.                  }
  42.                }catch (IOException ioe) {
  43.  
  44.                }
  45.     }
  46.     }
Jan 13 '15 #1
0 1517

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: DMS | last post by:
I need to create some specifications and budget request for a workstation (G5) and all necessary hardware and software for authoring online college courses. The course material would contain short...
3
by: tom | last post by:
I need a C#, peer-to-peer solution for streaming video from a webcam on one box to a client application on the other box. Can someone please help me with this? I can read video from a webcam easy...
0
by: DaveF | last post by:
I want to capture a live streaming video in C# and get a video stream from the web cam. Some samples in c# for video capturing would be helpful. Or VB -- Dave
1
by: Steve Caliendo | last post by:
Hi, Can someone point me in the right direction for doing this? A ton of websites have streaming video, and all I want to do is serve a local webcam on a web page. Thanks, Steve
0
by: Mike | last post by:
Adding Streaming video to your web-page is as simple as a few clicks of the mouse with this amazing tool. http://www.ebvalues.com
3
by: simbat | last post by:
hello guys, i am experiencing some difficulty making a full screen button for my streaming video. i have the following code in my page. but it doesn't seem to work. if you have a code thats working...
2
by: SPG | last post by:
Hi, Two questions for you all.. Firstly, is there a way of streaming video using PHP? At the moment I just have a link to a video file and the whole thing downloads before playing which is a...
2
by: momogi | last post by:
hi all.. I wanna make a site where every visitors can see a streaming video (in real time, may be like youtube). So, in the same time when the page is loading, the video is playing. My questions, is...
17
by: dbest5250 | last post by:
hi all ^^ i'm a newbie and i want to play streaming video in php how do i do that? i have tried and failed, can any one help me? thanks for all ur help
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.