This project downloads the video while streaming it simultaneously.
The project is mainly based upon the files of Sachin Chandil that are available on github at VideoDownloadAndPlay with minor changes so as to not re-download the videos when the app is opened again, which I have implemented.
For some reason or another when streaming the video from url in surface view, the download is happening but the video is not streaming simultaneously, whereas the same works fine with Video View
- Open your internal storage and go to
- InternalStorage/Android/data/com.example.aditya.downloadwhilestreaming/files
Open the app with your internet connection ON and click on Download and play.
After 2 seconds or so if your connection is fast, you see the video on the screen.
Press download and play again, this time you see another instance of video from the start.This is the the downloaded video
You may check into your phone that the video has downloaded.
Open the app again, and press the button again.
This time you only see 1 instance of the video and it starts immediately without any delay. Now, the video is being played from the directory or storage.