Recently doing android multimedia learning, adding when using VideoView to play video files online video and video works have played a success, but the video on the player sd card is experiencing a problem.
After checking out of the question because of the path of the. The Internet to find the path of several ways to write: (1) video.setVideoURI (Uri.parse (Environment.getExternalStorageDirectory () + "/ test.mp4"));
(2) video.setVideoURI (Uri.parse ("file :/ / / sdcard/video/test.mp4"));
(3) video.setVideoURI (Uri.parse ("/ sdcard/test.mp4"));
These types of writing path methods are tried, either flat or in the tests were prompted not play on the simulator, this problem has been plagued for several days, there is no master to help me ah! In the end is where the problem? First thank you ・ ・ ・ ・ ・<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Similarly solving. . . . Etc.
Reply:
This method is Environment getExternalStorageAppMediaDirectory (String pkgname) bar, access to multimedia resources through the path
Reply:
sdk versions, sd card path is different,
2.2 above, but also add mnt
Reply:
These days have been busy, no time perspective. Later, after research questions eventually resolved. Said the same with the third floor, and is now on the path of sdk. Different versions of the set of paths are different. I use 2.2 Both versions are correct.
video.setVideoURI (Uri.parse ("/ mnt/nand/sdcard/test.mp4"));
video.setVideoURI (Uri.parse ("file :/ / / mnt/nand/sdcard/test.mp4"));
Another very important point is that the wording used by plate test and simulator test path is different. The above is written in the test plates.
If you are using the mini's words are written.
video.setVideoURI (Uri.parse ("/ mnt/sdcard/test.mp4"));
video.setVideoURI (Uri.parse ("file :/ / / mnt/sdcard/test.mp4"));
Nand directory is to remove this layer. Specific directory in the end is what we can according to their own situation to determine if the tablet can be used with which file browser to a specific path step by step to see your sd card. If you only use the simulator, then you can expand the file directory in the File Explorer android open views to determine the specific path.
I have in mind is to these. There does not seem to textures, such as time of day and then carefully summarize, the written document issued Come on. There do not understand friends can continue to leave a message, we'll continue the exchange under.
Reply:
How to get 2.1 path ah!
How to get video thumbnails ah!
Recourse
Reply:
2.1 Get me the above said path is the same as ah:
video.setVideoURI (Uri.parse ("/ sdcard/test.mp4"));
video.setVideoURI (Uri.parse ("file :/ / / sdcard/test.mp4"));
Both simulator written words are possible, as opposed to 2.2 mmt of this layer is to remove the directory on the line. No tablet on hand was not tested, and does not know what the situation is, but you should look at methods to determine the path I wrote above, in accordance with the method to determine the path that should be no problem with it!
Reply:
The landlord can not tell me online video code? Simulator open sound, no picture will have to start solving the error! ! ~ ~
VideoView Vview = (VideoView) this.findViewById (R.id.surface_view);
VideoView videoView = new VideoView (this);
setContentView (videoView);
videoView.setVideoURI (Uri.parse ("http://61.55.166.72/hebei/Sjz/wtc3_dongfangjugui.mp4"));
videoView.requestFocus ();
videoView.start ();
Reply:
Will the landlord, the project is how to add video playback, video is on the res / raw in it?
Reply:
Screen path automatically get it, get only one path to the specified file is too simple, and took them to automatically search sd card not very good? In the 4.1 version does need to add "/ mnt/sdcard/pengin.mp4 /" in order to develop play the file for playback.
Reply:
My Journey ------ Android Advanced> Use ThumbnailUtils class to get video thumbnails, address: http://blog.csdn.net/ouyang_peng/article/details/16864975
Reply:
In fact, I would like to know how to play online video
Reply:
File video = new File (Environment.getExternalStorageDirectory () + "/ KFC.mp4");
if (video.exists ())
{
videoView.setVideoPath (video.getAbsolutePath ()) ;/ / get the absolute path
video files/ / Set videoView associated with mController
videoView.setMediaController (mController);
/ / Set mController associated with videoView
mController.setMediaPlayer (videoView);
/ / Let VideoView get focus
videoView.requestFocus ();
}
No comments:
Post a Comment