Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Trying to play mp4 video file but getting error(This is my simple code whats the problem ?)
Trying to play mp4 video file but getting error [message #712561] Sun, 07 August 2011 08:33
Chocolade Missing name is currently offline Chocolade Missing name
Messages: 3
Registered: August 2011
Junior Member
" Cannot play video sorry,this video cannot be played."

First here is the manifest xml code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="(cant post links so)schemas.android.com/apk/res/android"
      package="com.AllFormatsVideoPlay"
      android:versionCode="1"
      android:versionName="1.0">
      <uses-permission android:name="android.permission.INTERNET"></uses-permission>
      <uses-permission android:name="android.permission.STORAGE"></uses-permission>
    <uses-sdk android:minSdkVersion="8" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".AllFormatsVideoPlayActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>


And the main code:

package com.AllFormatsVideoPlay;

import android.app.Activity;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.os.Environment;
import android.widget.*;
import android.net.*;
import java.io.*;

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);
        getWindow().setFormat(PixelFormat.TRANSLUCENT);
        setContentView(R.layout.main);
        //File clip=new File(Environment.getExternalStorageDirectory(),"VIDEO0030.mp4");
        vView = new VideoView(this);
        vView = (VideoView)findViewById(R.id.VideoView);
        vView.requestFocus();
        //vSource ="";
        vView.setVideoURI(Uri.parse("i:/DCIM/100MEDIA/VIDEO0030.mp4"));
        vView.setMediaController(new MediaController(this));
        vView.start();
    }
}


I marked with // some lines in my code i used to play before a file on my android device from the internet but now i want to play a video file wich is on my memory card on my android device or maybe its not on the memory card the directory is in the code.

I tried without i: but it didnt work either.

Thanks for help.
Previous Topic:Dependency of all other projects
Next Topic:How to play video file from android device not emulator
Goto Forum:
  


Current Time: Thu Apr 17 20:49:47 EDT 2014

Powered by FUDForum. Page generated in 0.01518 seconds