Skip to main content


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 12:33 Go to next message
Chocolade Missing name is currently offline Chocolade Missing nameFriend
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.
Re: Trying to play mp4 video file but getting error [message #1702720 is a reply to message #712561] Fri, 24 July 2015 09:38 Go to previous message
Grab Betterlife is currently offline Grab BetterlifeFriend
Messages: 1
Registered: July 2015
Junior Member
As we all know, Android does announce that MP4 is one of Android compatible formats. However, people still encounter the issue of Android won't play MP4. Why?

The reason is MP4 is a container format which means this format may contain various kinds of audio and video codecs while Android is only compatible with MP4 encoded with MPEG-4 or H.264 AVC.

In order to solve Android doesn't play MP4 videos and successfully play all kinds of MP4 files on Android devices; we had better use iDealshare VideoGo to convert Android unsupported MP4 to Android more supported MP4.

Previous Topic:Upgrading from deprecated action framework
Next Topic:Premature end of file under linux in CLI / not seen under Windows
Goto Forum:
  


Current Time: Tue Mar 19 11:10:54 GMT 2024

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

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

Back to the top