| How to play video file from android device not emulator [message #712048] |
Sat, 06 August 2011 20:39  |
Chocolade Missing name Messages: 3 Registered: August 2011 |
Junior Member |
|
|
The directory in my device wich containing the video files is:
I:\DCIM\100MEDIA
Now in the code in the manifest xml file i added this two lines:
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.STORAGE"></uses-permission>
Now i can play with a link in my code a file from youtube from the internet play it on my android device. Its a format .3gp file. But now i want to play this .3gp files directly from my android local directory videos that i have recorded on my android device.
So the directory in my device local folder with all my video files is:
I:\DCIM\100MEDIA
Now this is the code im using wich is working to play the video file from the internet:
package com.AllFormatsVideoPlay;
import android.app.Activity;
import android.os.Bundle;
import android.widget.*;
import android.net.*;
public class AllFormatsVideoPlayActivity extends Activity {
/** Called when the activity is first created. */
VideoView vView;
String vSource;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
vView = (VideoView)findViewById(R.id.VideoView);
vView.requestFocus();
vSource ="rtsp://v6.cache1.c.youtube.com/CjYLENy73wIaLQnF4qJzpSt4nhMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoYMDFmvL1wMysTQw=/0/0/0/video.3gp";
vView.setVideoURI(Uri.parse(vSource));
vView.setMediaController(new MediaController(this));
vView.start();
}
}
Now what should i change how and where to play video files from my local device ?
For example to play this video wich is on my android device: I:\DCIM\100MEDIA\VIDEO0030.3gp
I tried to put this I:\DCIM\100MEDIA\VIDEO0030.3gp instead the link in my code of the yuotube tried with I: without I: tried as / and \
But getting on my device android error message "cannot play this video".
Hwo can i play files that i have recorded on my android device ?
Thanks.
[Updated on: Sat, 06 August 2011 20:40] Report message to a moderator
|
|
|
| Re: How to play video file from android device not emulator [message #712656 is a reply to message #712048] |
Sun, 07 August 2011 10:37  |
David Wegener Messages: 1156 Registered: July 2009 |
Senior Member |
|
|
On 08/06/2011 07:39 PM, Chocolade wrote:
> The directory in my device wich containing the video files is:
> I:\DCIM\100MEDIA
>
> Now in the code in the manifest xml file i added this two lines:
> <uses-permission
> android:name="android.permission.INTERNET"></uses-permission>
> <uses-permission
> android:name="android.permission.STORAGE"></uses-permission>
>
> Now i can play with a link in my code a file from youtube from the
> internet play it on my android device. Its a format .3gp file. But now i
> want to play this .3gp files directly from my android local directory
> videos that i have recorded on my android device.
>
> So the directory in my device local folder with all my video files is:
> I:\DCIM\100MEDIA
>
> Now this is the code im using wich is working to play the video file
> from the internet:
>
>
> package com.AllFormatsVideoPlay;
>
> import android.app.Activity;
> import android.os.Bundle;
> import android.widget.*;
> import android.net.*;
>
> public class AllFormatsVideoPlayActivity extends Activity {
> /** Called when the activity is first created. */
> VideoView vView;
> String vSource;
> @Override
> public void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
> setContentView(R.layout.main);
> vView = (VideoView)findViewById(R.id.VideoView);
> vView.requestFocus();
> vSource
> ="rtsp://v6.cache1.c.youtube.com/CjYLENy73wIaLQnF4qJzpSt4nhMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoYMDFmvL1wMysTQw=/0/0/0/video.3gp";
>
> vView.setVideoURI(Uri.parse(vSource));
> vView.setMediaController(new MediaController(this));
> vView.start();
> }
> }
>
>
> Now what should i change how and where to play video files from my local
> device ?
> For example to play this video wich is on my android device:
> I:\DCIM\100MEDIA\VIDEO0030.3gp
>
> I tried to put this I:\DCIM\100MEDIA\VIDEO0030.3gp instead the link in
> my code of the yuotube tried with I: without I: tried as / and \
> But getting on my device android error message "cannot play this video".
>
> Hwo can i play files that i have recorded on my android device ?
>
> Thanks.
The Eclipse forums do not provide Android support. You should ask your
question on an Android specific support forum.
|
|
|
Powered by
FUDForum. Page generated in 0.01463 seconds