regarding playing mpeg4 & h.264 video file in android player

by root » Fri, 13 Feb 2009 18:16:15 GMT


Sponsored Links
 hi,
i have h.264&mp4 video file i am using following code but its giving
ioexception if any one know what is problem pls help me out.also there
is no folder called /raw in /res directory but some one written that we
need to place our video file in raw directory.can v place it any where
in file system & give path.

package org.anddev.android.musicplayer;
import java.io.*;

import android.app.Activity;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MusicPlayer extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.main);
       
        // Find the Button from the xml-file.
        Button cmd_play = (Button)this.findViewById(R.id.cmd_play);
        cmd_play.setOnClickListener(new OnClickListener(){

               //@Override
               public void onClick(View arg0) {
                                        
                 
            MediaPlayer mp = new MediaPlayer();
                                   
            mp.setDataSource("/home/bugsbunny1.m4v");                           
                           
                mp.prepare();                                   
                                                                          
mp.start();                           
                  
// i.e. react on the end of the music-file:

                    mp.setOnCompletionListener(new
OnCompletionListener(){

                         // @Override
                         public void onCompletion(MediaPlayer arg0) {
                              // File has ended !!! Wink
                         }
                    });
               }
        });
    }
}                                  
                    
                                        
                                                
                                        
                  
                  
                  


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--~--~---------~--~----~------------~-------~--~----~



regarding playing mpeg4 & h.264 video file in android player

by Roman Romano » Fri, 13 Feb 2009 19:40:02 GMT


 why don't you just create a file called 'raw' in the 'res' folder????




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


regarding playing mpeg4 & h.264 video file in android player

by root » Fri, 13 Feb 2009 20:22:33 GMT


 i tried that but it didn't worked for me.





-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--~--~---------~--~----~------------~-------~--~----~



regarding playing mpeg4 & h.264 video file in android player

by Dave Sparks » Sat, 14 Feb 2009 07:13:26 GMT


 he res directory inside your source tree does not equate to a
directory on the device. It's just a convention for telling the aapt
compiler what resources need to be included in the APK. Anything you
put in the res directory ends up zipped up inside the APK file along
with the Java code.

If you want to play from a resource file, use the MediaPlayer factory
function:

MediaPlayer mp = MediaPlayer.create(context, R.raw.bugsbunny1);
mp.start();

In your sample code, you use:

setDataSource("/home/bugsbunny1.m4v");

I can only guess this means you are trying to play the file from your
home directory on your host system. This will not work because the
emulator is running its own kernel and has its own file system. You
need to copy your file to the emulated SD card image using adb push
command.

On Feb 13, 4:24 am, root <gurur...@sarayusoftech.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Framework : DevicePolicyManagerService

Hi,



I have added few more functionalities in evicePolicyManagerService.javafile.

These functions are sending intents to custom services which require
permissions.

I m looking out for the manifest file where I could add  <uses-permission>
which will be used in DevicePolicyManagerService.

Any pointers as to where would I find it.



Thanks,

- Bhavya

-- 

2. Is there a way to remove some permissions of already compiled apps?

Hi!

There are so many apps in the market and I don't trust all of them. Is
there a way to remove some permissions of the already compiled apk?
It doesn't matter if I cannot sign it anymore with the original
certificate of the developer.

And is there also a way to add an error-handler into the .apk-file, so
that the errors of the requested permissions will also be supressed?

Greetings, Martin

-- 

3. Image Upload via HTTP POST/Google App Engine

4. (WTA) Agar hh bs auto on-off

5. How to populate a ViewStub using different ImageButtons?

6. How to populate a ViewStub using different ImageButtons?

7. (WTA) size partisi microSD card di moto droid