Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to play video file from android device not emulator(I can play .3gp file from the iinternet but how to play from my device local folder in my android device ?)
How to play video file from android device not emulator [message #712048] Sun, 07 August 2011 00:39 Go to next message
Chocolade Missing name is currently offline Chocolade Missing nameFriend
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: Sun, 07 August 2011 00: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 14:37 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1348
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.
Previous Topic:Trying to play mp4 video file but getting error
Next Topic:What is .option file for?
Goto Forum:
  


Current Time: Sun Nov 23 19:09:14 GMT 2014

Powered by FUDForum. Page generated in 0.02078 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software